PDA

Click to See Complete Forum and Search --> : Running Crystal 5.0 sub report under vb


rod
Jan 20th, 2000, 04:04 PM
I've created a report form using crystal 5.0 to display my data from ms access 97. I then called this report from VB 5.0 with the following code:

rptSalaryDetail.DataFiles(0) = "MyMDB.MDB"
rptSalaryDetail.Connect = "MS Access; PWD=MyPassword"
rptSalaryDetail.ReportFileName = "MyReport.RPT"
rptSalaryDetail.Destination = crptToWindow
rptSalaryDetail.Action = 1

Now here is the problem. The report (MyReport.RPT) contains a sub-report (MySub.RPT) which displays some information from the same database (MyMDB.MDB). Since the database is password protected, an input box appears everytime I generate the report from VB, asking for the database password, which I have already declared (rptSalaryDetail.Connect = "MS Access; PWD=MyPassword"). I suspect that the password the system is asking is for the subreport. I have remove the subreport(MySub.RPT) from the main report (MyReport.RPT) and run again the application, and it resulted to a "No Error" report.

How do you set the connection string of a crystal sub-report from VB?

Gerald
Jan 21st, 2000, 12:56 AM
Rod,

This doesn't help you with your problem, but I thought I'd relay my experience with Crystal Reports version 7. After running into the exact problem you describe I said goodbye to that over bloated CR forever. At the time (about a year ago) I searched Seagate's knowledge base and found absolutely nothing to help with the problem. I was under pressure to meet a deadline so I decided to dump CR and try DataDynamics' ActiveReports. It turned out to be the best decision I ever made.

Try searching Seagate's knowledge base. They may have a solution up there by now--or maybe they don't. :)

Seagate Knowledge Base http://community.seagatesoftware.com/library/kbase.asp

Gerald

rod
Jan 23rd, 2000, 09:26 AM
Thanks for the info Gerald. All the while I thought CR was the best report generator there is, until now.

Gerald
Jan 24th, 2000, 11:55 AM
You're welcome Rod. I got tired of struggling with CR to create reports that were even just a little beyond simple file dumps. CRs' interface to the database was not very intuitive and was often restrictive--I hated using selection formulas. The other downside to CR is that in order to deploy your application you had to include about a dozen different support files (OCX and DLL) as well as the RPT files for each report in your application. With ActiveReports there is only one DLL file and all your reports are compiled within the VB application itself.

ActiveReports is a designer that looks very much like VB's DataReport with the exception that ActiveReports is far more flexible and it does not require that ridiculous DataEnvironment.

You can download the fully functional evaluation copy from: http://www.datadynamics.com/

And to be fair to CR, Seagate also offers a report designer component. I don't know anything about it, but you can download it for free from: http://www.seagatesoftware.com/products/crystalreports/rdc.asp

Gerald