php output sql to excel - php

How can I use php sql to export to Excel and NOT csv/tsv?
I have googled for it for a while but am only finding multiple results on exporting to csv.
Even if you just point me to the name of the method I can google it from there.
Thanks

You can use a lib like phpExcel or Spout to create (and read) excel files.
phpExcel : lots of options, but slow
spout : less options, but much faster than phpExcel

Related

reading data from csv file and writing to excel using phpspreadsheet

I need a phpspreadsheet code for reading data from csv file using vlookup and then writing it to multiple xlsx file depending on the criteria
Example:
Reading from this file
source
Getting output like this:
output
I might recommend the PhpSpreadsheet library, it's free and has great documentation on how to do this exact sort of thing.

Does php-excel-reader support xlsx

I am using php-excel-reader, but got error on reading .xlsx file. So does this support xlsx format. Or what is other solution available.
My requirement is just to read the file(xls, xlsx and ods) and render on html page.
PHPExcel seems too much as there is no requirement for editing the excel file.
Yes php support to read .xlsx file.
For that you have to use PHPExcel library.
I have created script to read excle file, You can download script from : https://www.dropbox.com/s/oao0eskflu8nyz1/PHPExcleReader.zip?dl=0
Judging from this issue it doesn't seem to work. They referr you to PHPExcel if you want to use xlsl files. From a first look, this seems like a better alternative anyways.
As far as I know php-excel-reader doesn't support xlsx. PHPExcel would be the way to go. That being said it might be better to store whatever is in your xslx files in a less proprietary way. Taking a long shot I would assume your xslx doesn't contain calculations which do belong in xlsx files but rather table data which would be better stored in some database (txt, csv, sqlite, a database server).

Can I read and parse Excel sheets through php w/o read.php?

I need to read many excel sheets and for that, i'm using php.
My question is where can I get this read.php and where should I save it?
also, where should I put my excel sheets ? I never saw path for excel sheets given in codes on the web.
PHPExcel is a free full-featured PHP library for reading and writing Excel spreadsheets (xls & xlsx too).
http://phpexcel.codeplex.com/
Almost anything can be done with this, that an average user does with Excel, but it's usage needs OOP skills and some higher level practice at PHP.

PHP: reading from and writing to an Excel file

Let's say I've some data in cells A1-Ax from which I should get this data, process and write the result to the B1-Bx, C1-Cx and D1-Dx cells. Preferably using PHP.
You may want to look at PHPExcel.
(PHPExcel) provides a set of classes
for the PHP programming language,
which allow you to write to and read
from different file formats, like
Excel 2007, PDF, HTML, ... This
project is built around Microsoft's
OpenXML standard and PHP.
I think this is best when you have a large application written in PHP which handles excel files. I think this is not the best for very small changes.
Hope that helps.
PHPExcel is really good for reading/writing excel documents (and csv files).
Used it in a lot of projects, works really well.

How can i take an excel file, parse it contents and store the column's data of excel sheet in my database column?

There is one excel sheet which contains student name, rollno etc. How can i parse the contents of excel file and store that in my sql database?
You are looking for PHPExcel library i believe.
http://phpexcel.codeplex.com/
use this class to read the excel files
http://sourceforge.net/projects/phpexcelreader
If you want to do it directly from the Excel file, rather than create an intermediate CSV using Excel's "Save As" options, then look at libraries such as PHPExcel that can read the xls binary format and make the data accessible to your PHP script.
I'd recommend to you that you save it as csv, it's much more easier and less hacking to upload it to the database
here is simple a sample
http://www.bradino.com/php/csv-upload-to-database/
PHPExcel is one of the best PHP classes i have ever worked with. In addition to parsing and reading files of all Excel variations (including csv) the output to Excel 2007 + is excellent.
Be sure to look at the documentation and examples...they will get you up to speed very quickly

Categories