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

Why doesn't my report Open from VB? Please Help.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello All,
I have designed a report in Crystal Reports 8.5. The backend to my project is in SQL Server 2000 and the front end is in Visual Basic. The report is exactly what I need it to be, the name of this report is ReportOver. The problem is in Visual Basic. I have added the Crystal Reports Control, the name of the control is CrystalReport1. I have set it's REPORTFILENAME property to ReportOver. See example below.

CrystalReport1.ReportFileName = App.Path & "\ReportOver.rpt"

I then set the selection formula. View example below.

CrystalReport1.SelectionFormula = "{GroupActivity.PayYear} = " & Trim(txtYear.Text)

Next I call the function of the crystal report control named RetrieveDataFiles. View Example.

CrystalReport1.RetrieveDataFiles

Then I say to print the report to the window (screen). View Example.

CrystalReport1.PrintReport

But when the RetrieveDataFiles function is called an error is generated stating that it is unable to open the report. Error number 20525. It states that there is something wrong with my report. But the report opens fine within crystal reports. Can someone tell me what am I doing wrong. Do I need to use the Crystal Report viewer? If so could somebody show some sample code on how to use it?

Note: I am running crystal reports professional edition. Version 8.5 and VB 6.0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top