Forum > LazReport
Accessing LazReport Components by code
(1/1)
essence-ciel:
Hello,
Sorry for my bad English. I'm not familiar with the forums, excuse me too.
I'm trying to access frReport (LazReport) components programmatically from a Lazarus form (Settings form).
In order to find the components, I used this code:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---for I := 0 to frReport1.ComponentCount -1 do if (frReport1.Components[I] is TGroupHeader) then frReport1.GroupHeader1.Visible := CheckBox3.Checked;
But it's impossible to display/hide the frReport GroupHeader. Ditto for changing the color of the associated Memo.
How can I retrieve the component and modify it by code, please?
Windows 11, Lazarus 3.4, Sqlite 3.46.1
paweld:
You can solve this in several ways:
1. use parameters that can be used in the script for each band / memo
2. use the events OnBeginBand (for the band) and OnEnterRect (for the memo)
3. create reports dynamically using the lrCodeReport component - an example can be found in the directory: "{LazarusDir}\components\lazreport\source\addons\lrcodereport\sample\"
The first two points are in the attached example
essence-ciel:
Hi,
Thanks a lot. I'll study code and apply it.
Best regards,
Patrick
Navigation
[0] Message Index