I want to create and download excel file from datatable.Following methods I have used to do this.
1] Directly stream through HTTP response. Sent HTML code directy in HTTP response with some HTML tags with datatable loop through in.
Problem - When we (Save as) excel file while saving it changes its (save as type) as a web page because of the HTML content I am sending.
2] I haved also use Microsoft Interop dll. My work was almost done...!!
Problem - I have read that it requires office to install on server and this is not recommended by Microsoft.
3] I dont want to purchase anything for this task. So as per my study I have found another option that is open xml. I have done this task on my local machine using openxml dll and for that I have installed Open XML Sdk 2.0 (3.8 MB) setup. I want to publish this task on server now. So obviously I need to install Open XML Sdk 2.0 on server too.
Is it safe to install this sdk on server? or Is it risky like microsoft office?
If I am doing anything wrong then please suggest what to do.