Skip to content

Excel from template didn't copy charts. Random source data. #3478

Open
@rumcais

Description

@rumcais

This is:

- [x] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

Should copy Charts if there exists.

What is the current behavior?

Error during generation if the graph is based on random rows.:
PhpOffice\PhpSpreadsheet\Calculation\Exception
Formula Error: Unexpected ,

What are the steps to reproduce?

Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:

<?php

require __DIR__ . '/vendor/autoload.php';

        $inputFileType = 'Xlsx';
        $inputFileName = 'Graph.xlsx';
        $reader = IOFactory::createReader($inputFileType);
        $reader->setIncludeCharts(true);
        $spreadsheet = $reader->load($inputFileName);
       $writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
        $writer->setIncludeCharts(true);
        $writer->save('output.xslx');

If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.

This template works
https://ufile.io/3pkwv0xz
This template is not working
https://ufile.io/gktlbr4j

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions