############################### # # insert Data into spreadsheet # ############################### my $row = 1; my $col = 0; while ( my ( $TOTAL, $type, $calendar_date, $location, $rto_store, $change, $remodel_date, $LYTD_START_DATE) = $query->fetchrow_array() ) { $row++; $col=0; $worksheet->write_string( $row, $col++, $TOTAL,$text_format ); $worksheet->write_string( $row, $col++, $type,$text_format ); $worksheet->write_date_time( $row, $col++, $calendar_date, $date_format ); $worksheet->write_string( $row, $col++, $location,$text_format ); $worksheet->write_string( $row, $col++, $rto_store,$store_format); $worksheet->write_string( $row, $col++, $change,$text_format ); $worksheet->write_date_time( $row, $col++, $remodel_date, $date_format ); $worksheet->write_date_time( $row, $col++, $LYTD_START_DATE, $date_format ); $row++;