I publish some screenshots for those who don’t know FastReport.
This is the code I insert in my FWH source code.
- Code: Select all Expand view RUN
oFr := frReportManager():New()
oFr:LoadLangRes( "German.xml" )
oFr:SetIcon( 1 )
oFr:SetWorkArea("NStatistik", SELECT("NStatistik"))
oFr:SetTitle( "Nächtigungsstatistik" )
oFr:LoadFromFile( ".\REPS\Naechtigungen.FR3" )
oFr:AddVariable( "TITOL", "cTitol", "'FACTURA'" )
cFirma := Setup():cCompany+"test"
cTitle2 := "Basis: " + GetPvProfString( "STATISTIK","AnzahlBetten", "50", ".\INI\WINHOT2.INI" )
oFr:AddVariable( "FIRMA", "cCompany", "'" + Setup():cCompany +"'" )
oFr:AddVariable( "FIRMA", "cCompany" , "'" + setup():cCompany +"'" )
oFr:AddVariable( "FIRMA", "cAddr1" , "'" + setup():cAddr1 +"'" )
oFr:AddVariable( "FIRMA", "cAddr2" , "'" + setup():cAddr2 +"'" )
oFr:AddVariable( "FIRMA", "cAddr3" , "'" + setup():cAddr3 +"'" )
oFr:AddVariable( "FIRMA", "cTelefon" , "'" + setup():cTelefon +"'" )
oFr:AddVariable( "FIRMA", "cFax" , "'" + setup():cFax +"'" )
oFr:AddVariable( "FIRMA", "cEmail" , "'" + setup():cEmail +"'" )
oFr:AddVariable( "FIRMA", "cPayPalEmail" , "'" + setup():cPayPalEmail +"'" )
oFr:AddVariable( "FIRMA", "Basis", "'" + cTitle2 +"'" )
oFr:AddVariable("Zeitraum", "VonBis", "'" + dtoc( ::anfang ) + "-" + dtoc( ::ende ) + "'")
//oFr:AddVariable("My Lovely Vars", "test", 100.25)
//oFr:AddVariable("My Lovely Vars", "test1", "'Test'")
//oFr:AddVariable("My Lovely Vars", "test2", ctod("01/01/2007"))
oFr:PreviewOptions:SetAllowEdit(.F.)
[b] oFr:DesignReport()[/b] oFr:ShowReport()
//oFr:SetProperty("PDFExport", "OpenAfterExport", .t.)
// oFr:SetProperty(cExpObj, "FileName", cExpFile)
// oFr:DoExport("PDFExport")
//oFr:ClearDataSets()
// oFr:ShowReport()
oFr:DestroyFr()
If you insert the line:
oFr:DesignReport()
then the screen designer opens automatically.
This is a mighty tool.
Thanks Marco for introducing FastReport to me.
BTW there is a test version. The only limitation is that you can only print reports up to 5 pages.
Best regards,
Otto