Lazarus
Programming => General => Topic started by: phil_v on November 09, 2018, 06:05:26 am
-
Hi, I'm using
OS W10 64Bit
Lazarus V 1.8.4
FPC V3.0.4
SVN 57972
x86_64-win64-win32/win64
Fortes4Lazarus
I've been using Fortes Report, with excellent results. I'm now trying to create a report in code.
Initially, I just want to create a Report with a HeaderBand, containing a label.
The code attached displays the report with report borders showing, but does not show the Page Header band containing the label. I am obviously missing something important about creating bands in the report.
Thks in advance
-
You forgot to add the parent control for both the band and the label(Parent := MyReport, Parent := B_PageHead respectively). Other then this your code will leak, you should free the report somewhere. Another question: why don't you use the report designer? Creating each and every control dinamically it's a very difficult task, especially on a complex report.
-
Thankyou GetMem,
Yes, I agree, creating reports in code is not optimal.
I use the designer for all of my "standard" reports in the application, but I have a need to create a report for 6 queries that have differing numbers of columns. So, I thought I would try the code method for these and dynamically add columns to the report according to the columns contained in the queries.
I may revert to creating them with the designer, if it's too difficult.