views:

887

answers:

4

Hi,

I would like to write an excel file under file system. The data source for the excel file will come from SQL Server 2000 in the form of DataSet/DataTable. COM InterOp is not allowed to use in my workplace. The users are using various excel version; 97 - 2003.

It's pretty urgent and it would be much appreciated if you come out possible solutions.

Regards, Thurein

A: 

Write tab delimited data to a text file, save with ".xls " extension. Excel should be able to read that.

WebMatrix
Actually, use .csv or .txt extension, not .xls.
John Saunders
Hi WebMatrix, Thanks for your answer. In fact, I need to merge some cells in the excel file. So I think I couldn't use tab delimited method. Could you give me some clues? Regards,Thurein
Kthurein
A: 

If you can't use COM Interop, then you can't programmtically create an Excel workbook/worksheet in code.

You could however create a DTS package that could create the Excel file you need, but would not allow you to perform merge operations or formatting of the data.

You could have a pre-formatted sheet that is then populated each time though.

ck
Actually, I'm thinking in this way;Create a HTMLTable dynamically, load with data, do cell merging and finally write the contents out to file system as an excel file.I'm not very sure it is possible or not.
Kthurein
It would work, but isn't technically an Excel file, but Excel will read in and display it as though it was.
ck
A: 

Ok if you can't have Excel installed on the server and use COM Interop. Take a look at Aspose Cell

They have a solution specifically to get around this problem

WebMatrix
A: 

you can use ExmWriter dll provided here .Its handy but with limited features. saves ur excel files as xml sheet 2003 format.

Cshah