Click here to Skip to main content
15,921,793 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey, I have been trying to export a dataobject to a nicely formatted excel spreedsheet and have not figured out how.

Things I've tried
-I can create a .csv file but you can not format in .csv.
-Also the Interlop library is not allowed due to security reasons.

Are there any other ways that you might know of to do it?

I was thinking Jet or Ace. Or maybe as an XML file with XSL styling. I've looked at different ways to do it but I haven't found a guide that tells me what I have to do to accomplish such a task. Any help would be greatly appreciated!
Posted

1 solution

If you are targetting Excel 2003 and higher then yes XML can be an answer.

below is the link talks about how to do this:
Generating Excel (XML Spreadsheet) in C#[^]

Thanks,
Hemant
 
Share this answer
 
Comments
MJ_ 12-May-11 11:41am    
I've looked at that and I don't see how that is styling it.
I am currently writing to an XML file and outputing correctly, but where is it that it opens it up in excel and where is it that it formats the data columns?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900