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

Can't find reports...

Status
Not open for further replies.

darrylmoore

Technical User
Oct 9, 2001
6
US
I currently have several reports that I have created using older version Crystal reports (4.6.1) that can be printed via my VB4 app. When I created my reports, I was asked to choose a database and then select the fields to be inserted into my report. When I installed my VB, it couldn't find the reports because it was not loaded to the same directory path of the database where the reports were created. How can I get around this problem. My users should have the choice as to where they want to install the VB app.

Thanks for any help.
Darryl
 
You can install your .rpt files in the same folder as the app or in a "reports" subfolder of the app folder. Then use "App.Path + rptname.rpt" to assign the report to the Crystal object in your VB code.
 
I did not hardcode the path, I used the app.path in my code and my reports were loaded into the same directory as the application. I believe when I created my reports, the database path is hardcoded into the reports. When I was creating the reports, Crystal Reports asked me to choose a database so that I could insert database fields into my report. For Instance, If I created my reports from the database using the following path:

C:\ccplan\mydatabase.mdb

And then I insatll my app,reports,and database in a new path c:\newdir\VBapp, I can't view my reports because the reports seem to have the c:\ccplan\mydatabase.mdb attached to it.

is there anyway around this.

Darryl
 
If you are using a pc database, you can install the database in the same folder as your app and, in the report design, under Database/Location, select "Same as Application".

Otherwise, you can pass the database path to the Crystal object in your VB code.
 
rogar,

Thanks for your help, I know that I getting close to a solution. I set the location in my reports to the "Same as the Report". I didn't have the "Same as Application" option as you suggested. I installed my app on a client's machine. When I executed the report, I recieved the following error:

Error opening file, file could not be found "calendar" at the location "calendar".

Calendar is a table in my database. I installed the application, the database and the report files all in the same directory. It looks like it's not finding the database. I'm using Crystal 4.6., do you think this could be the cause of the problems. Any thoughts.

Darryl
 
"Same as the Report" was the database location setting I had in mind. I didn't look it up and just remembered it wrong. I don't know any reason why this would not work in CR 4.6. The error message is confusing, but Crystal does tend to think of database tables as if they were "files" sometimes. Is the database at the client machine exactly the same as on the developer's machine? You could try setting "Verify on Every Print", as least as a test. Beyond that, I don't have any more ideas.
 
Rogar,

Thanks for your help, you have helped me out a great deal, I finally got it working.

Thanks,
Darryl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top