Crystal Reports

Crystal Reports

Postby biro2000 » Thu Nov 30, 2006 7: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
biro2000
 
Posts: 4
Joined: Mon Nov 20, 2006 1:07 pm
Location: Indaiatuba-SP - Brazil

Re: Crystal Reports

Postby Ollie » Tue Mar 10, 2009 5: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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Re: Crystal Reports

Postby Biel EA6DD » Tue Mar 10, 2009 6: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: Select all  Expand view

   ...
   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
Biel EA6DD
 
Posts: 682
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca

Re: Crystal Reports

Postby fraxzi » Thu Jun 24, 2010 2: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: Select all  Expand view

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

Re: Crystal Reports

Postby fraxzi » Thu Jun 24, 2010 5: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: driessen, Google [Bot] and 37 guests