Coder Social home page Coder Social logo

office's People

Contributors

alexandr1994 avatar anourvalar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

office's Issues

Merged cell

Template:
изображение

Params:

$data = [
    'items' => [ [ 'item 1', 'item 2', 'item 3'  ] ]
];

Result:
изображение

Q: possible to replace and not fill?

When using one-dimensional table I want the data filled not to expand the area.
We have calculations for the fields at the right position on a sheet that uses the filled table. The formulas will be affected/touched when filling data with this package. We want the calculations to be untouched.
Is it possible?

Problem with grouping

How to group data? I have tried with the following data:

$data = [
    'categories' => [
        [
            'name' => 'Category 1',
            'products' => [
                [
                    'name' => 'Product 1',
                    'quantity' => 1,
                ],
                [
                    'name' => 'Product 2',
                    'quantity' => 2,
                ],
            ]
        ],
        [
            'name' => 'Category 2',
            'products' => [
                [
                    'name' => 'Product 3',
                    'quantity' => 3,
                ],
                [
                    'name' => 'Product 4',
                    'quantity' => 4,
                ],
            ]
        ],
    ]
];

изображение

Result:

изображение

Or I misunderstand something?

Negative values?

How could I accomplish a negative value from the code given?
Excel doesnt allow the syntax [data.prop] for that.

Just a negative number is an example. I want to use formulas in general.

Use \n to cell

How can I use this construction so that line breaks work for me:

Write a newline character "\n" in a cell (ALT+"Enter")
In Microsoft Office Excel you get a line break in a cell by hitting ALT+"Enter". When you do that, it automatically turns on "wrap text" for the cell.

Here is how to achieve this in PhpSpreadsheet:

$spreadsheet->getActiveSheet()->getCell('A1')->setValue("hello\nworld");
$spreadsheet->getActiveSheet()->getStyle('A1')->getAlignment()->setWrapText(true);

Conditional formatting rules not propagating in 1 dimensional table row spreadsheet

I have set up a 1-dimensional table row similar to the "products" example in template1 spreadsheet.

One of the cells in the template of the 1-dimensional table row has conditional formatting set, so that depending upon the value of the cell it will change colour style.

This works correctly for the first row returned but does not appear to propagate to any other rows, however the text formatting is correctly propagated to all rows.

I can see using LibreOffice or Excel that the conditional formatting is simply not there on any row following the first.

out of memory - templates with (bad?) formulas

I have several excel documents that have formulas within that will give an out of memory error - if I copy and paste just the values into a new spreadsheet the test script works.
I believe the answer having googled this would be to allow granular control over setPreCalculateFormulas within the SheetsService function but I don't know where to add that in - is it possible to expose this as an attribute? Setting it to false would stop the OOM in these cases without reworking the sheet.

Exported XLSX file showing a loading time error

image

Once open the exported file showing this error on loading

using code for reference:

(new \AnourValar\Office\SheetsService())
->generate(
'existing_document.xlsx', // path to template
$data,
false // input data
)
->saveAs(
'generated_document.xlsx', // path to save
\AnourValar\Office\Format::Xlsx // save format
);

Invalid cell coordinate B7 H6 v.2.2.4

I have an empty XLS where i copied your example for products.

CleanShot 2022-11-22 at 16 37 25

I dropped all other data placeholder out but the error remains.

every run the same error 'Invalid cell coordinate B7 H6'

If i bring only scalar values and not the array with the table it runs without error.

Is that already known?

Undefined method 'insertImage'

I tried to insert an image with the name [map], but I get the error that insertImage method of SheetsInterface is not defined.
image

'bar' => function (\AnourValar\Office\Drivers\SheetsInterface $driver, $cell) {
                $driver->insertImage('test.png', $cell, ['width' => 100, 'offset_y' => -45]);
                return 'Logo!'; // replace marker "[bar]" with return value
            }

Multiple tabs?

We are trying to fill multiple tabs in Excel with data.
How do we accomplish multiple Excel tabs with data conversions?

Right now the component just takes the first sheet and not the other...

Value are set on wrong rows

Hello

i discover a bug , when i mixed data repated and non repeated on 2 different lines, example here

Capture d’écran 2023-03-22 192123

if i my first line i put the columns [course.11.full_name], [course.13.full_name], [course.10.full_name] and [course.12.full_name],
and the line below repeated dynamic data such like : [user.cohort.courses.11.progress], this data will be display but on the wrong row, it will be display on the row -1

Best

Usage problem hookValue

Hi!

Encountered a bug
file \AnourValar\Office\SheetsService::handleData:226

if (is_null($value)) {
      unset($data[$row][$column]);
}

if use a similar hook scheme

 ->hookValue(function (SheetsInterface $driver, $column, $row, $value, $sheetIndex) {
                if ($value instanceof Hyperlink) {
                    $driver->sheet()
                        ->getCell($column . $row)
                        ->setHyperlink($value)
                        ->setValue($value->getTooltip() ?? $value->getUrl());
                    return;
                }
                return $value;
            })

snippets (example [VarName]) are not deleted from the outgoing document, when the variable value is empty..
I tried to comment, the snippet was cleared when the variable value was zero

//if (is_null($value)) {
//      unset($data[$row][$column]);
//}

no idea how to solve such a problem?
Thanks for the help

Invalid cell coordinate {TRUE

One-dimensional table works only in 1 records in array.
having a multiple records in one array throw an PhpOffice\PhpSpreadsheet\Exception
Invalid cell coordinate {TRUE

Q: performance optimizations?

Hi!
Any plans on making some performance optimizations in Parser.php? When we run our datasheets it takes around 30-300 seconds to traverse the data. Very slow loops inside Parser.php with multiple for-loops inside for-loops.

It feels like the package parhaps need some caching and loop optimizations.

Functions very slow are calculateDataSchema and replaceMarkers.

Package version 2.1.2.

How to fill cell with "[key_name]”

Hello,

Il looking for creating a double step excel filling and i need to fill some cell with the viariable appelation : "[key_name]";

How can i do that ?

Many thank for this plugin that is easy to use ! :)

is this possible output convert in other format

Hello Paul Redmond,

  1. I want to input (template) docx format and output (saveAs) pdf format, if is this possible then please share sample code.

  2. Mixer can support same first point (Ex. i have generate multiple docx from template and want to output(saveAs) a single pdf file) (Currently giving me Unhandled match case of type AnourValar\Office\Format error)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.