harikr Posted November 12, 2008 Share Posted November 12, 2008 Hi everyone, I already have a code which exports the data to single worksheet in excel. But i also need to export the data in multiple worksheets within a single excel.Please anyone help me out. This is how i am exporting to a single spreadsheet in excel. header("Content-Type: application/vnd.ms-excel"); header("Content-Disposition: filename=ExcelExport.xls"); Link to comment https://forums.phpfreaks.com/topic/132392-how-to-export-to-multiple-spreadsheets-in-excel-using-php/ Share on other sites More sharing options...
Mark Baker Posted November 12, 2008 Share Posted November 12, 2008 This isn't exporting anything to Excel, it's setting the http response headers to download an already existing Excel file.... and isn't setting all the headers at that. How is the Excel file being created? Link to comment https://forums.phpfreaks.com/topic/132392-how-to-export-to-multiple-spreadsheets-in-excel-using-php/#findComment-688378 Share on other sites More sharing options...
harikr Posted November 12, 2008 Author Share Posted November 12, 2008 I have the data in the same file which i am exporting to excel with that headers. what i want is something like i want the data to be populated in two spreadsheets in excel. i am not sure whether any headers needs to be set to pass the data to two spread sheets. my code looks like this. <?php header("Content-Type: application/vnd.ms-excel"); header("Content-Disposition:attachment; filename=ExcelExport.xls"); echo "<form name = 'details' action = '' method = 'post'> <table border='1' cellspacing='1' cellpadding='0' align='center'> <tr align='left' style='font-family: Arial;'> <th>Comments</th> </tr> </table> </form>"; ?> Link to comment https://forums.phpfreaks.com/topic/132392-how-to-export-to-multiple-spreadsheets-in-excel-using-php/#findComment-688434 Share on other sites More sharing options...
Mark Baker Posted November 12, 2008 Share Posted November 12, 2008 I have the data in the same file which i am exporting to excel with that headers[/Quote]This is NOT exporting to Excel. This is writing HTML and pretending that's it's Excel to the browser. You need to create a REAL Excel Workbook. Link to comment https://forums.phpfreaks.com/topic/132392-how-to-export-to-multiple-spreadsheets-in-excel-using-php/#findComment-688442 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.