Page 1 of 1

Crystal Reports

Posted: Thu Nov 30, 2006 7:17 pm
by biro2000
Hola,

Estoy utilizando Fivewin 2.7 + xHarbour + Crystal Reports 9.2 + WinXP.

Em mi computador, donde instale CRYSTAL REPORTS mi TESTE.EXE funciona bién, pero en otro computador el no ejecuta. Ocurre lo error

"Could not output to Window!"

cuándo ejecuta la linea abajo:

oCrystal:PEOutputToWindow(oVentHija)


Eso es mi PRG ejemplo:

#INCLUDE "fivewin.CH"

FUNCTION Main()
PUBLIC oWnd, oCrystal
oCrystal := TCCRPE():NEW()
DEFINE WINDOW oWnd MENU CreaMenu() MDI
ACTIVATE WINDOW oWnd VALID (oCrystal:PECloseEngine(),.T.)
RETURN (.T.)

FUNCTION CreaMenu()
LOCAL oMenu
MENU oMenu
MenuItem "Prueba" Action RunReport()
ENDMENU
RETURN (oMenu)

************************************
FUNCTION RunReport()
************************************

LOCAL oVentHija, hReport

cReportName := cGetFile("*.rpt","Choose Report")

DEFINE WINDOW oVentHija MDICHILD OF oWnd

oCrystal:PEOpenPrintJob(cReportName)

oCrystal:PEOutputToWindow(oVentHija)

oCrystal:PESetTabLocation("c:\rpartic.dbf")

ACTIVATE WINDOW oVentHija ON INIT (oCrystal:PeStartPrintJob(), hReport := oCrystal:PEGetWindowHandle(),WndSetSize(hReport,oVentHija:nWidth-7,oVentHija:nHeight-8,.T.));
ON PAINT (WndSetSize(hReport,oVentHija:nWidth-7,oVentHija:nHeight-8,.T.));
VALID (oCrystal:PEClosePrintJob(),.T.)

RETURN (.T.)

Yo copie las DLLs para C:\WINDOWS\SYSTEM32.

Hay algo más que yo pueda hacer?

Gracias adelantado,

Luciano

Re: Crystal Reports

Posted: Tue Mar 10, 2009 5:25 pm
by Ollie
Hi,

I am trying to use Crystal Reports XI. I don't have a clue where to start, so I used your code above.

Unresolved external _HB_FUN_TCCRPE

Please tell mw what I'm missing.

Thanks.

Re: Crystal Reports

Posted: Tue Mar 10, 2009 6:14 pm
by Biel EA6DD
Tccrpe is a class to mange Crystal Reports, but if you are going to use Crystal XI best try using ActiveX, you will find some samples on this forums. Search for "CrystalRunTime.Application".

Here you are a sample how to use CR XI

Code: Select all

   ...
   oCrys:=tOleAuto():New("CrystalRunTime.Application")  
   oRpt:=oCrys:OpenReport(oAppl:cDirRpt+"file.rpt") //Report File
   oRpt:Database:Tables(1):Location:=oAppl:cDirRpt+'file.dbf'  //DBF File
   IF oRPt:HasSavedData          
      oRPT:DiscardSavedData()   
   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.)

 

Re: Crystal Reports

Posted: Thu Jun 24, 2010 2:25 am
by fraxzi
Biel EA6DD wrote:Tccrpe is a class to mange Crystal Reports, but if you are going to use Crystal XI best try using ActiveX, you will find some samples on this forums. Search for "CrystalRunTime.Application".

Here you are a sample how to use CR XI

Code: Select all

   ...
   oCrys:=tOleAuto():New("CrystalRunTime.Application")  
   oRpt:=oCrys:OpenReport(oAppl:cDirRpt+"file.rpt") //Report File
   oRpt:Database:Tables(1):Location:=oAppl:cDirRpt+'file.dbf'  //DBF File
   IF oRPt:HasSavedData          
      oRPT:DiscardSavedData()   
   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.)

 
Dear Biel,

I have CRW8.5 I'd like to try and use similar to your code above using ActiveX..
I'm using wrapper for CRPE32.DLL right now. There's a lot of limitations.
I think ActiveX could be my solution.

what Crystal Reports files need?

how to run this on client PC without Crystal Reports installed?


Regards,
Frances

Re: Crystal Reports

Posted: Thu Jun 24, 2010 5:21 am
by fraxzi
Dear All,

for your info:

In order this oCrystal := CreateObject("CrystalRuntime.Application") NOT TO FAIL on your client pc
you must register regsvr32 <path>\craxdrt.dll that must be included in your app.exe path.


In order this oCRViewer := TActiveX():New( oWnd, "CRViewer.CRViewer" ) NOT TO FAIL on your client pc
you must register regsvr32 <path>\crviewer.dll that must be included in your app.exe path.

Here are some of the activex properties you can make use of... like this oCRViewer:SetProp( "EnableExportButton", 1 )
DisplayBackgroundEdge
DisplayBorder
DisplayGroupTree
DisplayTabs
DisplayToolbar
EnableAnimationCtrl
EnableCloseButton
EnableDrillDown
EnableGroupTree
EnableNavigationControls
EnablePrintButton
EnableProgressControl
EnableRefreshButton
EnableSearchControl
EnableStopButton
EnableToolbar
EnableZoomControl
for more info http://forums.fivetechsupport.com/viewt ... pplication

Regards,
Frances