Dear All,
I would like to call Crystal Report Runtime inside FWH+MySql. Can anyone guide me and give a sample to call Crystal Report Runtime?
Thank you in advance.
oCRApp := CreateObject("CrystalRuntime.Application.11")
oCRReport := oCRApp:OpenReport(cRpt)
oCRDatabase := oCRReport:Database
oCRTables := oCRDatabase:Tables
oCRTable:= oCRDatabase:Tables(1)
oCRTable:ConnectionProperties:DeleteAll()
oCRDatabase:LogOnServer ('crdb_Ads', "BASE DE DATOS ADD",, cUsuario, cPassword )
For i:= 1 to oCRTables:Count()
oCRTable:= oCRDatabase:Tables(i)
oCRTable:SetLogOnInfo( "BASE DE DATOS ADD", , cUsuario, cPassword )
next
oCRReport:EnableParameterPrompting("False")
oCRReport:DiscardSavedData()
//Ejemplo de Parametros si hacen falta
oCRParameterField := oCRReport:ParameterFields
if oCRParameterField:Count() > 0
oCRParameterField:GetItemByName('pFchIni'):AddCurrentValue( dFchIni )
...
endif
//Visor ActiveX
DEFINE Window oVentHija MDICHILD Title cTitle
oActiveX := TActiveX():New( oVentHija, "CrystalReports11.ActivexReportViewer.1" )
oVentHija:oClient := oActiveX
oVentHija:cTitle( cTitle )
oActivex:SetProp( "ReportSource", oCRReport )
oActiveX:SetProp( "EnableStopButton", 1 )
oActiveX:SetProp( "EnableAnimationCtrl", 0 )
oActiveX:SetProp( "EnableCloseButton", 1 )
oActiveX:SetProp( "EnableExportButton", 1 )
oActiveX:SetProp( "EnablePopupMenu", 0 )
oActiveX:SetProp( "EnableRefreshButton", 0 )
oActiveX:bOnEvent = { | event, aParams | EventInfo( event, aParams, oCRReport, oActivex ) }
ACTIVATE WINDOW oVentHija;
ON INIT ( oActiveX:Do( "Viewreport" ) );
Valid ( oCRDatabase:LogOffServer ('crdb_Ads', "BASE DE DATOS ADD",, cUsuario, cPassWord ), oCRDatabase := NIL, oActiveX := NIL, oCRReport := NIL )
function EventInfo( event, aParams, oCRReport, oActivex )
local cMsg := cValToChar( event ) //+ CRLF
return cMsg
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Timm Sodtalbers and 63 guests