Possible Duplicate:
How to download multiple files with one HTTP request?
I have two excel workbooks that I need to create, I have coded them on the same php page and tested each separate by commenting out the other, and they loading the required workbook then edit and then saves them no problem.
The action is created on one button click. But the issue I am now having is how do i create both separate workbooks on the one click. I have tried to call them separate one after each other and also on from the same file but it just either created the first one and not the second or it corrupts the first one.
What would be the best way around this, other than to have to download buttons for the user to select.
my structure in the one on the same php page would be somethign like:
$objPHPExcel = new PHPExcel();
$objPHPExcel = PHPExcel_IOFactory::load(??????);
$objPHPExcel->setActiveSheetIndex(0);
//add several of
$objPHPExcel->setActiveSheetIndex(0)->setCellValue(???);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('php://output');
//-- the second workbook
$objPHPExcel2 = new PHPExcel();
$objPHPExcel2 = PHPExcel_IOFactory::load(??????);
$objPHPExcel2->setActiveSheetIndex(0);
//add several of
$objPHPExcel2->setActiveSheetIndex(0)->setCellValue(???);
$objWriter2 = PHPExcel_IOFactory::createWriter($objPHPExcel2, 'Excel2007');
$objWriter2->save('php://output');
exit;