This is a migrated thread and some comments may be shown as answers.

Export to Excel with Header and Footer

2 Answers 296 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Charles Jarvis
Top achievements
Rank 1
Charles Jarvis asked on 28 Sep 2011, 01:37 PM
Hello,

Our team is trying to use the Export functionality of the RadGridView, which works as expected, but include a Header and Footer in the resulting ExcelML output.  We are currently using version 2010.2.924.35.  Is there currently a way to add a Header and Footer to an excel file being exported from the RadGridView?

By hooking into the ElementExporting and ElementExported events, I see how we could format the data, or add details to the existing data, but I'm not seeing a way to include a Header or Footer for the entire output.

The data for both the Header and Footer reside in our ViewModel, along with the data source for the RadGridView, but is not currently connected to the RadGridView.

Desired Result:

[Header]
<HeaderRow><HeaderCell/<HeaderCell/><HeaderCell/><.../></HeaderRow>
<Row><Cell/><Cell/><Cell/><.../></Row>
<.../>
[Footer]

Edit:  Just to clarify.  Our goal is an overall file header and footer, NOT column headers or footers.  Something like:
Header--"Report Generated on April 17, 2010"
Body--Grid Export
Footer--"Values are rounded to the nearest dollar"

2 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Ivanov
Telerik team
answered on 30 Sep 2011, 01:45 PM
Hello Charles Jarvis,

I have prepared an example project that illustrates how to achieve this. Please, refer to the attachment.

Kind regards,
Ivan Ivanov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Charles Jarvis
Top achievements
Rank 1
answered on 30 Sep 2011, 01:49 PM
I completely overlooked the fact that we have access to the MemoryStream.

Thanks!
Tags
GridView
Asked by
Charles Jarvis
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Charles Jarvis
Top achievements
Rank 1
Share this question
or