Git Product home page Git Product logo

twigspreadsheetbundle's People

Contributors

aserratorta avatar chebbix avatar darookee avatar davidromani avatar fdicioccio avatar guiyomh avatar kbaczkiewicz avatar kgilden avatar malheirosrafa avatar mewesk avatar odinsey avatar technetium avatar

Stargazers

 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  avatar  avatar  avatar

twigspreadsheetbundle's Issues

bug pre_calculate_formulas

On src/Wrapper/DocumentWrapper.php:120 you check $this->attributes['preCalculateFormulas'] but actually in the __constructor of the class that attribute (fetched from mewes_k_twig_spreadsheet.yaml) is saved with the key 'pre_calculate_formulas' in snake_case and not in pascalCase.

I am using "mewesk/twig-spreadsheet-bundle": "^1.0" and "symfony/framework-bundle": "^4.1", I don't know if the way symfony pass this attribute has changed through versions but for sure you should able to reproduce the error and check by yourself. I didn't make a PR 'cause I don't know how you prefer to fix this (assuming that this feature has worked in the past and you don't want to break compatibility).

Cheers!

Add xlsrowindex

It would be very convenient to have a function that returns the current row index.
When using this function the coordinates of images and merges don't have to be changed manually when lines are added or removed.

The commit df1eb8b will implement this function

columnDimension: autoSize for default not working properly if first row has merged cells

Hi,

i have a problem with {columnDimension: {default: {autoSize: true}}} of a xlssheet if the first xlsrow has only merged xlscells. The determination of the columsn doesn't work properly, because only the merged cell is recognized. I think it would be better, if in this case more then the first row is used to set the columnDimension for the defined/existing columns.

DrawingWrapper fails when url is not founded

I use your bundle with DrawingWrapper tag to export products and their pictures (they are on the CDN). When the url of the picture is invalid, The following exception is thrown:

An exception has been thrown during the rendering of a template ("Warning: file_get_contents(https://gd3.alicdn.com/imgextra/i1/1741453808/TB20GGrIXmWBuNjSspdXXbugXXa_!!1741453808.jpg): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found ").

This is causes because the url is not founded.
It may be a good idea to ignore URLs (keep blank cell) that could not save data or make it manageable (for example, passing a flag to throw or not throw an error)? Because now I have to pre-test the url for validity.

Can't style border in spreadsheet with twigspreadsheetbundle

Here is the code I'm using, but it's not working (alignment works, not the borders)

{% set style =  {
            alignment : {
                horizontal: 'center'
            },
            borders: {
                bottom: {
                    style: 'thin',
                    color: {
                        rgb: '000000'
                    }
                }
            }
        }
        %}

{% xlscell { style: style } %}Date{% endxlscell %}

CSV separator

Hey,

Is there any parameter to set CSV separator (to semicolon, for example) ?

Thanks !

Incorrect cache directory for images

When using the xlsdrawing tag with an image path e.g. {% xlsdrawing 'directory/image.png' %}

The following exception is thrown:

An exception has been thrown during the rendering of a template ("Failed to create ""/tmp/symfony/cache/dev/spreadsheet/bitmap"": mkdir(): Input/output error.").

This is causes because the default value of the bitmap directory is surrounded with double quotes.

Removing these quotes (and clearing the cache) will solve this problem

Unexpected token: "\" in SyntaxCheckNodeVisitor

There is a problem with function definition in SyntaxCheckNodeVisitor, line 53:
protected function doLeaveNode(\Twig_Node $node, \ Twig_Environment $env).

It appeared to me when I tried to update my project to PHP8, so this can be only PHP8-related issue.

TwigNodes cannot be used with variables

I prepared an example:

{% xlsdocument {format: 'xlsx'} %}
        {% set title = 'test' %}
        {% set style = {columnDimension: {'B': {autoSize: true},'C': {autoSize: true},'D': {autoSize: true},'E': {autoSize: true}}} %}
        {% xlssheet title style %}
        {% endxlssheet %}
{% endxlsdocument %}

What happened: Too many parameters in "data_storage/export.xls.twig"
What I expected: That this call works.

I traced it back to the behaviour of the BaseTokenParser regarding TwigNodeExpressionName. Although style contains an array the type is TwigNodeExpressionName this leads to the base token parser recognizing it as a value type and not as an array.

The following code is responsible for this:

switch ($parameterOptions['type']) {
                    case self::PARAMETER_TYPE_ARRAY:
                        // check if expression is valid array
                        $valid = $expression instanceof \Twig_Node_Expression_Array;
                        break;
                    case self::PARAMETER_TYPE_VALUE:
                        // check if expression is valid value
                        $valid = !($expression instanceof \Twig_Node_Expression_Array);
                        break;
                    default:
                        throw new \InvalidArgumentException('Invalid parameter type');
                }

I'm currently using a workaround with:

switch ($parameterOptions['type']) {
                    case self::PARAMETER_TYPE_ARRAY:
                        // check if expression is valid array
                        $valid = $expression instanceof \Twig_Node_Expression_Array || $expression instanceof \Twig_Node_Expression_Name;
                        break;
                    case self::PARAMETER_TYPE_VALUE:
                        // check if expression is valid value
                        $valid = !($expression instanceof \Twig_Node_Expression_Array) || $expression instanceof \Twig_Node_Expression_Name;
                        break;
                    default:
                        throw new \InvalidArgumentException('Invalid parameter type');
                }

PHP 7.3 support

I got an error when using this bundle with PHP 7.3:

An exception has been thrown during the rendering of a template ("Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?").

The exception is caused from:

in \vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php (line 323)

I think it should be

continue 2;

Accented characters

Hi,

At first, thanks a lot you this bundle !
Is there any configuration in order to set charset ? I have some issues with accented characters, which come differently up to output format.

Thanks !

Latest phpspreadsheet version

Any chance this bundle can be upgraded to the latest release of phpoffice/spreadsheet (currently 1.2) ?

From https://github.com/PHPOffice/PhpSpreadsheet/releases it appears the transition from 1.0.0-beta2 to 1.2.0 only has one breaking change:

BREAKING CHANGE
Constant TYPE_DOUGHTNUTCHART is now TYPE_DOUGHNUTCHART.

This twig integration looks to be super useful but the beta dependency is a deal breaker for me.

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.