Hi,
Anyone can point me to a tutorial of using crystal report with xbase??
I've searched in google and found FRAX, but quite worried that the product might not be supported anymore.
Regards,
Andy
			
			
									
									
						Crystal Report
Re: Crystal Report
I have client that has and is using crystal reports to create their own special reports.  it works .
			
			
									
									
						Re: Crystal Report
You need Crystal Reports Runtime files 11.5 version, this is the last version that supports ActiveX.
This link is a Dropbox, have the Runtime installer and some books.
https://www.dropbox.com/sh/avbnoznroebw ... QLrRa?dl=0
Sample code :
Attach prg + dbf + crystal reports file ( for this you need the editor to modify )
I hope this help
			
							This link is a Dropbox, have the Runtime installer and some books.
https://www.dropbox.com/sh/avbnoznroebw ... QLrRa?dl=0
Sample code :
Code: Select all
#include "Gra.ch"
#include "Xbp.ch"
#include "Common.ch"
#include "Appevent.ch"
#include "Font.ch"
#include "activex.ch"
#define crOpenReportByDefault    0
#define crOpenReportByTempCopy   1
PROCEDURE Main()
**   PrintCrReports("Test.rpt","Visualizador de Reportes ")
   PrintCrReports("Pruebaxml.rpt","XML")
RETURN
PROCEDURE PrintCrReports( cReport, cTitulo )
   LOCAL oDlg, oCrystal, oReport, oSec, oVor
   LOCAL oPara, oItemOne, oItemTwo, oItemThree, oTables
   LOCAL cPath := CurDrive() + ":\" + CurDir()
   LOCAL oDatabase
   LOCAL oSecItem
   IF !file( cReport )
      RETURN
   ENDIF
   oVor := NIL
   oDlg := xbpDialog():new(AppDesktop(),,{100,100},{800,600},,FALSE)
   oDlg:title                      := "CR-"+cTitulo
   oDlg:taskList                   := TRUE
   oDlg:clipChildren               := TRUE
   oDlg:drawingarea:clipChildren   := TRUE
   oDlg:drawingarea:resize         := {|aO,aN| oVor:setSize(aN) }
   oDlg:close := {|| BREAK( ) }
   oDlg:create( )
   //-------------------------------- C r y s t a l - A p p l i c a t i o n ----------------------
   // ALASKA: original was 8.5. This is removed, we get default version
   oCrystal := ActiveXObject():create( "CrystalRuntime.Application.11" )
   //-------------------------------- R e p o r t  -----------------------------------
   oReport := oCrystal:openReport(cReport,crOpenReportByTempCopy)
   //-------------------------------- D a t a b a s e ---------------------------------
   oDatabase := oReport:database
   oTables   := oDatabase:tables
   //? oTables:count
   //? oTables:item(1):location
   // ALASKA: work with absolute path!
   //oTables:item(1):location := "mmpatntx.dbf"
   oTables:item(1):location := "c:\SPOOLER\PRUEBA\producto.xml"
   //? oTables:item(1):location
   //---------------------------- S e l e c t  P r i n t e r ----------------------------
   //oReport:PrinterSetup(0)
   //-------------------------------- V i e w e r  -----------------------------------
   oVor := XbpActiveXControl():new( oDlg:drawingArea,, {0,0}, oDlg:drawingArea:currentSize() )
   oVor:clsid   := "CrystalReports115.ActiveXReportViewer.1"
   //oVor:clsid := "CRViewer.CRViewer"
   //oVor:clsid := "CRViewer.CRViewer.8.0"               && Alternativa
   //oVor:clsid := "CrystalReports.ActiveXReportViewer"  && Alternativa
   oVor:create()
   oVor:reportSource := oReport
   // Activar Botones
   oVor:EnableZoomControl         := TRUE
   oVor:EnableExportButton        := TRUE
   oVor:EnableStopButton          := TRUE
   oVor:EnableProgressControl     := TRUE
   oVor:EnableSearchExpertButton  := TRUE
   oVor:EnableDrillDown           := TRUE
   oVor:EnableCloseButton         := TRUE
   oVor:EnableProgressControl     := TRUE
   oVor:EnableSelectExpertButton  := TRUE
   oVor:viewReport()
   oDlg:show()
   BEGIN SEQUENCE
      AppEventLoop()
   END SEQUENCE
   oVor:destroy()
   oReport:destroy()
   oCrystal:destroy()
   oDlg:destroy()
RETURN
PROCEDURE AppEventLoop( )
   LOCAL nEvent := xbeP_None, mp1, mp2, oXbp
   oXbp := mp1 := mp2 := NIL
   DO WHILE nEvent <> xbeP_Close
      nEvent := AppEvent( @mp1, @mp2, @oXbp )
      oXbp:handleEvent( nEvent, mp1, mp2 )
   ENDDO
RETURN
PROC appsys()
RETURN
I hope this help
- Attachments
- 
			
		
		
				- crystal test.zip
- (4.1 KiB) Downloaded 1141 times
 
Re: Crystal Report
Nice!!
I didn't know that Crystal Reports had an ActiveX control.
Thanks for that contribution.
			
			
									
									I didn't know that Crystal Reports had an ActiveX control.
Thanks for that contribution.
 The eXpress train is coming - and it has more cars.
						- 
				Andy Edward
- Posts: 103
- Joined: Fri Sep 17, 2010 2:58 am
Re: Crystal Report
So does this mean subsequent versions of CR will not have ActiveX support?pedroah wrote:this is the last version that supports ActiveX.
Best Regards,
Andy
Re: Crystal Report
that's right
			
			
									
									
						
