This is a migrated thread and some comments may be shown as answers.

Export data with view definition from radgridview to excel

3 Answers 204 Views
GridView
This is a migrated thread and some comments may be shown as answers.
harsha
Top achievements
Rank 1
harsha asked on 03 Nov 2020, 11:00 AM

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

 

3 Answers, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 03 Nov 2020, 03:42 PM

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/.

0
harsha
Top achievements
Rank 1
answered on 04 Nov 2020, 03:22 AM

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

0
Nadya | Tech Support Engineer
Telerik team
answered on 04 Nov 2020, 12:21 PM

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/.

Tags
GridView
Asked by
harsha
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
harsha
Top achievements
Rank 1
Share this question
or