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!

Report file names?

Status
Not open for further replies.

Tckazz

Technical User
Feb 19, 2002
17
US
Here may be a simple question for someone out there.

Can you use a Crystal Report(any version) in a VB6 Application when the name of the report has some other file ext other than Rpt?

If so, what kind of code is needed?

Thanks in Advance..
 
I use Visual FoxPro, not VB, but the concept is probably similar. In VFP, you create the Crystal Runtime Application Object and also create the Crystal Runtime Report Object. Once you've created the two objects, you pass the report name (including path and extension if you want) as a parameter to the OpenReport method of the application object, assigning the result to the report object. Here are the three main lines of code in VFP:

g_oCRApp = createobject ("CrystalRuntime.Application")
g_oCRRep = createobject ("CrystalRuntime.Report")
g_oCRRep = g_oCRApp.OpenReport(r_cReportName)
 
VB should be the same.

Could be a useful security technique renaming your reports to something other than rpt. As long as it's a rpt file format inside the file I don't see any problems. Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top