Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Crystal, FoxPro, How do they work together?
Message
De
01/08/2000 02:17:40
Walter Meester
HoogkarspelPays-Bas
 
 
À
31/07/2000 21:32:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00398782
Message ID:
00399135
Vues:
28
Robert,

>Dank u wel voor uw hulp. Ik kan Foxpro en Crystal nu gegrijpen.

Graag gedaan ! Mag ik vragen waar je Nederlands geleerd hebt, of waar je deze zin vandaan hebt ?

You're welcome ! May I ask where did you learn Dutch or at least where did you learn this sentence ?

>Thanks! Your reply filled in the missing pieces for me. I am taking your suggestion and using RDC server automation approach . I ran into one problem -- "OLE Exception Error: object may be corrupt" on the form which was solved by one of your older threads -- SYS(2333,1).
>
>
>-- Rob
>
>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>Robert,
>
>>I have been browsing this newsgroup for 3 days now and I have some questions on how to mesh Crystal Reports with VFP.
>>Background: I wish to create a VFP form and from this form port the info to a CR. I currently use VFP's report writer but I am becoming very disgruntled with its performance. I will use tables generated on the fly and I will pass parameters. I am using CR 8.0 Developer, VFP 6.0 SP 3 on an NT network with SQL server 7.0 as data base repository.
>
>
>The best way, seems to be to use the RDC automation server approach. This is using an engine created by createobject('crystalruntime.application').
>
>If you want to be able to preview the report, you also need the Crystal reports Smartviewer.8 activeX control (be ware that this a different one than the Crystal reports activeX control)
>
>Before you can call the report you must have your query results ready in FOX2X format. (Or you want to query your SQL server in the report via parameters, but this is a different issue).
>
>Sample code:
>
>
>* Open the RDC engine
>oEngineObject = CREATEOBJECT("CrystalRuntime.application")
>
>* Open the report
>
>oReport=oEngineobject.openreport(cReportname)
>
>* be sure your Variable (parameter) names in crystal are the same as used in VFP
>* then you can use the following code to pass the paramters to CR
>
>WITH oReport.ParameterFields
> FOR nT= 1 TO .Count
> cName=.Item(nT).ParameterFieldName
> IF TYPE(cName) # "U"
> .item(nT).SetCurrentValue(EVAL(cName))
> ENDIF
> ENDFOR
>ENDWITH
>
>* Change the location of the data into location of your created FOX2X (temp) table.
>* This sample code assumes that the array aDBFFiels contains the locations of
>* the FOX2X tables used in your report in the following manner
>* aDBFFiles[nI, nI]
>* - The first column contains the location of the DBF file. If there are more
>* than one DBF files to be used within your report, you can add new rows for
>* each DBF file you need.
>* - The second column is used when you want to change table locations in
>* subreports. Therefore the second column contains the name of the subreport.
>*
>* Be sure that the files for the main report are at the beginning of the array,
>* and those of subreports grouped at the end.
>* The physical order in which the tables are added in Crystal Reports determines
>* the order in which they should appear in this array.
>
>IF TYPE("aDBFfiles(1)")="C"
> nI=1
> FOR nT = 1 TO ALEN(aDbffiles,1)
> IF ALEN(aDBFfiles,2)>1 AND !EMPTY(aDBFfiles[nT,2])
> oReport=THIS.Report.Opensubreport(aDBFfiles[nT,2])
> nI=1
> ENDIF
> IF !EMPTY(aDbffiles(nT,1))
> oReport.Database.Tables.item[nI].location = aDbffiles(nT,1)
> ENDIF
> nI=nI+1
> ENDFOR
>ENDIF
>
>* O.K. Now your reports is set up. You can print it with:
>
>oReport.Printout(lPromptUser)
>
>* When Previewing you must include the smartviewer activeX control.
>* Make it the same size as your previewing form.
>* Use the following code to preview the report in the activeX control
>
>THISFORM.CrViewer.ReportSource = oReport
>THISFORM.CrViewer.Viewreport()
>
>
>These are the basics to handle reports in the RDC manner within VFP. For further documentation read the Developer.hlp, somewhere in your crystal reports directory.
>
>
>
>>--Having already gone thru the samples on UT; is there an _difinitive_ example which will show how to open up the CR, and send the parameters to the report. I have seen alot of disjointed pieces and tried to make them work all with no success.
>
>See sample above.
>
>>--Also how can I use the Runtime version since according to Seagate I need only buy the CR Developer's and dole the static reports to my users? Is it really necessary to copy all of the DLLs and install them on everyone's machine?
>
>Yes, there is no way to work with CR without including runtime dlls. See runtime.hlp to determine which DLLs you need to distribute.
>
>>--If I need to an active X object which one do I use? I have seen a mention to a 'SmartViewer' control. But when I added a control I did not see a reference to a SmartViewer control.
>
>Yes, indeed you need the samrtviewer activeX control for previewing. When CR 8.0 is installed it is avaliable within VFP. Just press the OLE toolbutton in the form controls toolbar, place it on your form. (A dialog show up), choose insert control, and pick the Crystal Report Smartviewer 8 control.
>
>>--What is difference between when I -- createobject('crystalruntime.application'), createobject('crystal.crystalreport'), createobject('crystal.CRPE.application')?
>
>You instantiate two different automation servers: the RDC engine and the CRPE engine. the CRPE engine is beeing discontinued, the RDC is the new one. The are very simular, but the RDC one is even more flexible as the CRPE one. You can't mix the two approaches.
>
>Walter,
>Life is what you make it.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform