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
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