Hier mal der Code wie wir Frax in unserer Anwendung aufrufen.
Das Beispiel legt in Frax 4 Variablen an, die im Report Designer
Reiter Variablen verfügbar sind und einfach im Formular benutzt werden können.
Code: Alles auswählen
function FRAXREP( lShowDesigner)
Local FrPrn, i, cAlias
default lShowDesigner to .f.
FrPrn := frReportManager():new("FRSyst.dll")
FrPrn:SetIcon( ICON_APP )
FrPrn:SetTitle("HKABR - Report")
// Hier alle Dateien bei Frax bekannt machen
FOR i := 1 TO 255
cAlias := Alias(i)
IF !Empty(cAlias)
FrPrn:SetWorkArea(cAlias, Select(cAlias), .t.)
ENDIF
NEXT
// Stringvariable mit Inhalt aus einer Xbase Variablen
FrPrn:AddVariable("HKABR Variablen", "cCompany", "'&cCompany'")
// Stringvariable mit Inhalt direkt
FrPrn:AddVariable("HKABR Variablen", "Version", "'0.99'")
// Num Variable mit Inhalt direkt
FrPrn:AddVariable("HKABR Variablen", "Number of Clients", 5)
// Num Variable mit Inhalt aus Xbase Variable
FrPrn:AddVariable("HKABR Variablen", "Anzahl Drucker ", drucknr)
if lShowDesigner // Designer aufrufen
FrPrn:DesignReport()
else // Preview-Modus
FrPrn:PrepareReport()
FrPrn:ShowReport()
endif
FrPrn:DestroyFR()
return NIL