Replies: 1 comment 1 reply
-
|
The composer.json file from openscout v4 let me think it is possible to use this version with PHP 8.3 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Livewire PowerGrid version
v6.7.3
Livewire version
v3.7.2
Laravel version
v12.43.1
Which PHP version are you using?
PHP 8.3
Which Theme are you using?
Tailwind
Have you published the resource files and customized them? (php artisan vendor:publish)
Yes
What is the problem?
I need to add CSV export to DataGrid table. I followed the instructions in the official documentation but there are instructions just for openspout/openspout version 4.0. I can not install openspout/openspout version 4 because I have PHP version 8.3. PHP version 8.3 supports just openspout/openspout version 5.
After adding CSV export in header I have got this error message after click on button:
Error
vendor\power-components\livewire-powergrid\src\Components\Exports\OpenSpout\v4\ExportToCsv.php:42
Cannot modify readonly property OpenSpout\Writer\CSV\Options::$FIELD_DELIMITER
PowerGrid goes to ...\vendor\power-components\livewire-powergrid\src\Components\Exports\OpenSpout\v4\ExportToCsv.php\ExportToCsv. (There is no folder \v5 - I looked for it).
openspout/openspout version 5 has properties set as readonly. Datagrid is trying to set properties in Options:
$csvOptions = new Options();
$csvOptions->FIELD_DELIMITER = $csvSeparator;
$csvOptions->FIELD_ENCLOSURE = $csvDelimiter;
And there is problem. I was looking for in documentations and on forums but I did not find any solution. Just that Datagrid does not support openspout/openspout version 5.
Can you look at it, please? Is it possible to add support openspout/openspout version 5 for PowerGrid?
I expect there will be many programmers who will need to use this functionality.
Or there is any other problem? For example on my side?
Best regards,
Code snippets
In DataGrid table in function setUp:
PowerGrid::exportable(fileName: 'my-export-file')
->type(Exportable::TYPE_CSV)
In ExportToCsv class in function build:
$csvOptions = new Options();
$csvOptions->FIELD_DELIMITER = $csvSeparator; // here is error - set readonly property
$csvOptions->FIELD_ENCLOSURE = $csvDelimiter; // here is error - set readonly property
How do you expect it to work?
I expect to use PowerGrid Data Export functionality without problems.
Please confirm (incomplete submissions will not be addressed)
Beta Was this translation helpful? Give feedback.
All reactions