我需要使用
PHPExcel将行单元格(xlsx)合并到列中,然后再尝试使用
PHPExcel.我尝试了以下操作.
$sheet->mergeCells("G".($row_count+1).":G".($row_count+4));
$sheet->mergeCells("H".($row_count+1).":H".($row_count+4));
$sheet->mergeCells("I".($row_count+1).":I".($row_count+4));
其中变量$row_count具有一些不可预测的动态值,如25,50,75等(无规则模式).
它合并前面snap shot所示的单元格,可以在Note单元格的正下方看到.在按这些行合并这些单元格之后,我尝试按列将它们合并,如下所示.
$sheet->mergeCells("G".($row_count+1).":I".($row_count+1));
但它不行.当我尝试打开excel文件时,它要求确认(带有确认框)
Excel found unreadable content in ‘report.xlsx’. Do you want to
recover the contents of this workbook? If you trust the source of this
workbook, click Yes.
如何在Excel中将行和列合并单元格?