custom headers while using runexport method to excel

2 posts, 0 answers
  1. nazeer syed
    nazeer syed avatar
    6 posts
    Member since:
    Sep 2017

    Posted 14 Sep 2017 Link to this post

    ExportToExcelML exporter = new ExportToExcelML(radgridview);
                    exporter.ExportVisualSettings = true;
                    string filePath = "c:\test";
                    string filename = "myfilename" + ".xls";
                    exporter.RunExport(filePath + "\\" + filename);

     

    using the above snippet how to insert a custom HEADER rows in Excel 

     

     

  2. Hristo
    Admin
    Hristo avatar
    1510 posts

    Posted 14 Sep 2017 Link to this post

    Hi Nazeer,

    Thank you for writing.

    From your code snippet, I see that you are using the old ExportToExcelML class. Please note that we also have the GridViewSpreadExport class which is natively exporting to the .xlsx format thanks to the DPL libraries. The spread processing engine in the libraries is more powerful so I strongly recommend that you switch to using the spread export: http://docs.telerik.com/devtools/winforms/gridview/exporting-data/spread-export.

    Using the GridViewSpreadExport class you would be able to create headers and footers according to the example demonstrated here: http://docs.telerik.com/devtools/winforms/gridview/exporting-data/how-to/add-
    header-and-footer-to-the-exported-document
    .

    Still, in case you need to stick to the old exporting engine you can create headers and footers by handling the ExcelTableCreated event: http://docs.telerik.com/devtools/winforms/gridview/exporting-data/export-to-excel-via-excelml-format#events.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top