user728148
user728148

Reputation: 161

openXML SDK create Excel file

I am creating Excel files using OpenXML SDK 2.0.

  1. Is it required to install OpenXML SDK in the server?

  2. If possible, can someone send me a sample code to create Excel file without using a template?

  3. Is it necessary to save the excel file created using OpenXML? I am creating the file but would not like to save it. Also, would be creating pivot tables in the excel file.

Thanks,

Upvotes: 1

Views: 2341

Answers (2)

3) You can use a memory stream, SpreadsheetDocument has Create and Open functions based on stream, too (not only file path or package).

Upvotes: 1

amurra
amurra

Reputation: 15401

  1. You will need to include the dll in order to use the sdk, which should get built out when you deploy.

  2. I would recommend using a template since it will already contain a bunch of the XML that will make the Excel file valid and complete that you will not have to worry about adding. If you are totally against using one, then explore this blog for examples.

  3. You will need to save the changes so that when you return the file it will contain your changes.

Upvotes: 1

Related Questions