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

Radgrid exporting large dataset

2 Answers 157 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 03 Aug 2010, 02:29 AM
Good Day Telerik Support and User Community, 

I have a requirement to export a large amount of data from a table in the which the Radgrid is successfully bound.  There are about 130k rows of data in the table in which the Radgrid is successfully displaying data through the usage of a linq datasource.  This Radgrid implementation was modelled after the performance demo entitled "300000 rows with LINQ" and combined with other demos to introduce smart filtering on the desired columns.  The result is an extremely fast UI presentation. 

Although,  when the user applies the desired filter & selects the export option, the system may sometimes croak depending on the total record count in the resulting dataset.  There are a few ways around this problem & I am hoping you can direct me in the implementation with Radgrid:

Option 1 (ideal):  When the export button is pressed, capture the export event and discover the radgrid's filter selections which are then used asynchronously to generate a report.  The creation/delivery of the report can be done via Telerik reporting or SSRS or some other technology that is better built to handle large loads of data.

Option 2: simply catch the export event and instruct the user to further filter the grid if too many rows are still being shown.

In either option,  I need to figure out 
1-- how to capture the export event
2-- how to determine the filter criteria that the user specified

Please assist me in determining how to perform these two operations, as I cannot find an example or documentation in either.

Thanks in advance...  
--Joe.

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 06 Aug 2010, 02:28 PM
Hello Joseph,

You could try to create a prototype report with the data you want to visualize and decide whether Telerik reporting is suitable for this scenario.

As to the second option - the easiest way would be to use the approach I suggested in your support ticket:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
    int maxItems = 100;
    if (e.CommandName == RadGrid.ExportToExcelCommandName)
    {
        if (RadGrid1.ExportSettings.IgnorePaging && RadGrid1.PageCount * RadGrid1.PageSize > maxItems)
        {
            e.Canceled = true;
            RadAjaxPanel1.Alert("Too many items!");
        }
    }
}

Best regards,
Daniel
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
Joe
Top achievements
Rank 1
answered on 11 Aug 2010, 09:38 PM
Daniel,  Thanks very much for that reply!  I was able to limit the number of exported items until I figure out how to generate an async report from the export button click.  
--Joe.
Tags
Grid
Asked by
Joe
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Joe
Top achievements
Rank 1
Share this question
or