Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

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

share|improve this answer
    
Thank you for your suggestion! However I would love to avoid completely rewriting this solution if possible. –  James Grizzle Sep 13 '12 at 19:57
    
Well, let me know if you figure it out a different way, or just post it as an answer. –  RJ Cuthbertson Sep 14 '12 at 2:15
add comment
up vote 0 down vote accepted

I decided to go the OpenXML route.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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