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

Cacheing available?

1 Answer 90 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rick Petersen
Top achievements
Rank 1
Rick Petersen asked on 09 Jun 2009, 01:16 PM
Scenario:

I have a report.  When it is run it only displays records with a boolean flag != 1.  After it runs, it needs to flip the flag to 1 so it won't show again.


Attempted solutions:

  1. Make the report window modal, and when it is closed, update the database setting the flag to 1 for all records in the report.  This worked perfectly except users on terminal services would leave the report open, get timed out, records don't get updated, they have to reopen/reprint the report to fix it.
  2. Make the VB form that contains the report set the flags in the OnPreRender, this happens too soon and the data is not there when the report is displayed.  Tried OnPreRenderComplete as well.  Also tried the reportviewer object's prerender... all of these happened too early.
  3. Add the updating code to the select query, so that we get the records we need and THEN immediately update the boolean flag.  This I feel is the proper solution unless there is a better one I've not thought of yet; however when the print dialog is displayed, evidently it makes another trip to the database and runs the stored proc again... therefore the printed report is blank.  I feel this is either just the default behavior or it's because I'm using the NeedsDataSource event to run the storedproc/fill the data set.

Request:

So my question would be simply is there any way in the report obj or in the typed dataset it pulls from, to cache the data and make sure the results in the preview/print window match the initial html preview?  If not, is there a way to make it not render the html preview at all and instead have the first request for data be the print dialog?

1 Answer, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 12 Jun 2009, 11:01 AM
Hi Rick,

We're not aware of your exact scenario and why you need to do these kind of checks. The NeedDataSource event would be fired when printing too as it is being internally exported first and then printed through Adobe's pdf add-in - this is all by design and correct behavior.
If you want to export to pdf directly without showing the report in the viewer, please use the approach from this help article: How do I display a PDF directly in the browser without exporting first?

Greetings,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Rick Petersen
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or