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

VFP9-ACTIVEX-CR2008

Status
Not open for further replies.

jpowe60

Programmer
Mar 4, 2009
35
US
Not sure if this is the correct place for this but
i'm running vfp9/sp2. I have downloaded Crsystal Reports2008 evaluation copy. What I am trying to do is to use the activex control, olecontrol, using the crystalReports12.ActivexReportViewer.1 to view a crystal report. I use a form that passes the crystal report file name, c:\temp\client_agency_referral.rpt. When the control executes, i get the following.."OLE IDispatch exception code 0 from CrystalReports12.ActivexReportViewer.1: No file to view.." however, the report file is there...i run separately outside of vfp. After I cancled the error messagebox and clieck exit on the form,, it appears that I get a blank crystal reprot form in my form..Now I have executed this before using vfp8 and crystal reports 8.5 no problem...

can anyone tell me where /what i am doing wrong...
any suggestions greatly appreciated...thanks
 
I am using a vfp select-sql stmts to create cursor then copy that result to a table on my c:\temp...

then running the form to view the report in cr2008
 
yes...this is what i did...one separate steps i created cursor, copied the data to a table...went into cr2008 created the report...ran the report...
i can run the rport separately by going into cr2008..bring up the report name, press the f5 key and the data is displayed...
once i did those steps, i went a created my form, ran the form with the report name as a filter ...then i get the ide error when it does the view
 
What exactly do you mean when you say you "ran the form with the report name as a filter"?

You should setting the report viewer's ReportSource property to an object reference to the report object. In other words, something like this:

Code:
loCR = CREATEOBJECT("CrystalRuntime.Application")
loRep = ;
  loCR.OpenReport("c:\temp\client_agency_referral.rpt")
THISFORM.oMyReportViewer.ReportSource = loRep
THISFORM.oMyReportViewer.ViewReport

where oMyReportViewer is your ActiveX control.

I've never ran the above code in CR2008, but it runs in earlier versions.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
sorry for the delay...those statements do work for CR versions 11,10,9, etc...however for cr2008 tjose stmt do not exist as per SAP/business Objects...they state that to do what i want that i have to migrate to .net ...


again thanks for the info
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top