Solved

Crystal Reports and .Net Caching (aka: Resetting Reports, Invalid Group Number)

Posted on 2004-03-22
5
1,421 Views
Last Modified: 2007-12-19
All,

I've inherited a project that uses VB.Net (and the CR viewer) to display reports in a web app. The web form is comprised of 3 dropdown list boxes and corresponding labels, 1 button, and the report viewer. The idea is to select a report from the first list box, select parameters from the other list boxes if applicable, and "Generate Report" with the button.

The generated report appears to be cached and on subsequent "Generate Report" calls, the called report does not reset its parameters. Through debugging I've verified that the web form is passing in the correct values to the SetParameterValue call (example below), however using the SQL Profiler, the SPs are not being called with the correct parameters. The "stale" report also causes a secondary issue: some of the reports have drill downs while others do not. If you drill down in one report, then switch to a report without drilldowns, the following error is thrown: "Invalid Group Number". The drilled down group number is still being saved from the previous report.

Some things I attempted:
- Converted the reports to strongly typed reports (added them to project) instead of just passing in the report path to the ReportDocument.Load method in an attempt to not allow caching. [This resulted in no differnece.]
- Changed setting parameter values from index based to name based. Example:
    - ReportDocument.SetParameterValue(0, Me.drpDownBox.SelectedValue) ...is now...
    - ReportDocument.SetParameterValue("@ParameterOne", Me.drpDownBox.SelectedValue)
- I've tried various reset type methods from multiple objects ... none of which made any difference to the output.

I must be looking for answers in the wrong spot, for this seems to be a simple issue that should be able to be resolved fairly easily. Yet, I have spent at least 24 business hours attempting to find a solution. I've looked over a bunch of sample code, read numerous articles, and rewritten portions of the code multiple times. Any support (even direction pointing) will be greatly appreciated.

Thanks, Heath
0
Comment
Question by:hagolub
  • 2
5 Comments
 
LVL 4

Expert Comment

by:stasau
ID: 10652911
Have you tried using Response.Expires = 0 to force the page to not cache?

0
 

Author Comment

by:hagolub
ID: 10652945
I tried ...

OutputCache Duration="1" VaryByParam="none"

without any affect. I will see if the other response values work. Thanks.
0
 

Author Comment

by:hagolub
ID: 10653731
Doh. Setting the ReportViewers enableviewstate property to false (ReportViewer.EnableViewState = False) solved the problem. Having been frustrated with Crystal Reports, I incorrectly assumed that the problem was a Crystal implementation and not a .Net problem. Thanks for any suggestions submitted.
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 10694379
Closed, 500 points refunded.
PashaMod
Community Support Moderator
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Formula to get month and year from date 5 61
C# Infragistics UltraGrid - Export to Excel 2 111
Business Object Server 2 29
Field in crystal 2011 is being cut off. 9 34
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question