Page 1 of 2

FastReport

PostPosted: Wed Sep 30, 2009 6:27 pm
by Otto
Today I finished my first report with FASTREPORT.
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


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


Image

Image

Re: FastReport

PostPosted: Wed Sep 30, 2009 6:32 pm
by Otto
This screen shot shows the variables you send from your FW program to FastReport.
You can drag & drop them from here to your report page.
Best regards,
Otto

Code: Select all  Expand view

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  )  + "'")

 



Image

Re: FastReport

PostPosted: Wed Sep 30, 2009 6:37 pm
by Otto
This screen shot shows the dbf file you address from your FW program.
You can drag & drop the fields from here to your report page.
Best regards,
Otto
Code: Select all  Expand view


 oFr:SetWorkArea("NStatistik", SELECT("NStatistik"))  
 



Image

Re: FastReport

PostPosted: Wed Sep 30, 2009 6:42 pm
by Armando
Otto:

Thanks so much for your excelent tutor.

Regards

Re: FastReport

PostPosted: Wed Sep 30, 2009 6:58 pm
by Otto
How to get graphics and data on the same page?

The graphics and the data of this report are on 2 different pages.

On page 2 select "PrintONPreviousPage".



Image

Image

Re: FastReport

PostPosted: Thu Oct 01, 2009 6:22 pm
by Randal
Otto,

Thanks for the sample. I downloaded the demo however I could not compile because I don't have the lang_en.ch or sayref.ch files (couldn't find them anywhere). I did review the .exe demo however I could not add fields from my own tables to the report. I guess I have to do this by selecting my tables in the .prg before opening the designer or am I missing something?

Thanks,
Randal

Re: FastReport

PostPosted: Thu Oct 01, 2009 6:58 pm
by Otto
Randal,

I think you can command them out.
I don’t have these files, too.

>did review the .exe demo however I could not add fields from my own tables to the report. I guess I have to do this by selecting my tables in the .prg before opening the designer or am I missing something?


Yes. For example:
Code: Select all  Expand view
oFr:SetWorkArea("NStatistik", SELECT("NStatistik"))


Best regards,
Otto

Re: FastReport

PostPosted: Fri Oct 02, 2009 8:29 pm
by Randal
Otto,

I guess the end user wouldn't be able to create their own reports for anything more than one table as any index orders and relationships between multiple tables have to be set before you open the designer. I think the designer would be too complicated for most end users anyway.

Thanks,
Randal

Re: FastReport

PostPosted: Fri Oct 02, 2009 9:15 pm
by Otto
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

Re: FastReport

PostPosted: Fri Oct 02, 2009 11:48 pm
by Armando
Otto, Randal:

Otto wrote:You are right: the designer is no end user tool.
But for you as programmer you have all possibilities and the reports look professional.


Exuse me but there are an End user's manual (230 pages) and a Programer's manual (43 pages)

As you can see the end user's manual is bigest.

With best regards

Re: FastReport

PostPosted: Sat Oct 03, 2009 12:13 am
by HunterEC
Where can I get / download FastReport ? Thank you.

Re: FastReport

PostPosted: Sat Oct 03, 2009 6:20 am
by Otto
Hello,

[urhttp://www.paritetsoft.ru/frh.html][/url]

Best regards,
Otto

I quote here from a post of Marco:

Hi,
I suggest you to take a look at FastReport http://www.paritetsoft.ru/frh.htm
It is easly integrable in a FWH app and supports a lot of export formats - excel, word, openoffice write, openoffice calc also.

It runs with a SINGLE self.contained dll.
I previously used - as you - different components toghether to manage the reports and provide all features to my customers (Easypreview for the preview, Amyuni for the .doc export, irfanview for some graphics formats not supported by Easypreview) but it became difficult to manage and upgrade all components (We have about 5,500 customers). Using FastReport I replaced all of this with just a dll !!

It is also a report used from a lot of delphi programmers and this is a warranty for us about the future release - see http://www.fast-report.com

Hope this can help you. However on the paritetsoft website there are a lot of FWH samples and a trial report version.

Re: FastReport

PostPosted: Sat Oct 03, 2009 6:45 am
by Silvio
Otto,

Why not post a test complete with two dbf as an Order of products ?

I saw FR , it is a good application but ...

Perhaps too heavy, because it must load the DLL before printing

We can converte also the report on rtf but the lines are not converted to good...
would be nice to use something created with fivewin and enter fully into our applications without using third parties,

I believe this is also the new policy of Fivetech, which I support because it seems more real.
for both fully supported, both for easy of use, without trying to chase the authors of classes to have upgrades or modifies.

My project to create a report designer has stopped for now,

I can not finish it alone,

I miss a few things but I do not know if I can finish it yet


At first I maintained the paper as if it were a single area,

but now I understand how to manage different areas of the document

but I still have not figured out how to put into practice what I understand

Then for drawing lines, boxes, fields, and images we have found how to draw and how to save

so I fail to create the areas but I need your help

If I found time I can continue with my work...

Re: FastReport

PostPosted: Sat Oct 03, 2009 6:39 pm
by Otto
Why not post a test complete with two dbf as an Order of products ?


Hello Silvio,
Could you please explain what you exactly mean.
How should this form look - please post a screen shot .

Best regards,
Otto

Re: FastReport

PostPosted: Sat Oct 03, 2009 8:09 pm
by gvalentin
Kleyber Derik made a good demo of FastReport.

I don't know if it is on some site.

-----
GV