Mam problem z drukowaniem nazw kolumn z mysql'a z tym modulem.
Zwraca mi blad :
Fatal error: Call to a member function columnCount() on a non-object in C:\wamp\www\spred2.php on line 116
<?php $rowCount=0; for ($x=0; $x<$result->columnCount(); $x++) { $meta = $result->getColumnMeta($x); $sheet->write($rowCount, $x, $meta['name']); ?>
Pozniej jak juz drukuje zawartosc tablicy to jest ok
<?php { // Write each item to the sheet if($item['T1'] > 0) { $cart->writeRow($currentRow,0,$item,$titleFormat); // Remember Excel starts counting rows from #1! $excelRow = $currentRow + 1; // Create a PHP string containing the formula $formula = '=PRODUCT(B' . $excelRow . ':C' . $excelRow .')'; // Add the formula to the row $cart->writeFormula($currentRow,60,$formula,$titleFormat); }else{ $cart->writeRow($currentRow,0,$item,$selectFormat); // Remember Excel starts counting rows from #1! $excelRow = $currentRow + 1; // Create a PHP string containing the formula $formula = '=PRODUCT(B' . $excelRow . ':C' . $excelRow .')'; // Add the formula to the row $cart->writeFormula($currentRow,60,$formula,$selectFormat); } $currentRow++; } ?>