>The code that you found is the ugly way of making the file. And it looks like it still uses the Excel COM+ server.
>
>I've been looking for the beautiful way of making an Excel file - a type definition for the complete spreadsheet that can be serialized/deserialized directly to a spreadsheet file - but I haven't found it. Man it would be easy if .NET would generate a type definition from a schema (like it generates a typed dataset from a schema)!
>
>FYI:
>
>The complete schemas are available from
http://www.microsoft.com/downloads/details.aspx?familyid=fe118952-3547-420a-a412-00a2662442d9&displaylang=en.
>
>I also found this small article helpful:
http://72.14.207.104/search?q=cache:6dUDfTIT3ZIJ:www.devx.com/OfficeProDev/Article/29367%3Ftrk%3DDXRSS_officePro+create+type+from+XML&hl=en&gl=us&ct=clnk&cd=26>
>(This one is a cached google search result. The original page is gone or moved).
>
>According to the article, you really don't need crystal to create a spreadsheet from scratch. It advocates designing a "template" in Excel - as you would design a spreadsheet that queried the database directly. Then save the spreadsheet without data as an XSL file and use it to build up the final report.
>
>This sounds like a good way to approach the problem.
The problem with definining a template is that it would require to know the format of the data we are about to put in. In our case, this is fully generic where the data changes from one export to the other.