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

EExport to Excel - RadgridView Silverlight Control

5 Answers 60 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kumar
Top achievements
Rank 1
Kumar asked on 14 May 2015, 07:42 AM

We are exporting data from rad grid view to excel in one of our applications. Would like to know if there is any limitation on the number of records exported to excel.

If the number of records are above 55 K then export to excel functionality is not working. Please find the sample code below. Appreciate your help.

Sample Code:

private void ExportExcel()

       
{

           
BusyIndicator1.IsBusy = true;

           
try

           
{

 

               
// open file dialog to select an export
file.  

                SaveFileDialog sDialog
= new SaveFileDialog();

               
radDataPagerMain.PageSize = 0;

               
sDialog.DefaultExt = "*.xlsx";

               
sDialog.Filter = "Excel Workbook
(*.xlsx)|*.xlsx";

               
if
(sDialog.ShowDialog() == true)

               
{                   


                    var workbook =
CreateWorkBook(radGridView1);

 

                   
if (workbook != null)

                   
{

                       
var provider = new XlsxFormatProvider();

                       
using (var output = sDialog.OpenFile())

   
                    {

                           
provider.Export(workbook, output);

                       
}

                   
}

 

               
}

               
radDataPagerMain.PageSize = 16;

               
BusyIndicator1.IsBusy = false;

           
}

           
catch (Exception ex)

           
{

               
MessageBox.Show(ex.Message);

               


            }

 

       
}

 

       
private static Workbook CreateWorkBook(RadGridView grid)

       
{

           
try

           
{    

               // return workbook;

               
Workbook
book = null;

               
               
using (var stream = new MemoryStream())

               
{

                   
grid.Export(stream, new GridViewExportOptions()

                   
{

                       
Format = ExportFormat.Csv,

                       
ShowColumnFooters = grid.ShowColumnFooters,

                       
ShowColumnHeaders = grid.ShowColumnHeaders,

                       
ShowGroupFooters = grid.ShowGroupFooters

                   
});

 

                   
stream.Position = 0;

 

                   
book = new CsvFormatProvider().Import(stream);

               
}

               

                return book;

           
}

           
catch (Exception ex)

           
{

               
MessageBox.Show(ex.Message);

               
return null;

           
}

        }

5 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 18 May 2015, 04:02 PM
Hello Kumar,

I have tested the exporting of RadGridView on my side, and it is working correctly with more than 55K items. Please bear in mind, that exporting such large amounts of data is highly dependent on the machine on which this functionality is used. I am sorry, but we cannot guarantee that in this case it will be working on absolutely all machines.

Best Regards,
Stefan
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Kumar
Top achievements
Rank 1
answered on 18 May 2015, 04:41 PM

Thanks Stefan for your reply but could you please let me know if there is any limitation on the number of records(like a fixed number of records) exported using radgridview (Silverlight control)

Awaiting reply

0
Stefan
Telerik team
answered on 19 May 2015, 10:22 AM
Hi Kumar,

I have tested exporting up to 800 000 records and the functionality is working correctly. So, for 55 000 items the exporting of RadGridView should be definitely working.

Best Regards,
Stefan
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Kumar
Top achievements
Rank 1
answered on 19 May 2015, 05:20 PM
Thanks Stefan. Could you please send me a sample project to cross check what we are doing wrong
0
Stefan
Telerik team
answered on 20 May 2015, 03:08 PM
Hi Kumar,

Please refer to the RadGridView Integration online demo, as it demonstrates how RadGridView can be exported.

I hope this helps.

Best Regards,
Stefan X1
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Kumar
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Kumar
Top achievements
Rank 1
Share this question
or