mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-30 20:18:00 +00:00
Fixed handling of inline strings in XLSX (#2569)
* Fixed handling of inline strings * Added an example for the "inline string" datatype for which the generated XML was fixed in the previous commit. * Handle inline strings exactly the same way as regular strings in the XLS writer, because this is only relevant in the XLSX format.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Cell\DataType;
|
||||
use PhpOffice\PhpSpreadsheet\RichText\RichText;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\Date;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
@@ -144,6 +145,11 @@ $spreadsheet->getActiveSheet()
|
||||
$spreadsheet->getActiveSheet()
|
||||
->setCellValue('C18', '=HYPERLINK("mailto:abc@def.com","abc@def.com")');
|
||||
|
||||
$spreadsheet->getActiveSheet()
|
||||
->setCellValue('A20', 'String')
|
||||
->setCellValue('B20', 'inline')
|
||||
->setCellValueExplicit('C20', 'This will not be added to sharedStrings.xml', DataType::TYPE_INLINE);
|
||||
|
||||
$spreadsheet->getActiveSheet()
|
||||
->getColumnDimension('B')
|
||||
->setAutoSize(true);
|
||||
|
||||
Reference in New Issue
Block a user