AutoCount coluns numbers

Aug 8, 2011 at 5:21 PM
Edited Aug 8, 2011 at 5:21 PM

Hi!

Have any method to create a simple grid just sending a single array?

Just transform a array to excel file.

 

Ty.

Aug 9, 2011 at 12:17 PM

You can basically just use row and column counts and loop through the cells for a sheet:

for($j=1; $j < $rowcount; $j++) {
    for($i=0; $i < $colcount; $i++) {
$data = $rows[$j][$i]; // array
$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($i, $j+1, $data); } }