/**
* class to generate excel file from rows of data, and a configuration.
+ *
+ * usage :
+ * $x = new Pman_Core_SimpleExcel(array())
+ * $x->send($fn);
+ *
*
* cfg:
* formats
*
* workbook : nameof
*
- * headdata : [
+ * head : [
[ "a", "b" ]
-
- e : f
- ]
+ [],
+ [ "A", "B" ]
+ ],
* cols : array(
array(
'header'=> "Thumbnail",
$worksheet->setColumn ( $c, $c, $col_cfg['width'] / 5);
}
+ $start_row++;
// DB_DataObject::debugLevel(1);
foreach($data as $r=>$cl) {
if (isset($cfg['row_height'])) {
- $worksheet->setRow($start_row +1, $cfg['row_height']);
+ $worksheet->setRow($start_row +$r, $cfg['row_height']);
}
foreach($cfg['cols'] as $c=>$col_cfg) {
$format = isset($col_cfg['format']) ? $formats[$col_cfg['format']] : false;
// echo "<PRE>WRITE: ". htmlspecialchars(print_r(array($r+1, $c,$v), true));
- $worksheet->write($start_row+1, $c, $v, $format);
+ $worksheet->write($start_row+$r, $c, $v, $format);
}
}