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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CrystalReportViewer flashes...does not display in VB.NET

Status
Not open for further replies.

N11689

Programmer
Jan 29, 2002
113
US
I am writing a VB app where I want the report to preview from within a module.

I have an object of type CrystalDecisions.CrystalReports.Engine.ReportDocument

I am using that object's load event to point to the path where the Crystal Report resides. This report is not embedded within VB.NET. I have Crystal XI Release 2 with Service Pack 2 developer edition installed and am using VS2005.

After loading the report and setting Table Logon Info, parameters, etc., I then do Form1.show().

Form1 contains the CrystalReportViewer. Form1's load event is CrystalReportViewer1.ReportSource = objectreportdocument (as defined as public in the module).

When I run the application (Start debug), the reportviewer flashes and then the program ends. It does not display my report. I need to know why.

Can anyone please help?

 
How are you displaying Form1? Are you using a Sub Main() in your module, creating a Form1 object and displaying it with Form1.Show()? If so, try using Form1.ShowDialog()



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Thank you so VERY much! I have spent so much time trying to figure this out, and it was just adding one word.

I was using Form1.Show(). I just added Dialog to the end per your suggestion and it works like a charm.

Can you please quickly tell me the difference between Form1.Show() and Form1.ShowDialog()?

Again...thank you very much.
 
Basically, ShowDialog opens a form as a modal form, and Show opens a form as a modeless form. A Modal form blocks all access to other parts of the application while it is open. A good example of a Modal form is the File Open dialog box in Microsoft Word. While the File Open dialog is open, you cannot click on any other part of Word.

When programming with forms, when you use ShowDialog code execution stops at the ShowDialog line and does not continue until the form displayed is closed.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top