0

I have multiple SPGridViews on a page. I would like to export them all to one Excel document, each SPGridView on its own tab. Is this possible?

This link is a great start but does not solve my tab issue.

2 Answers 2

0

You can write your own custom export logic by using the COM Interop libraries. The class is Microsoft.Office.Interop.Excel. You probably have to download the MSO Interop pack unless you already have it. Just make sure to get the right Interop libraries for the version of Excel you're targeting.

Tabs are Worksheet objects. The Excel document is the Workbook object.

Here's the link to the class library on MSDN:

http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel%28v=office.14%29.aspx

2
  • Thank you for your suggestion! However I would love to avoid completely rewriting this solution if possible. Sep 13, 2012 at 19:57
  • Well, let me know if you figure it out a different way, or just post it as an answer. Sep 14, 2012 at 2:15
0

I decided to go the OpenXML route.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.