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

Export the grid

5 Answers 117 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Avi Avni
Top achievements
Rank 1
Avi Avni asked on 29 Aug 2010, 03:43 PM

Hi

I need to export the grid to word or excel

The problem is that grid with paging export only the selected page I need to export the entire grid how can I do this?

Best regards Ehud

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 30 Aug 2010, 08:11 AM
Hi,

Please check this demo for more info (you need to download our demos and check it locally). 

Best wishes,
Vlad
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
0
Avi Avni
Top achievements
Rank 1
answered on 30 Aug 2010, 08:41 AM

Hi Vlad

Thank you

I look at the demo before and it only export the current page its wonderful

But I need way to export all the items in grid.

I checking now if the extension ToHtml() can help.

 


I
appreciate if you can send my code that shows how to do it.


Best regard

Ehud

 

 

0
Vlad
Telerik team
answered on 30 Aug 2010, 08:43 AM
Hi,

 The demo is exactly related to exporting all data instead only current page. 

Sincerely yours,
Vlad
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
0
Avi Avni
Top achievements
Rank 1
answered on 30 Aug 2010, 10:13 AM

 

Hi Vlad

This demo show how to export all grid without Pager

GridViewExportOptions exportOptions = new GridViewExportOptions();

       exportOptions.Format = format;                  exportOptions.ShowColumnFooters = true;

       exportOptions.ShowColumnHeaders = true;

       exportOptions.ShowGroupFooters = true;

 

       RadGrid.Export(stream, exportOptions);

                    

 

 

So if you work with RadDataPager you don’t need to do this

int originalPageSize = dataPager.PageSize;

int originalPageIndex = dataPager.PageIndex;

RadGridView1.Export(stream, exportOptions);

dataPager.PageSize = originalPageSize;

dataPager.PageIndex = originalPageIndex;

 

the problem is when you work with RadDataPager  and do this

RadGrid.Export(stream, exportOptions);

                    

If you can send me demo code that export all grid with RadDataPager  

I will appreciate this

 

Best regards

ehud

0
Avi Avni
Top achievements
Rank 1
answered on 30 Aug 2010, 11:05 AM

Hi Vlad

I resoled the problem

I give the

 

 exportOptions.Items = RadGrid.ItemsSource;

 

Thanks

 

Ehud

 

Tags
GridView
Asked by
Avi Avni
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Avi Avni
Top achievements
Rank 1
Share this question
or