Export data in Grdiview to Excel using  ‘Microsoft.Office.Interop’ in C#

sweet55
sweet55 used Ask the Experts™
on
Export data from GridView to Excel, CSV in asp.net using c#
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
I need to Use 'Microsoft.Office.Interop’  dlls in my project.
there is one solution using interop as well, anyways here is another example:-

http://www.codeproject.com/Articles/248531/Export-Excel-File-for-Csharp
Hello:
Using Office automation  in server environment is not recomended by microsoft:
"Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment."

http://support.microsoft.com/kb/257757

Instead, I would suggest using xslt transform or third party component:
http://ewbi.blogs.com/develops/2005/01/create_excels_s.html
http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx

Best regards
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial