Export data with view definition from radgridview to excel

4 posts, 0 answers
  1. harsha
    harsha avatar
    7 posts
    Member since:
    Jun 2017

    Posted 03 Nov 2020 Link to this post

    HI,

       I tried to export from my winform radgridview data which contains view definition using example provided in link https://docs.telerik.com/devtools/winforms/controls/gridview/exporting-data/spread-export. Once I tried this code application is not compiling. There were no errors in output window when we carefully checked I found that there is an error related to SpreadExportRenderer. The error was "error BC30002: Type 'Telerik.WinControls.Export.SpreadExportRenderer' is not defined". My TelerikExport.dll version is 2016.1.216.20. Can you please help me out how to solve this issue.

     

    Regards

    Harsha D

     

  2. Nadya
    Admin
    Nadya avatar
    484 posts

    Posted 03 Nov 2020 Link to this post

    Hello, Harsha,

    It seems that use GridViewSpreadExport. The spread export functionality is located in the TelerikExport.dll assembly which must be added to your project. You need to include the Telerik.WinControls.Export namespace in order to access the SpreadExportRenderer.

    Then, you can use the following code snippet to export the grid:

      private void radButton1_Click(object sender, EventArgs e)
      {
          GridViewSpreadExport spreadExporter = new GridViewSpreadExport(this.radGridView1);
          SpreadExportRenderer exportRenderer = new SpreadExportRenderer();
          spreadExporter.FileExportMode = FileExportMode.CreateOrOverrideFile;
          spreadExporter.RunExport("D:\\exportedFile.xlsx", exportRenderer);
          Process.Start("D:\\exportedFile.xlsx");
      }
    
    

    I hope this helps. Let me know if you have other questions.

    Regards,
    Nadya
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

  3. harsha
    harsha avatar
    7 posts
    Member since:
    Jun 2017

    Posted 03 Nov 2020 in reply to Nadya Link to this post

    Hi Nadya,

       Thanks for the quick help. From which version do we have Telerik.WinControls.Export dll? I dont see in my releases. Is it available in Q1 2016 release?

     

    Regards

    Harsha D

  4. Nadya
    Admin
    Nadya avatar
    484 posts

    Posted 04 Nov 2020 Link to this post

    Hello, Harsha,

    Yes, the TelerikExport.dll is available in the 2016.1.216.20 version. You should carefully check in your installation folder:

    I would encourage you to upgrade to the latest version if possible. Thus, you can benefit from all the introduced improvements since 2016. The latest version is 2020.3.1020.

    I hope this information helps. Let me know if you have other questions.

    Regards,
    Nadya
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Back to Top