php - 文本溢出会在 phpspreadsheet 中工作吗?
问题描述
我面临的问题是,我无法将单元格值设置为文本溢出(未剪辑或包装)。在 Libre Calc 中,它总是以红色三角形符号隐藏。
我有一个需要动态复制的示例 .xls 表。我成功地使用 Codeigniter 框架中的 PHPSpreadsheet 库生成了相同的 .xls 表。
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setTitle('1');
$sheet->getPageSetup()->setOrientation(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE);
$sheet->getPageSetup()->setPaperSize(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4);
$query_date = $data['month_selected'].' '.$data['year_selected'];
$date = new DateTime($query_date);
$date->modify('first day of this month');
$firstday= $date->format('n/j/Y');
$date->modify('last day of this month');
$lastday= $date->format('n/j/Y');
$xrow = 1;
$sheet->setCellValue('A' . $xrow, 'Attedence for the Period Beginning From '.$firstday.' TO '.$lastday)->getStyle('I' . $xrow)->applyFromArray($borderArrayRowOther);
当我在 office 365 和 Libre Calc 中看到它时,单元格中的文本总是被隐藏。我需要双击才能完全显示。但我需要它充分展示。
[重叠文本][1]:https ://i.stack.imgur.com/zi3Pj.png
解决方案
推荐阅读
- wordpress - 有没有办法向 docker 容器中的 wordpress 站点发出邮递员请求?
- azure-devops - 为自动管道动态设置参数值
- ios - iOS 妙控键盘 API
- lua - Lua脚本循环键按下
- asp.net - ASP.NET Ajax 控制工具包 - 内容安全策略
- mysql - SQL Query 将数据库上的所有表名与 MySQL 联合
- python - 无法在 Azure Edge 中执行模块到模块的通信
- java - 如何查看并添加到 java spring boot 项目中引用的库中的日志?
- outlook - Outlook 插件 SSO + onSend 示例
- c# - ILMerge - 使用通配符并指定主程序集