I have the demo. But the demo-fwh.rc file is missing. Do you know where I can get the file?
Thanks in advance
Otto
#include "FiveWin.ch"
#include "Splitter.ch"
#include "TCBrowse.ch"
#include "FastRepH.CH"
//----------------------------------------------------------------------------//
function Main()
local oFr
local adaten := {}
local CTITLE := "Silvios Test"
local cCompany := "TestCompany 2009"
local cAddr1 := "Addr1 "
local cAddr2 := "Addr2 "
local cAddr3 := "Addr3 "
local cTelefon := "Telefon"
local cFax := "Fax "
local NCOL := 0
local X := 0
oFr := frReportManager():New()
oFr:SetIcon( 1 )
aadd(adaten,{ 684, "termosifone", 1, "N.", 65.00, 0 })
aadd(adaten,{ 685, "pasta abrasiva", 1, "N.", 99.00, 0 })
aadd(adaten,{ 7875, "Tubo", 1, "N.", 65.50, 0 })
oFr:SetUserDataSet("aDaten", "Codice;Descrizione;Qta;UM;Prezzo;Sconto", ;
{|| x := 1}, ; //--> bGoTop
{|| x := x + 1}, ; //--> bSkipPlus
{|| x := x - 1}, ; //--> bSkipMinus
{|| x > Len(aDaten)} , ; //--> bCheckEOF
{|cField|nCol := IIF( cField == "Codice", 1,;
IIF( cField == "Descrizione", 2,;
IIF( cField == "Qta", 3,;
IIF( cField == "UM", 4,;
IIF( cField == "Prezzo", 5,;
IIF( cField == "Sconto",11, 12 ))))) ), aDaten[x, nCol] } )
oFr:LoadFromFile( ".\REPS\invoice.FR3" )
oFr:SetTitle( "'" + cTITLE +"'" )
oFr:AddVariable( "TITOL", "cTitol", "'FACTURA'" )
oFr:AddVariable( "FIRMA", "cCompany" , "'" + cCompany +"'" )
oFr:AddVariable( "FIRMA", "cAddr1" , "'" + cAddr1 +"'" )
oFr:AddVariable( "FIRMA", "cAddr2" , "'" + cAddr2 +"'" )
oFr:AddVariable( "FIRMA", "cAddr3" , "'" + cAddr3 +"'" )
oFr:AddVariable( "FIRMA", "cTelefon" , "'" + cTelefon +"'" )
oFr:AddVariable( "FIRMA", "cFax" , "'" + cFax +"'" )
oFr:AddVariable("TOTAL", "Aliquota", 20)
oFr:AddVariable("TOTAL", "Imposta", 45,90)
oFr:AddVariable("TOTAL", "Imponibile", 229.50)
oFr:AddVariable("TOTAL", "Totale", 275,40)
oFr:AddVariable("TOTAL", "Scadenza", 30 )
oFr:PreviewOptions:SetAllowEdit(.F.)
oFr:DesignReport()
oFr:ShowReport()
oFr:DestroyFr()
msginfo("Ende")
return nil
Otto wrote:Hello Rendal,
Good to hear that FR is working on your side.
Have you had to change beside
that you command out:
lang_en.ch or sayref.ch anything else?
You are right: the designer is no end user tool.
But for you as programmer you have all possibilities and the reports look professional.
It would be good to have the designer from EasyReport for the end users and
FastReport for the power users. Maybe there is a lightweight available.
I thought it should be possible too to manipulate the FR- files which are xml files.
FastReport is capable to export to many formats also to EXCEL. So the end users could
make the changes they want in EXCEL.
Best regards,
Otto
I noticed in a later message you posted a sample and suggested passing all the information as variables and arrays.
if GETKEYSTATE(VK_CONTROL)
app():oFr:DesignReport()
elseif GETKEYSTATE(VK_SHIFT)
app():oFr:SetProperty("PDFExport", "Author" , "Alvaro" )
app():oFr:SetProperty("PDFExport", "FileName", "c:\borrar\prueba.pdf")
app():oFr:SetProperty("PDFExport", "ShowDialog", .f.)
app():oFr:SetProperty("PDFExport", "OverwritePrompt" , .T.)
app():oFr:PrepareReport()
app():oFr:DoExport("PDFExport")
else
app():oFr:ShowReport()
endif
/* -------------- email
app():oFr:SetProperty("MailExport", "FileName" , "invoice_"+strzero(fac->num,5))
app():oFr:SetProperty("MailExport", "Address" , sc(cli->email,.f.) )
app():oFr:SetProperty("MailExport", "Subject" , "Factura "+strzero(fac->num,5) )
app():oFr:SetProperty("MailExport", "LogFile" , "FastReport\mail_log.txt" )
app():oFr:SetProperty("MailExport.Lines", "Text","Te adjuntamos fichero pdf con factura"+CRLF+CRLF+ ;
"Un saludo,"+CRLF+CRLF+"Alvaro",.t.)
app():oFr:SetProperty("MailExport", "ShowExportDialog" , .T. )
app():oFr:DoExport("MailExport")
*/ --------------------------
if GETKEYSTATE(VK_CONTROL)
app():oFr:DesignReport()
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 51 guests