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

view Crystal Report data in VB6 form

Status
Not open for further replies.

dmccallum

Programmer
Jan 5, 2001
90
US
Instead of opening up the Crystal Viewer can the data that would appear in the report be viewed on a VB6 form? If so, how?
 
Hi,
From Crystal you can use export options and export to CSV,text or excel etc. Then in VB , bind this data in to your datagrid...

///
In project reference mark crystal report runtime lib selected


Global crxapp As craxdrt.Application
Global crxrpt As craxdrt.Report

crxrpt.ExportOptions.DiskFileName = "your file name"
crxrpt.ExportOptions.FormatType = crEFTExcel80
crxrpt.ExportOptions.DestinationType = crEDTDiskFile
crxrpt.EnableParameterPrompting = False
crxrpt.Export False


//
 
I want the report to be created at runtime. The above procedure would be if I had saved and exported the data when I created the report?
 
Hi,
No. The above code will create the crystal report on runtime ie why you have to include crystal report runtime library to your project reference.

I forgot to add 2 statements in fact this should be the first after declaration

Set crxapp = CreateObject("CrystalRuntime.Application")
Set crxrpt = crxapp.OpenReport("mycrystalreport.rpt", 1)

//
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top