rozon
rozon

Reputation: 2538

Getting data from C# to Excel 03/07

I have files with tons of real time data that I process with an C# application. After processing the data it is presented in Excel using a specific template.

This is solved using Interop today. I must say I don't completely gasp the whole Interop situation. Do I have to manually install the Interop functionality on each end user terminal somehow? How does it handle the mix of 2003/2007 versions?

Upvotes: 1

Views: 556

Answers (5)

jmservera
jmservera

Reputation: 6682

If you can use Excel 2007 format use Office Open XML SDK, you can find samples there. I used for some developments and is a bit tricky at the beginning if you have to create the file from scratch, but if you have a template as in your case, then it is easier. It is fast and don't need to have excel installed in the server.

Upvotes: 0

Cheeso
Cheeso

Reputation: 192457

Not sure what you are getting at, but you can read and write Excel files via ADO.NET. This is not interop, nor is it XML file processing. Example.

Upvotes: 0

Aaron Powell
Aaron Powell

Reputation: 25099

If you know the structure of your Excel document (and presuming you don't want and kind of complex macros/ functions/ etc within the Excel document) you can generate XML using the Excel XML format. I'm not referring to OpenXML, I'm referring to the XML format used by Excel prior to 2007.

I cover how to do it here: http://www.aaron-powell.com//blog/september-2008/linq-to-xml-to-excel.aspx

The problem with Interop is that it isn't really designed to hard core document generation. If you try and do a lot of document processing you can run into locks

Upvotes: 3

Svish
Svish

Reputation: 157991

We use SyncFusion which works pretty well. Pretty easy to use too.

Upvotes: 0

tarn
tarn

Reputation: 2182

I've always used FileHelpers. You shouldn't have to do anything with the Excel installation.

Upvotes: 0

Related Questions