Page 1 of 2

Crystal XI y xharbour

Posted: Thu Apr 12, 2007 11:44 pm
by Venezolano1963
Saludos Amigos, aca traigo un problema para evr en que se me puede ayudar, me quede en el fwh24 y el xharbour ya ni me acuerdo la version pero es un poco vieja, uso crystal Report 7.0 pero necesito exportar mis reportes a PDF cosa el que 7.0 no hace tengo la Version XI que si exporta pero quisiera saber si alguien usa estar version y es compatible con la que uso con el 7.0 o si tiene una rutina para esta version y si es posible hacermela llegar a mi Correo, agradeciendo de antemano la Atencion de esta Solicitud Queda de Ustedes Antonio P.
Mail: venezolano1963@yahoo.com

Posted: Fri Apr 13, 2007 11:50 pm
by derpipu
Amigo: checate en el super google por el PDFCreator
http://www.google.com.mx/search?hl=es&q ... ator&meta=

saludos

Luis Fernando Rubio Rubio

Posted: Sat Apr 14, 2007 2:08 am
by R.F.
Con Crystal XI puedes utilizar la interfaz ActiveX desde FiveWin, funciona perfectamente.

Posted: Wed Apr 18, 2007 3:00 pm
by Pedro Faro
Hi Rene

Can you post a sample to use a RPT with a Fwh apps+ ADS+ CRsytal 11.

with activex

Best regards

Pedro

Posted: Wed Apr 18, 2007 4:32 pm
by Biel EA6DD
Previsualizacion en pantalla

Code: Select all

 
   oCrys:=tOleAuto():New("CrystalRunTime.Application")
   oRpt:=oCrys:OpenReport(oAppl:cDirRpt+"QSL.rpt")
   oRpt:Database:Tables(1):Location:=oAppl:cDirRpt+'Log.dbf'
   IF oRPt:HasSavedData          //si tenia datos guardados con el reporte, lo borra.
      oRPT:DiscardSavedData()    //obligando asi la lectura desde el fichero dbf.
   ENDIF
   oCrRpt:=tActiveX():New(oWnd,"CrystalReports11.ActiveXReportViewer.1")
   oCrRpt:SetProp("ReportSource",oRpt)
   oCrRpt:SetProp("DisplayGroupTree",.F.)

   oCrRpt:DO("ViewReport")
   oWnd:oClient:=oCrRpt

   ACTIVATE WINDOW oWnd VALID (oCrRpt:END(),oCrys:END(),oRpt:END(),.T.)
Impresion sin pre,

Code: Select all

   oCrys:=tOleAuto():New("CrystalRunTime.Application")
   oRpt:=oCrys:OpenReport(oAppl:cDirRpt+"QSL.rpt")
   oRpt:Database:Tables(1):Location:=oAppl:cDirRpt+'Log.dbf'
   IF oRPt:HasSavedData          //si tenia datos guardados con el reporte, lo borra.
      oRPT:DiscardSavedData()    //obligando asi la lectura desde el fichero dbf.
   ENDIF
   oRpt:PrintOut(.f.)
   oRpt:END()
   oCrys:END()

Posted: Wed Apr 18, 2007 4:36 pm
by Biel EA6DD
Por cierto Rene, como te las arreglas para distribuir Crystal con tus aplicaciones.
A mi solo me ha ido bien con InstallShield, pero el tamaño de la instalacion es muy grande, y aunque dice que puedes marcar que modulos incluir, a mi no me hace ni caso y siempre me pone todos los modulos en la instalacion.

Crystal XI e xHarbour

Posted: Thu Apr 19, 2007 10:15 am
by mario.paiva
Hi everybody,

Biel,

I tested with your code sample but when execute the app this error occurs:

"TOleAuto/-1 CO_E_CLASSSTRING: TOLEAUTO:NEW Args: [ 1] = C CrystalRunTime.Application"

I have Crystal Reports XI Professional with all components installed on my machine.

Thanks for the help,

Mário Paiva

Posted: Thu Apr 19, 2007 10:48 am
by Biel EA6DD
Hi Mario,
here I'm using CR Developer, Full. Ver. 11.0.0.1282

The way to create objecs is how is decribed in the Crystal Reports Technical Reference Guide, page 24.

"Application Object -> CrystalRunTime.Applicaction"

Maybe is a differenece between CR Professional Edition and CR Developer Edition.

Crystal with xHarbour

Posted: Thu Apr 19, 2007 5:18 pm
by mario.paiva
Hi Biel,

I downloaded and installed the Crystal XI Release 2 for developers just like you said and recompile the code with this modifications:

#include "Fivewin.ch"

FUNCTION MAIN()

LOCAL oCrystal := CREATEOBJECT( "CrystalRuntime.Application" )
LOCAL oReport := oCrystal:OpenReport( "val_mov.rpt" )

LOCAL oWnd, oCRViewer

DEFINE WINDOW oWnd

oCRViewer = TActiveX():New( oWnd, "CrystalReports11.ActiveXReportViewer.1" )

oCRViewer:SetProp( "ReportSource", oReport )
oCRViewer:Do( "ViewReport" )

oWnd:oClient = oCRViewer

ACTIVATE WINDOW oWnd;
MAXIMIZED

RETURN NIL

And this is the error that popup from the app:

"FiveWin for Harbour GPF occurred

Called from CREATACTIVEX(0)
Called from TACTIVEX:NEW(0)
Called from MAIN(13)"

Is something missing in my code ?

Thanks again for the help,

Mário Paiva

Posted: Thu Apr 19, 2007 8:59 pm
by R.F.
Biel EA6DD wrote:Por cierto Rene, como te las arreglas para distribuir Crystal con tus aplicaciones.
A mi solo me ha ido bien con InstallShield, pero el tamaño de la instalacion es muy grande, y aunque dice que puedes marcar que modulos incluir, a mi no me hace ni caso y siempre me pone todos los modulos en la instalacion.
Yo instalo los modulos que vienen en la ayuda que tienen que instalarse, como 7 u 8 DLLs adicionales y como bien mencionas, efectivamente, la instalacion crece bastante, pero no hay de otra, Crystal requiere de muchos recursos.

Posted: Fri Apr 20, 2007 7:28 am
by Biel EA6DD
Gracias Rene por la respuesta, pues si no hay otra, nos tendremos que aguantar, un saludo.

Hi Mario,
now the error is at the creation of ActiveX. Look in your system the exact string maybe is diferent, in my system "CrystalReports11.ActiveXReportViewer.1" is ok and runnig fine.If I'm not wrong .1 is the version, so probably you must use .2 .
Any way you can use ActiveXXX to know all features of activex in your system.
http://activex.moonvalley.com/activexxx.htm

Crystal XI y xharbour

Posted: Mon Apr 23, 2007 9:22 am
by mario.paiva
Hi Biel,

Thanks again for helpful you explanations.

I run the app Activexxx and the information retrieved is CrystalReports115.ActiveXReportViewer.1. I pasted this in my code and it works !! Finaly i have the preview of Crystal Reports showing the information from the rpt previously created.

But something is missing ... :( The information within the rpt has not the information updated with the data dictionary created with Advantage Data Architect.

When i create or modify a register on the database and open the rpt via my app, i don't get the information updated. Aperantly when the app call´s the rpt, the connection to Advantage Database server is not established. Do i need to put something else in my code to referesh the data in the rpt ?

This is my environment:

Server:

1 - Advantage Database Server 8.1 Installed on a remote server
2 - Advantage Crystal Reports Driver 8.1
3 - The test app that is going to executed remotely on client machines
4 - The test rpt (made with Crystal pointed to an Advantage connection via Data dictionary )and the dll´s necessary to run the app remotely
5 - The data dictionary created with Advantage Data Architect

Client Machine:

1 - All necessary components to run the Crystal Reports Preview (It´s working fine)
2 - A shortcut to the test app to be executed on the Server.
3 - All communication dll´s necessary to run the app

Everything works fine but as i already said the information on the rpt is not updated with the data dictionary.

This is my code:

#include "Fivewin.ch"

FUNCTION MAIN()

LOCAL oCrystal := CREATEOBJECT( "CrystalRuntime.Application" )
LOCAL oReport := oCrystal:OpenReport( "mestre_artigos.rpt" )

LOCAL oWnd, oCRViewer

DEFINE WINDOW oWnd

oCRViewer = TActiveX():New( oWnd, "CrystalReports115.ActiveXReportViewer.1" )

oCRViewer:SetProp( "ReportSource", oReport )
oCRViewer:Do( "ViewReport" )

oWnd:oClient = oCRViewer

ACTIVATE WINDOW oWnd;
MAXIMIZED

RETURN NIL

Again Many thanks for your help.

Best regards,

Mário paiva

Crystal XI y xharbour

Posted: Mon Apr 23, 2007 1:48 pm
by mario.paiva
Hi again Biel,

Thanks to your examples (i missed the example code to Pedro Faro) sorry :), i can finally put almost all things working fine includind the connection to ADS established and the rpt´s updated to the Crystal Reports preview !

Just one more thing to put the solution operational:

We need to now what are the components (Dll´s and what so ever) to distribute with our apps and put the client machines running the Crystal Report Preview XI without installing the entire setup of CRXI.

Thanks for the help and best regards,

Mário Paiva

Posted: Mon Apr 23, 2007 4:21 pm
by Biel EA6DD
Hi
about teh componets to distribute, I have tried some ways,(copyng Dlls, ...) with no success. The only way running for the moment is using installshield, inluding de msm files provided with Crystal Reports.

crystal CrystalReports11_RDC_License.msm
CrystalReports11_RDC_Reportengine.msm
CrystalReports11_RDC_Runtime.msm

Yo can try wiht other installer, but you need msm support. Let me know if you find any easy way to distribute.

Crystal XI y xharbour

Posted: Fri Apr 27, 2007 4:05 pm
by mario.paiva
Hi Biel,

Things are working fine with that 3 files included in the installation package. Apparently this is the only way putting the client machines running crystal. I have Read some white papers from Business Objects and they say this is the only way (supported) to do it :( .

Just one more thing, when I open a report a connection is established with ADS and works fine, but when I close the report, that connection is kept alive in ADS for about 3 minutes. Is there a way to immediately close the connection and the data base inside my code?

I search in Crystal Help and they have this information:

"Working with secure data in reports:

If your report connects to a secure data source that requires log on information, you must release the Report object from the Report Viewer before you can log off of the data source. This can be done by assigning a new Report object to the ReportSource property, or by closing the CRViewer object. Until this is done, the data source will not be released from the Report object and you cannot log off."

Thanks a lot again,

Best regards,

Mário Paiva