-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Description
This is:
- 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?
Each wide char should be ~2 normal-char-wide when using setAutoSize(true), e.g.

What is the current behavior?
Each wide char only takes one-char width when using setAutoSize(true).

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';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx as XlsxWriter;
// Create new Spreadsheet object
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
// add code that show the issue here...
// ... Get Data called `$data` (2D-array), each row has index `is_synced`
foreach($data as $i => $item) {
$rowNum = $i + 1;
$sheet->setCellValueExplicit("D{$rowNumber}", !empty($row['is_synced']) ? '已同步' : '未同步', \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
}
$writer = new XlsxWriter($spreadsheet);
$writer->save('php://output');
# Free Memory
$spreadsheet->disconnectWorksheets();
unset($spreadsheet);
exit;Which versions of PhpSpreadsheet and PHP are affected?
PHP 7.0.12 (NTS)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels