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
PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort(): Argument #1 ($textValue) must be of type string, null given, called in /vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Workbook.php on line 482
<?phprequire__DIR__ . '/vendor/autoload.php';
// Create new Spreadsheet object$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
// add code that show the issue here...$sheetname = ""; //pass in blank as sheetname cause the issue$table1worksheet = new \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet($spreadsheet,$sheetname);
$spreadsheet->addSheet($table1worksheet,0);
$sheetIndex = $spreadsheet->getIndex($spreadsheet->getSheetByName('Worksheet'));
$spreadsheet->removeSheetByIndex($sheetIndex);
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xls($spreadsheet,'XLS');
$writer->save("php://output");exit();
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?
Haven't tested, but confirmed that xls are affected.
Which versions of PhpSpreadsheet and PHP are affected?
"phpoffice/phpspreadsheet": "^1.18",php8.1
The text was updated successfully, but these errors were encountered:
It seems clear that this is a user error. Furthermore, although I can duplicate your result with 1.18.0, we are now many releases past that (we are on 2.0, which followed 1.29.0). With the current release, I ran your code, and saved an xls without problem. I get an error when Excel tries to open the spreadsheet (invalid sheet name), which seems perfectly reasonable. It is arguable whether we are better off throwing an exception rather than producing an unusable spreadsheet, but that is the opposite of this problem. If you want to restore having an exception when we try to write out a spreadsheet to which the user has assigned an invalid title, please open a new issue, and we can discuss that possibility there. For now, I am closing this ticket.
Sorry i give a wrong info on the phpspreadsheet version that i used. The correct version that i use is
phpoffice/phpspreadsheet 1.29.0
i will update to version 2.0 and tryout
This is:
What is the expected behavior?
The xls success output
What is the current behavior?
PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort(): Argument #1 ($textValue) must be of type string, null given, called in /vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Workbook.php on line 482
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?
Haven't tested, but confirmed that xls are affected.
Which versions of PhpSpreadsheet and PHP are affected?
"phpoffice/phpspreadsheet": "^1.18",php8.1
The text was updated successfully, but these errors were encountered: