View Single Post
  #12 (permalink)  
Old May 16th, 2006, 12:23 AM
Prashu Prashu is offline
Authorized User
Join Date: May 2006
Location: Chennai, TN, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Prashu

Here is a solid answer DRock that i took from another forum

Project > Components, add a reference to the Crystal Reports ActiveX
Designer Run Time Library (CRAXDRT.DLL)

From Project > Components, choos the Crystal ActiveX Report Viewer
library 10.0 (crviewer.dll)

Create a form with a CR Viewer object on it. Resize as needed.

Here's the absolute minimum code neede to run a report

Dim crxApp As CRAXDRT.Application
Dim crxRpt As CRAXDRT.Report

Set crxApp = New CRAXDRT.Application
Set crxRpt = crxApp.OpenReport("C:\MyReport.rpt")

'To View the report
CRViewer.ReportSource = crxRpt

'To print the report straight to the printer, prompting _
the user for the # of pages
crxRpt.PrintOut False