Re: PHPExcel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jim,

I placed it above like you said, but i get the same result. I think I need
to do something like the below:

if(!empty($query)) {
while ($row = ifx_fetch_row($query)) {
for ($i = 3; $i <= 50; $i++) {
 $stat_year = $row['stat_year'];
 $stat_month = $row['stat_month'];
 $name = $row['_name'];
 $case_number = $row['case_number'];
 echo "This ".$stat_year." ".$stat_month." ".$j_name." ".$case_number."<br
/>\n";
 $objPHPExcel->getActiveSheet()->setCellValue('A' . $i, $stat_year);
 $objPHPExcel->getActiveSheet()->setCellValue('B' . $i, $stat_month);
 $objPHPExcel->getActiveSheet()->setCellValue('C' . $i, $name);
 $objPHPExcel->getActiveSheet()->setCellValue('D' . $i, $case_number);
 }
 }
}

To get it to work I need to set the $i value to the starting cell I want.
so, $i = 3 means that setCellValue('A' . $i) means the output will start
populating the data in Excel cell A3. If I use the code above I get an
output of the exact same record in rows 1-50.  Maybe I need to put my query
results into an array and use the $i value to select that row of data from
the array also?

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux