A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2008 yearPHP:Writing to excel file using PEAR - page 1
User InfoPosts
PHP:Writing to excel file using PEAR#1
I have installed PEAR, Spreadsheet_Excel_Writer and OLE. The sample program is executed successfully but when I try to read the file it shows garbage values. I also tried $workbook->setVersion(8); and $worksheet->setInputEncoding('UTF-8');

I am using this tutorial and Google lot for this problem.
http://www.sitepoint.com/article/getting-started-with-pear/3/

Thanks in advance.

posted date: 2008-12-23 05:01:00


Re: PHP:Writing to excel file using PEAR#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2008-12-23 05:01:01


Re: PHP:Writing to excel file using PEAR#3
I try to use PEAR only when I really need to...you can easily generate an excel spreadsheet( assuming it's just data) with something like this:$header = "Last Name\tFirst Name\tAge\tJob\n"; // new line is start of new row, tab is next column//ideally you would get this from a DB and just loop through it and append on$row1 = "Smith\tBob\t25\tManager\n";$row2 = "Anderson\tTrent\t32\tCEO\n";$excel = $header.$row1.$row2;$xlsfile = "excel_example".date("m-d-Y-hiA").".xls";header('Content-type: application/vnd.ms-excel');header("Content-Disposition: attachment; filename=$xlsfile");echo $excel;

posted date: 2008-12-23 08:54:00


Re: PHP:Writing to excel file using PEAR#4
You fail to share code. No way anyone tries it based on this description.

posted date: 2008-12-30 15:18:00


Re: PHP:Writing to excel file using PEAR#5
that's just a tab seperated value file though and you're sending headers suggesting the browser treat that data as an excel file. so there's no formatting of data which the poster may require.

posted date: 2009-09-16 14:36:00


Re: PHP:Writing to excel file using PEAR#6
this is a .csv vile, not a real .xls binary file.

posted date: 2010-10-12 00:54:00


select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.