Crystal XI Viewer & VFP

Hello Experts,

I'd like some sample code that uses the Crystal Viewer for VFP.  Additionally, I'd like to know which DLL's it uses.

Thanks!

jr
LVL 4
jruheAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Olaf DoschkeConnect With a Mentor Software DeveloperCommented:
I assume you talk about http://www.sap.com/solutions/sap-crystal-solutions/query-reporting-analysis/sapcrystalviewer/index.epx

If you look into the features and technical details you can use this free viewer only to view existing reports. You may filter, drill down reports, but not create new ones.

And of course also viewing a report requires the data sources a rpt report needs to be present on you PC as on the developers PC.

I assume IT dept is creating crystal reports rpt files and management wants only to view them, then they only need the viewer but if the source is a VFP database most certainly also the VFP ODBC and/or VFP OLEDB Provider plus System Data Sources (DSNs) define in the ODBC Manager.

So what you need for a rpt file to be viewable depends on what data access components it needs.

Bye, Olaf.
0
 
Olaf DoschkeSoftware DeveloperCommented:
From the descriptions of the Crystal Report Viewer you can only view/use Crystal Reports with it, not a database.

Bye, Olaf.
0
 
mlmccCommented:
What viewer are you referring to?

Do you have CR XI/
if so which edition?

mlmcc
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
mlmccCommented:
What viewer are you referring to?

Do you have CR XI/
if so which edition?

mlmcc
0
 
mark18081966Commented:
Here are some samples in vb with the correct controls:
http://www.crincode.com

Mark
0
 
mlmccCommented:
that viewer only works if the data is saved with the report.  it cannot update the information to reflect the surrent data unless you have one of the enterprise Crystal or BO tools.

mlmcc
0
 
jruheAuthor Commented:
Sorry guys.  I think there's something wrong with my email notifications.  I got the message that said the question was dormant, but no the ones that told me you had possible solutions.

mlmcc, I have the Developer's edition.  I was using Crystal 8 and now they're moving to XI.  basically, in the past, I would dump data to a temporary table (DBF), then I'd print off of it using the Viewer control.  I'd like to approximate the same thing.

I've attached the old code.  Hope I didn't miss anything.

jr
PARAMETERS V_CRFILE,V_TABLE,V_OUTFILE,V_OUTTYPE
PRIVATE V_CRFILE,V_OUTFILE,V_OUTTYPE,V_RTN
WAIT WINDOW [Generating Preview. . .] NOWAIT
IF ! ([\] $V_CRFILE)
	mDir =RTRIM(a_sycins.Idosdbf)
	V_CRFILE =mDir +V_CRFILE
ENDIF
IF TYPE([crApp]) ="O"
	RELEASE crApp, crReport
ENDIF
IF FILE(V_CRFile) AND FILE(V_Table)
	crApp=createobject("crystalruntime.application.8")
	crReport=createobject("crystalruntime.report.8")
	crReport=crApp.openreport(v_crfile)
	crReport.Database.Tables.Item(1).Location	=v_table

	crReport.ReadRecords

	DO FORM vw_cryst
	WITH vw_cryst
	.addobject('crviewer1','olecontrol','crviewer.crviewer')
	.temp_db_name=v_table
	.v_crfile=v_crfile
	.v_table=v_table
	WITH .crViewer1
	.height=vw_cryst.height -29* 
	.height	=vw_cryst.height
	.width=vw_cryst.width
	.EnableExportButton=.T.
	.visible	=.t.
	.reportsource=crReport
	.ViewReport
	=MESSAGEBOX("Processing completed.  You may view the report, or you may print from the preview window.")
	ENDWITH
	ENDWITH
ELSE
	V_Rtn	=.F.
	=MESSAGEBOX("Missing Crystal report or Fox2x table! ",48,"CrystFox")
ENDIF

Open in new window

0
 
mlmccCommented:
The same or similar code should work with CR XI.

This may help because I think you are using the OCX viewer from CR8
http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/d0266ff1-261f-2b10-0284-e45e1568431e

mlmcc
0
 
jruheAuthor Commented:
OK that article seems like it's going to help, but it's been a while since I've done this and I can't find where you "add a reference" (VB-speak) in VFP.  when I issue the command:
crApp=createobject("CRAXDRT.Application")

I get the following error:
Class Definition CRAXDRT.Application is not found

And I think I need to add a reference, but I don't know how to do that. . .

Thanks,
Joy
0
 
mlmccCommented:
I don't know VFP so I don't know either.

This may be useful.  You will need to scroll down a bit.  There is a link about 2/3 of the way down to code for vfp.

http://forums.sdn.sap.com/thread.jspa?threadID=892036

mlmcc
0
 
jruheAuthor Commented:
OK guys.  The document that you provided, mlmcc, looks like it would be very helpful, but it doesn't say exactly which com objects to register.  So I went to a VB progam for another client and found that I should register the Crystal Reports ActiveX Designer Run Time Library.  On the other client, it was 11.5.  I only have the 11.0 version for the client I'm working on now, the VFP client.

However, when I "registered" (added to the object browser) the CRAXDRT object, and then I use the following command (similar to the "Dim crApp As CRAXDRT.Application" command in VB), I get the attached error message.   Picture of error message
Any ideas?  (FYI, I'm going to the Caribbean on a job this week and won't be on-line much due to not having internet in the hotel, but I'll be checking through the week-end and I'll circle back next week)
0
 
jruheAuthor Commented:
I'm going to start another question just in case we have some VFP expert's out there, but I would like your feedback too please.  I feel like we're very close.
0
 
mlmccCommented:
It would seem to mean there needs to be a class definition file for CRAXDRT .  I don't think there is a VFP module you can use.

mlmcc
0
 
jruheAuthor Commented:
Right.  Please see http://www.experts-exchange.com/Database/Reporting_/Crystal_Reports/Q_26655759.html for the drill-down in that CRAXDRT file, and note that the following command works in VB:

Dim crApp As CRAXDRT.Application

Thanks again,
jr
0
 
mlmccCommented:
Crystal has dropped support for CR 11 R1.  You might try to download CR XI R2.

http://www.sap.com/usa/solutions/sapbusinessobjects/sme/freetrials/index.epx

mlmcc
0
 
jruheAuthor Commented:
FYI the client is going to add R2 this coming week while I'm away.  Hang tight--I'll be in touch the week of the 6th.  Thanks very much.
0
 
jruheAuthor Commented:
The client installed Crystal XI R2 Developer edition while I was gone.  She said she installed all of the options, but now the 11.5 objects aren't listed in the Object Browser, but the 11.0 objects are still listed there.  And, if you use one of those 11.0 libraries, it gives the error message that "the selected file is either invalid or not a type library."  Besides which, isn't R2 supposed to show 11.5?  Where is craxdrt.dll anyway?  It's not in the windows\crystal directory. . .

jr
0
 
mlmccConnect With a Mentor Commented:
CRAXDRT is normally in the (at least mine is)
C:\Program Files\Business Objects\Common\3.5\bin

mlmcc
0
 
jruheAuthor Commented:
thanks mlmcc.  Hate to drag this out, but I will need to check again on Thursday with the client.  Will let you know.  (FYI, today the client said she got the command crApp=createobject("CRAXDRT.Application" to work by manually browsing for the DLL.  Oddly, when I do that, it doesn't work; however, Olaf gave a good idea today, in another thread--I will check that out as well).

jr
0
 
jruheAuthor Commented:
Thanks for your hard work.

jr
0
 
jruheAuthor Commented:
Followup:  to those who may have this issue in the future, in VFP, go to Tools / Options, then the Controls tab.  Click the ActiveX option, choose the Controls checkbox, then check Crystal ActiveX Report Viewer Control 11.5 (although in my Object Browser it showed the incorrect version of the Viewer Control, here in the Options window all the versions are correct).  To keep this change whenever you invoke VFP in the future, click the Set As Default button before clicking OK.

The code above should work (minus the ".8" in the CREATEOBJECT commands).  If upgrading to XI from a previous version and you have reports with DBF data sources, first run one of those reports in XI in order to install the correct driver (p2ixbse.dll, I believe).  No need to save the report--XI will run an older report.  This will update the driver and all like reports should work.

Cheers
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.