RadGrid Export to Excel and add extra information

5 posts, 0 answers
  1. Justin Pretorius
    Justin Pretorius avatar
    3 posts
    Member since:
    Feb 2010

    Posted 30 Sep 2011 Link to this post

    Good day,

    I was wondering if it is possible to include text above the exported data in an Excel file using the normal Export to Excel method with a RadGrid?

    For example I wish to include a description of the data as follows,  "Description: Data selected using dates between 1 Jan 2011 to 1 Sep 2011", above the actual data exported.

    I shall be grateful for any information on this matter

    Justin
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 Sep 2011 Link to this post

    Hello Justin,

    Try the following code snippet to achieve your scenario.
    C#:
    protected void Btn1_Click(object sender, EventArgs e)
      {
          RadGrid1.MasterTableView.Controls.Add(new LiteralControl("<span><br/>Description: Data selected using dates between 1 Jan 2011 to 1 Sep 2011</span>"));
          RadGrid1.MasterTableView.Caption = "<span><br/>Exported by: John Smith</span>";
          RadGrid1.ExportSettings.OpenInNewWindow = true;
          RadGrid1.ExportSettings.ExportOnlyData = false;
          RadGrid1.MasterTableView.ExportToExcel();
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Justin Pretorius
    Justin Pretorius avatar
    3 posts
    Member since:
    Feb 2010

    Posted 30 Sep 2011 Link to this post

    Brilliant!! Thank you for the swift response!!
  5. Paul
    Paul avatar
    21 posts
    Member since:
    Sep 2011

    Posted 16 Dec 2014 in reply to Shinu Link to this post

    I'm having issue with version 2013.2.717.40 with adding the same controls for the export and it not showing up at all.
  6. Paul
    Paul avatar
    21 posts
    Member since:
    Sep 2011

    Posted 17 Dec 2014 in reply to Paul Link to this post

    It's working now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017