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!

Foxpro commands to access crystal reports 1

Status
Not open for further replies.

lot

Programmer
May 6, 1999
2
US
I am developing an application in Microsoft Foxpro. I would like to use Crystal Reports. Can I access cyrstal reports from Foxpro? If so, can you direct me to the info I need to do the job.
 
This is no problem. Set up the FoxPro database. It needs to be in standard dbf format. Know where it is.<br>
<br>
Go into Crystal. Set the location of the database. Make certian that you put in the entire path. Then 'verify the database'. All you have to do is click on it.<br>
<br>
Then set up the report.
 
Thanks for the info. However, what I really would like to know is how to call my crystal reports from a visual foxpro program. I can set the reports up ok. I just need to to be able to run the reports from my program. Thanks
 
Hi there,

I have a couple of information abou this, but it was hard to find. You can find ifo on the Crystal reports site, but the next code should help you getting started, this is for RDC 8.5 and VFP 6.

This Code can be in you form init event.
Before this you must insert the crystal viewer object to your form, Something very important, you must issue SYS(something) I don't recall but you can search in VFP doc, wich allows ActiveX compatibility.

CRApplication=CreateObject(&quot;CrystalRuntime.Application&quot;)
CRReport=CReateObject(&quot;CrystalRuntime.Report&quot;)
CRReport=CRApplication.OpenReport(&quot;report.rpt&quot;)
With ThisForm
.EnableExportButton=.T.
.EnableNavigationControls=.T.
.ReportSource=CRReport
.ViewReport
EndWith

Hope this helps, Sure needed something like this when I was searching for info on VFP and Crystal reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top