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 Report Viewer shows blank report

Status
Not open for further replies.

msilka

Programmer
Jan 17, 2002
50
0
0
US
I have just started using the Crystal Report Viewer in my company's Visual Basic 6.0 applications. From time to time we have an occurence of a report being previewed and nothing shows in the viewer. This report is usually an Invoice which the user views multiple times. I have the user exit the application and reopen. It seems to work after that. Any hints to why this happens?

Thank you
 
If it's only occasionally, I'd suspect the database or the connection.

If there's a discernable pattern, then it might be that some part of your code isn't handling the refresh properly.

Perhaps if you post your code you'll get better help.

-k
 
I have the same problem, cause I use the frame. The top frame is asp file and the report itself use asp active x viewer for no reason it doesn't like it, but if I open the asp activex viewer without frame,it's ok.
 
Greetings,

I'm having a similar problem in VB6 with the Report Viewer control. I have a big project, with 67+ forms and 12+ class modules and modules.

I am opening the Report Viewer on an MDI form. Here is some code where I open the Report...

Load frmCRViewer 'this is the MDI form with the viewer
frmCRViewer.Show

Inside the frmCRViewer form, I declare the following form-scope objects:

Private CRXApplication As CRAXDRT.Application
Private CRXReport As CRAXDRT.Report

I then use them in the Form_Load event as follows:

Set CRXApplication = New CRAXDRT.Application
Set CRXReport = CRXApplication.OpenReport("C:\myreport.rpt")

'CRViewer91 is the name of the report viewer control
Me.CRViewer91.ReportSource = CRXReport
Me.CRViewer91.ViewReport

Okay, so I do everything I believe I should be doing. The report opens fine in stand-alone Crystal Reports, and I know there is no database connection or lag issues. If I insert the line

me.CRViewer91.PrintReport

...and set a breakpoint on that line, I get the printer selection dialog and can print the report successfully. There is no data or formatting issues with the report on print.

I've checked the report viewer control to make sure its visible, and I've used the Refresh method on it to see if that might be an issue (it wasn't). I'm at a loss.

The nearest thing I've found in the knowledge base at the Crystal Decisions site is something about the viewer in CR version 8 having some problem with really large projects where it won't display the report.

If you have a clue stick, feel free to whack me with it! Many thanks in advance!
 
Update:

It turns out that the problem wasn't as mysterious as I originally thought. About an hour after posting my message Friday, I decided to stop focusing on the Report Viewer control itself and do the common sense thing, which often eludes me.

I went through the rest of the VB code in the form that holds the report viewer and discovered the problem. Bear in mind that this is a big project with a half dozen developers who check forms in and out of Sourcesafe indiscriminately.

It turns our that someone had coded the viewer height and width both to be zero. Yes, I know that is kind of dumb, but I just assumed that the other people on the project wouldn't do something so dense. Then again, I'm dense for not checking for that in the first place.

So, lesson to be learned is: Don't overlook the obvious, and don't assume that your project team associates aren't prone to do goofy things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top