Crystal Reports

Post Reply
biro2000
Posts: 4
Joined: Mon Nov 20, 2006 1:07 pm
Location: Indaiatuba-SP - Brazil
Contact:

Crystal Reports

Post 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
Luciano Iuri Pereira
Birô 2000 Serviços Integrados S/A
E-mail: lucianoiuri@biro2000.com.br
Ollie
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Re: Crystal Reports

Post 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.
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
User avatar
Biel EA6DD
Posts: 680
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca
Contact:

Re: Crystal Reports

Post 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.)

 
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Re: Crystal Reports

Post 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
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Re: Crystal Reports

Post 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
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
Post Reply