FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Crystal Reports
Posts: 4
Joined: Mon Nov 20, 2006 01:07 PM
Crystal Reports
Posted: Thu Nov 30, 2006 07:17 PM
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
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Re: Crystal Reports
Posted: Tue Mar 10, 2009 05:25 PM

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)
Posts: 682
Joined: Tue Feb 14, 2006 09:48 AM
Re: Crystal Reports
Posted: Tue Mar 10, 2009 06:14 PM
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 (fw): Select all Collapse
   ...
   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/
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: Crystal Reports
Posted: Thu Jun 24, 2010 02:25 AM
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 (fw): Select all Collapse
   ...
   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
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: Crystal Reports
Posted: Thu Jun 24, 2010 05:21 AM
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/viewtopic.php?f=6&t=4077&hilit=CrystalRunTime.Application

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

Continue the discussion