Export to Excel with GridView

11 posts, 0 answers
  1. Elver Emilio Cano Cardona
    Elver Emilio Cano Cardona avatar
    25 posts
    Member since:
    Dec 2009

    Posted 22 Jul 2010 Link to this post

    Good morning

    I have the next case i am using a gridView and i want export a Excel the content the gridView but with exception of any columns. its is possible.. for example i have a GridView with 7 columns and i need export a excel..but only five column of the grid its possible?

    public

     

    void Export(String sFilepath, RadGridView grvExportExcel)

     

    {

     

    try

     

    {

     

    ExportToExcelML exporter = new ExportToExcelML(grvExportExcel);

     

    exporter.SummariesExportOption =

    SummariesOption.ExportAll;

     

    exporter.RunExport(sFilepath);

    }

     

    catch (Exception)

     

    {

     

    throw;

     

    }

    }

    Thanks for your help.
    Best wish
    Elver Cano

  2. Bernd Mueller
    Bernd Mueller avatar
    38 posts
    Member since:
    May 2010

    Posted 22 Jul 2010 Link to this post

    Hi,

    you can set the DoNotExport Option for hiden Columns:

        exporter.HiddenColumnOption = HiddenOption.DoNotExport

    If you set the IsVisible property of the not required columns in the grid to false it should remove them from the export. You can make them visible again after exporting.

    Best regards,

    Bernd
  3. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 26 Jul 2010 Link to this post

    Hello guys,

    Bernd is right. The way to exclude columns from an exported RadGridView is to set their IsVisible property to false and use the DonNotExport option for hidden columns in the export method:
     
    this.radGridView1.SuspendLayout();
    this.radGridView1.Columns[0].IsVisible = false;
    ExportToExcelML exporter = new ExportToExcelML(this.radGridView1);
    exporter.HiddenColumnOption = HiddenOption.DoNotExport;
    exporter.RunExport("c:\\export.xls");
    this.radGridView1.Columns[0].IsVisible = true;
    this.radGridView1.ResumeLayout(false);


    All the best,
    Martin Vasilev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. Alex Wilson
    Alex Wilson avatar
    1 posts
    Member since:
    Dec 2009

    Posted 21 Sep 2010 Link to this post

    I am working with Telerik in ASP.net.

    Can I provide the Excel worksheet's name ?

    Can I merge two radgrids into 1 excel sheet, preferably into two separate worksheets ?

    Can I add in rows such as legend into the spreadsheet to accompany the data ?


                                            Alex
  5. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 24 Sep 2010 Link to this post

    Hi Alex Wilson,

    Thank you for contacting us.

    This thread covers only the RadGridView for WinForms control. Please open a new support thread in appropriate ASP.Net section. This will allow those ASP.NET users who are interested in the same topic to find the answer more easily.

    All the best,
    Martin Vasilev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Daniela
    Daniela avatar
    1 posts
    Member since:
    Jan 2011

    Posted 31 Mar 2011 Link to this post

    is there any way I can export multiples gridviews in one single excel sheet. I have multiple reports and each report i display it in a gridview. I want to export all gridviews that I have in a page into one single excel sheet.

    can this be done ?

    thank you
  7. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 06 Apr 2011 Link to this post

    Hello Bernd,

    Thank you for writing.

    We do not support the described feature. We will implement it in a future release if we have more
    customers request the same.

    Let me know if you have any other questions.

    Greetings,
    Martin Vasilev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Ashish
    Ashish avatar
    2 posts
    Member since:
    Oct 2018

    Posted 12 Sep 2019 in reply to Martin Vasilev Link to this post

    Dear team,

    We are working on ERP and we are finding best tool for our reporting. after research we found Telerik after some requirement full fill after we stuck in export excel sheet. we want all grid to export in single excel file we have tested in PDF there has option for merge but there not good view in PDF because page size fixed. we want in excel please suggest what we can do so that we can continue and final with telerik other wise we have to find another solution. we had checked many user has same requirement from many year ago and hopefully your team do good work for this feature. 

    Best Regards

    Ashish

  9. Dimitar
    Admin
    Dimitar avatar
    2841 posts

    Posted 13 Sep 2019 Link to this post

    Hi Ashish,

    This is now supported and you can export each grid in a separate sheet. You can use the new exporter and set the FileExportMode property. Detailed information is available here: Export to Excel.

    I hope this helps.

    Regards,
    Dimitar
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  10. Ashish
    Ashish avatar
    2 posts
    Member since:
    Oct 2018

    Posted 16 Sep 2019 in reply to Dimitar Link to this post

    Hello Dimitar,

    Thanks for reply. we want to export all grid in single sheet how we can do.

  11. Dimitar
    Admin
    Dimitar avatar
    2841 posts

    Posted 16 Sep 2019 Link to this post

    Hello Elver,

    This can be achieved by using the SpreadProcessing library. This would require to manually iterate the grids and add the data to the document. There is an example of this in our Demo application (see attached).  

    Please let me know if there is something else I can help you with. 

    Regards,
    Dimitar
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top