Solved

Crystal XI Viewer & VFP

Posted on 2010-11-21
21
1,257 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:jruhe
  • 10
  • 8
  • 2
  • +1
21 Comments
 
LVL 29

Expert Comment

by:Olaf Doschke
Comment Utility
From the descriptions of the Crystal Report Viewer you can only view/use Crystal Reports with it, not a database.

Bye, Olaf.
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
What viewer are you referring to?

Do you have CR XI/
if so which edition?

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
What viewer are you referring to?

Do you have CR XI/
if so which edition?

mlmcc
0
 

Expert Comment

by:mark18081966
Comment Utility
Here are some samples in vb with the correct controls:
http://www.crincode.com

Mark
0
 
LVL 29

Accepted Solution

by:
Olaf Doschke earned 250 total points
Comment Utility
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
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
 
LVL 4

Author Comment

by:jruhe
Comment Utility
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
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
 
LVL 4

Author Comment

by:jruhe
Comment Utility
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
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 4

Author Comment

by:jruhe
Comment Utility
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
 
LVL 4

Author Comment

by:jruhe
Comment Utility
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
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
 
LVL 4

Author Comment

by:jruhe
Comment Utility
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
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
 
LVL 4

Author Comment

by:jruhe
Comment Utility
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
 
LVL 4

Author Comment

by:jruhe
Comment Utility
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
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 250 total points
Comment Utility
CRAXDRT is normally in the (at least mine is)
C:\Program Files\Business Objects\Common\3.5\bin

mlmcc
0
 
LVL 4

Author Comment

by:jruhe
Comment Utility
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
 
LVL 4

Author Closing Comment

by:jruhe
Comment Utility
Thanks for your hard work.

jr
0
 
LVL 4

Author Comment

by:jruhe
Comment Utility
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

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now