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

Detect Type of Export

1 Answer 87 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stuart
Top achievements
Rank 1
Stuart asked on 02 Mar 2011, 04:48 PM
Hi,

We are running into performance issues with the report viewer when clients are running reports with 50,000 or more records where it eventually times out - I suspect memory related with the server ending up using the swap files.

Anyway, obviously no one is really going to want to view or print 50,000 records on the site but they might want to export to CSV. Is there a way to detect the type of rendering at the NeedObjectDataSource event so I can limit the HTML mode to say 1000 records but allow the full amount for CSV?

Also, is there a way of allowing the user to export before the report renders in HTML or is the only way to use the programmatic export as per the PDF example?


Note: this is the latest version of Telerik (Q3 2010)
Thanks

Stuart

1 Answer, 1 is accepted

Sort by
0
Stuart
Top achievements
Rank 1
answered on 02 Mar 2011, 10:32 PM
Hi,

I found the answer:

System.Web.HttpContext.Current.Request.QueryString["ExportFormat"]

which returns null for the HTML view and CSV etc. for an exported view.

This means I can limit the number of records when rendering to the viewer
Tags
General Discussions
Asked by
Stuart
Top achievements
Rank 1
Answers by
Stuart
Top achievements
Rank 1
Share this question
or