Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic Cell Merging in phpspreadsheet

My question is about generating an Excel sheet in codeigniter. The excel sheet sub-headings are not fixed, they are as per data, that's why i am not able to merge cells. Is there any solution for that? Ex:-Here sub-headings are not fix.

like image 817
Abhilash Sharma Avatar asked Jan 08 '18 06:01

Abhilash Sharma


People also ask

How do I merge cells automatically?

Click the first cell and press Shift while you click the last cell in the range you want to merge. Important: Make sure only one of the cells in the range has data. Click Home > Merge & Center. If Merge & Center is dimmed, make sure you're not editing a cell or the cells you want to merge aren't inside a table.

How do I merge rows in PHPExcel?

":I". ($row_count+4)); Where the variable $row_count has some unpredictable dynamic value like 25, 50, 75 and so on (no regular pattern). It merges the cells as shown in the preceding snap shot as can be seen immediately below the Note cell.


1 Answers

$spreadsheet->getActiveSheet()->mergeCells("$range1:$range2");
like image 91
Cholowao Avatar answered Oct 28 '22 12:10

Cholowao