Export data from SQL into Excel files

K

Kim

I am trying to determine if its possible to export data directly into
an Excel file instead of exporting to a comma-separated (.csv) file
first. And later import that csv-file to an Excel file.
Data is extracted from a MSSQL database. Excel files must be in
either .xls (Excel 97-2003) or .xlsx (Excel 2007) format.

Question 1: Is it possible to create an Excel file from scratch up ?
Question 2: If "yes" to Q1, is it limited to the .xls or .xlsx file
format ?
Question 3: If "yes" to Q1, is there limitations of what information
that can be saved ? (such as formulas, only numbers/text or formating)
Question 4: If "no" to Q1, is there any third-party plug-in or
software that can preform the creation of an Excel file ?

If this is can only be done via some programming then it must be in
PHP (web).
 
G

Guest

The 'bottom line' of your post is the catch. Had you been asking about doing
all of 1-3 from within Excel, the answers would have been easy to provide.

My bottom line is that you're probably better off sticking with creating the
..CSV file in your web application: they're easy to create and compatible with
all versions of Excel.

Excel used a file format called BIFF (Binary Interchange File Format) up
until Excel 2007. There were various versions of BIFF. With Excel 2007, the
file format became part of the Office Open XML formats - there are several of
them (one for each of the .xls? type files). Of course, 2007 retains the
ability to open earlier BIFF formatted .xls files - so that would be one
option to keep coding to a minimum: only build the BIFF formatted file that
could be read by a wider range of Excel versions. If you go with the XML
Spreadsheet format (XMLSS, introduced with Excel XP [2002]) then you're
restricting the audience.
 
K

Kim

Thank you very much.

The 'bottom line' of your post is the catch. Had you been asking about doing
all of 1-3 from within Excel, the answers would have been easy to provide.

My bottom line is that you're probably better off sticking with creating the
.CSV file in your web application: they're easy to create and compatible with
all versions of Excel.

Excel used a file format called BIFF (Binary Interchange File Format) up
until Excel 2007. There were various versions of BIFF. With Excel 2007, the
file format became part of the Office Open XML formats - there are several of
them (one for each of the .xls? type files). Of course, 2007 retains the
ability to open earlier BIFF formatted .xls files - so that would be one
option to keep coding to a minimum: only build the BIFF formatted file that
could be read by a wider range of Excel versions. If you go with the XML
Spreadsheet format (XMLSS, introduced with Excel XP [2002]) then you're
restricting the audience.

Kim said:
I am trying to determine if its possible to export data directly into
an Excel file instead of exporting to a comma-separated (.csv) file
first. And later import that csv-file to an Excel file.
Data is extracted from a MSSQL database. Excel files must be in
either .xls (Excel 97-2003) or .xlsx (Excel 2007) format.
Question 1: Is it possible to create an Excel file from scratch up ?
Question 2: If "yes" to Q1, is it limited to the .xls or .xlsx file
format ?
Question 3: If "yes" to Q1, is there limitations of what information
that can be saved ? (such as formulas, only numbers/text or formating)
Question 4: If "no" to Q1, is there any third-party plug-in or
software that can preform the creation of an Excel file ?
If this is can only be done via some programming then it must be in
PHP (web).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top