You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [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)
LinkTest.xlsx is a SQL Server Reporting Services report exported as an Excel file. For reproducing this issue, the report is simply a single link to microsoft.com.
<?phprequire__DIR__ . '/vendor/autoload.php';
// Load the problematic Excel file, then attempt to save it - unfortunately this requires this spreadsheet to reproduce.$filePath = 'C:\\temp\\LinkTest.xlsx';
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filePath);
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
$writer->save('C:\\temp\\LinkTestOutput.xlsx');
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.
What features do you think are causing the issue
Reader
Writer
Styles
Data Validations
Formula Calculations
Charts
AutoFilter
Form Elements
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Which versions of PhpSpreadsheet and PHP are affected?
Tested with
PHP 8.1.11
PHPSpreadsheet 1.28.0
The text was updated successfully, but these errors were encountered:
$relationsFileName for the problematic file is /xl/worksheets/_rels/sheet1.xml.rels.
The leading slash appears to be the issue, and causes $zip->locateName($relationsFileName) on the next line to return false. If I modify this file to strip off the leading /, the sheet can load and save successfully.
Not sure what it is about this file in particular that is making it have the leading slash.
oleibman
added a commit
to oleibman/PhpSpreadsheet
that referenced
this issue
May 4, 2023
FixPHPOffice#3553. Read of `\xl\worksheets\_rels\sheet1.xml.rels` fails on the new test worksheet (generated by 3rd party product), but read of `xl\worksheets\_rels\sheet1.xml.rels` (same name without leading slash) succeeds. I'm not sure why (over 400 tests succeed with the slash), so will probably delay this a bit while I do more research.
* Not Finding Rels File
Fix#3553. Read of `\xl\worksheets\_rels\sheet1.xml.rels` fails on the new test worksheet (generated by 3rd party product), but read of `xl\worksheets\_rels\sheet1.xml.rels` (same name without leading slash) succeeds. I'm not sure why (over 400 tests succeed with the slash), so will probably delay this a bit while I do more research.
* Move Fix
Move to more logical place.
This is:
What is the expected behavior?
Load LinkTest.xlsx and save it.
LinkTest.xlsx
is a SQL Server Reporting Services report exported as an Excel file. For reproducing this issue, the report is simply a single link to microsoft.com.What is the current behavior?
Attempting to save the file throws:
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:
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.
What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Which versions of PhpSpreadsheet and PHP are affected?
Tested with
PHP 8.1.11
PHPSpreadsheet 1.28.0
The text was updated successfully, but these errors were encountered: