Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

crystal Viewer not refreshing

Status
Not open for further replies.

ABetha

Programmer
Jul 14, 2010
35
0
0
US
I have a report that is viewed by supervisors
There are 3 parameters on this report.
technician name - which is a dropdownlist
start date - text field
end date - text field

the supervisor selects a techicians name from a dropdownlist and enters in a start and end date to view report. The report shows but when the user attempts to change the technician parameter and view the report the report shows the same data from the previous technician
 
the whole refresh report thing is non functional in my experience, even the report.database.tables[index].dispose() method does didly squat. I solved this by reloading the report when it "hasRecords" or whatever the value is, between capturing the new parameters and relaunching the report. Here is snippet, hope it helps:

if (thisReportChild.HasSavedData)
{
thisReportChild = new ReportDocument();

try
{
thisReportChild.Load(FullFileLocation);
}
catch
{

}
}
 
just a side note, on my development machine, I was getting an an occational value of true from HasSavedData even on first pass if I was relaunching a debug instance. This indicates that the garbage collector was NOT working, even 20 to thirty seconds later. I was also getting an unhandled exception on shut down of my application. I solved this by setting the reportDocument = null, and explicitly killing the crystal viewers current documnent instance when the form with the viewer closed.
 
also a side note, dont let the report talk to the database. It does it poorly. Get the datatable and hand it to the report.
 
You are not telling us what viewer you are using. Chances are that something is wrong with your code (if you developed the viewer) or that you are using the free Crystal 2008 viewer, which can't refresh. There are many free/inexpensive 3rd-party viewers that can refresh.

hth,
- Ido

view, export, burst, email, and schedule Crystal Reports.
 
@IdoMillet
you are correct, my suggestions assume ABetha is using

CrystalDecisions.CrystalReports.Engine
and
CrystalDecisions.Windows.Forms.CrystalReportViewer

Cheers
++J
 
@IdoMillet
I am using the Crystal 2008 viewer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top