Hey guys, I am trying to write data to a google spreadsheet, Using the google GData library thats part of Zend framework. The only way I was able to figure out how to offset the data from starting at row 1 was to set each piece of information 1 cell at at time. Rather than 1 row at a time. Can not seem to figure out how to specify the the row number where I want to row to be inserted.
I am using something similar to this: Found here: http://www.ibm.com/developerworks/library/x-googledata2/ // get results from database // insert header row $rowCount = 1; $result = $dbh->query($sql, PDO::FETCH_ASSOC); for ($x=0; $x<$result->columnCount(); $x++) { $col = $result->getColumnMeta($x); $service->updateCell($rowCount, ($x+1), $col['name'], $ssKey, $wsKey); } $rowCount++; // insert each field of each row as a spreadsheet cell // if large result set, increase PHP script execution time foreach($result as $row) { $colCount=1; foreach ($row as $k=>$v) { $service->updateCell($rowCount, $colCount, $v, $ssKey, $wsKey); $colCount++; } $rowCount++; } The reason I want to offset the header row, is so I can add my own header with some information relating to the data, like last time the data was updated, if the data is being updated currently, etc. The reason I would want ot try to avoid this is because its a really slow process when i have to update 1000s of rows. I also have not been able to figure out a way to batch insert records, unless Im updating cells. I can't seem to do it. -- You received this message because you are subscribed to the Google Groups "Google Spreadsheets API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
