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

Using VB6 to open Crystal report and export it to pdf

Status
Not open for further replies.

richl13

Programmer
May 1, 2007
16
0
0
US
I wrote a script to query up about 50 ids. Loop thru them and open up the crystal report and pass the ids then export it to pdf format.

I have 2 questions.
1. Instead of doing the below statements each time is it possible to do a refresh?
Set Report = crxApplication.OpenReport("test.rpt", 1)
...
Set Report = Nothing
Set crxApplication = Nothing

2. Sometimes VB closes after it attempts to export. Any ideas? This occurs just before I set the report = Nothing.
 
Yes, you should keep the same report object and simply set a different parameter value in each cycle, retrieve the data, and export.

The main limitations of this approach are that you need to know the list of values ahead of time and that you end up hitting the database 50 times.

You may want to consider 3rd-party tools (see list at: There is at least one 3rd-party Report Manager that can burst a report so that after a single database hit, you end up with a separate pdf file (and if needed a separate email message) for each group level 1. And you can easily trigger the process from your VB application...

Cheers,
- Ido

view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top