Export to Excel with Header and Footer

3 posts, 1 answers
  1. Charles Jarvis
    Charles Jarvis avatar
    2 posts
    Member since:
    Mar 2010

    Posted 28 Sep 2011 Link to this post

    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. Answer
    Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 30 Sep 2011 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Charles Jarvis
    Charles Jarvis avatar
    2 posts
    Member since:
    Mar 2010

    Posted 30 Sep 2011 Link to this post

    I completely overlooked the fact that we have access to the MemoryStream.

    Thanks!
Back to Top