Reputation: 160
I have a small wpf product which requires exporting data to excel with out excel installed on the client machine.How to achieve this in C#.After exporting, this excel can be opened by Open office. All I wanted is to save excel file to the client hard disk. Even excel is not installed he should be able to save the file,he may not be read it without excel but should be able to save. I dont want to any 3rd party or some other open xmls. Recently I downloaded a product which is able to export to excel without excel installed and able to open it with open office.
When i checked their binaries they contain office.dll ,Microsoft.Vbe.Interop.dll and Microsoft.Office.Interop.Excel.dll's only .I want to know how they are able to manage with these dlls.
I have already written code for this but its breaking when excel is not installed.
I have read many open xml and other stuff relating to this but not satisfied. My requirement is too simple ,just exporting datatable data to excel,no reading back the data and no fancy oparations with excel.
Please give me suggestions and links will be appreciated. Thanks in advance
Upvotes: 2
Views: 2537
Reputation: 22445
xslt transformation can also to the job. i use it to export wpf datagrid data.
Upvotes: 1
Reputation: 45096
You can use CSV, XML, or ADO
How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET
Upvotes: 2