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

Crystal Reports Print/Preview from VB6 1

Status
Not open for further replies.

BlindPete

Programmer
Jul 5, 2000
711
US
Hello,

I apologize for the likely obvious answer to this question but after a day of sturggling with it, I have no other ideas. And I also posted this in the Crystal Forum as well.

VB6, CR10, and ODBC Data

I can not use the designer to embed the reports in the application because the reports will change and be added to over time.

The reports are built referencing an ODBC database and do not save the data with the report. The data is live and constantly changing.

What I have is a preview form with the CrystalActiveXReportViewer. What I want to do is programatically set the RPT file. (The RPT file is selected in another form from a list and passed to the Preview form)

I'm at a total loss on how do this. All the examples I have found involve using the designer which is not an option or me.

Can anyone here point me in the correct direction?

-Pete
 
I know how to generate a report to a file... Add Crystal reports as a reference... then use...

Dim rptAppReport As CRAXDRT.Application
Dim rptReport As CRAXDRT.Report



Casper

There is room for all of gods creatures, "Right Beside the Mashed Potatoes".
 
Excellent. A star for you!

Code:
Dim oCrReport As New CRAXDDRT.Report
Dim oCrApp As New CRAXDDRT.Application
Dim cReportPath As String

...
Set oCrReport = oCrApp.OpenReport(cReportPath, 0)
Me.CrystalActiveXReportViewer.ReportSource = oCrReport
Me.CrystalActiveXReportViewer.ViewReport

-Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top