2

I have been asked to review an issue with a clients website, but because it was developed by another developer I do not have access to the code itself, however their claims seem to be quite rediculous. There are 3050 rows of data in the grid, each with 12 columns of data(The vast majority of which are true/false), and a total of 352KB of data when exported as a CSV. The issue is the developer is claiming that Telerik grid controls cannot handle an export of this amount of data and it causes .net to crash out with an outofmemory exception. Does this sound familair to anyone, or can anyone tell me this is nonsense?

Some more background...

Server is vastly over-powered - dual quad xeons, 16GB of ram, raid10 SAS array and only a max of 10 users at a time(It's a reporting server).

I will build a test application to prove this point to the client and developer, if your help indicates that it is worth me doing so.

I will love you long time if you can give me a good answer.

Thank you, Tony.

Tony Cheetham
  • 877
  • 7
  • 18
  • Sorry, I know this is an old one, but I had a solution that I forgot to post. I created a test with 100,000 rows of data, and managed to get my puny web server(2GB of ram, DC intel chip) to output half a million rows with only a few seconds delay. The developers in question were just terrible at programming, and were selecting each row of data separately from the database and not closing their objects properly in between connections. – Tony Cheetham Mar 13 '13 at 14:07

3 Answers3

2

I just experimented with this. I have a telerik grid that has 994,015 rows with 21 columns of data. If I filter the grid so it only has 5000 rows of data, it takes about 2 seconds to export. The size of the export is 552KB. 15,000 rows takes about 5 seconds. When I try to export more than 50,000 rows, I start to have a timeout problem.

Daniel
  • 5,602
  • 4
  • 33
  • 36
2

One another suggestion will be to set AllowPaging to false in the export button click event and then perform the export operation.

protected void Button1_Click1(object sender, EventArgs e) 
 { 
        RadGrid1.MasterTableView.AllowPaging = false; 
        RadGrid1.Rebind(); 
        RadGrid1.ExportSettings.IgnorePaging = true;
        RadGrid1.ExportSettings.OpenInNewWindow = true; 
        RadGrid1.MasterTableView.ExportToCsv(); 
 } 

Regarding size limit.. its a very common issue. There is no way around but dropping the use of telerik RadGrid simply use Response.Write. I got around this by using SqlDataReader and loop through every record then writing data out see this article

Dmitry Savy
  • 1,067
  • 8
  • 22
0

I doubt you will be able to reproduce this problem with 3000 rows and 12 columns under normal circumstances. Judging by the provided information, the problem is one (or mix) of the following:

  • you have multiple users exporting this grid at the same time
  • most of these columns are GridTemplateColumns whose ItemTemplate is filled with complex controls like RadEditor for example. In this case the export will fail with far less than 3000 rows.

If possible, post the grid markup here and I will take a look for you.

Daniel Benitez
  • 236
  • 1
  • 2