Forum > LazReport

Header issues

<< < (2/2)

dseligo:

--- Quote from: laz_frank on March 26, 2022, 02:51:38 pm ---I tried to get the database fields of interest to print within the page header. I expected to get data of first record on the first page, but got data of the second record on the first page (please compare page header data on page 1 with master data on the same page).
--- End quote ---

I just tried page header and I think it works as you would like it too (only on first page it shows 0XX instead of 1XX because user dataset isn't initialized yet).
I'd say that there is definitely something wrong with Lazreport installation at your end.

I attached screenshot and project with master data's 'show on all pages disabled' and added page header.

laz_frank:
Thank you for your continued support.

Your project with 'Show on all pages' disabled works also as expected on Laz 2.2.0 (Fixes) as well as on Laz 2.3.0 (Trunk).

But if I enable 'Show on all pages' it still behaves as if it were disabled.

So, both of your projects work as expected, but changing the option 'Show on all pages' has no effect on my side.


--- Quote ---... maybe you didn't disable 'Show on all pages' properly.
--- End quote ---

- in Lazarus IDE: open 'unit1' | F12 | double click on frReport1

- in LazReport designer: right click on master header band | click on 'Show on all pages' | right click on master header band again to make sure that check mark has changed | Save report | Close

- in Lazarus IDE: Run | Clean up and Build ... | Clean up and build | F9

EDIT 1: The option 'Show on all pages' works as expected if I don't use 'Save report'. (???)

EDIT 2: Verified: The XML-Code of the report in unit1.lfm gets not changed if 'Save report' has been used.
<Flags Value="48"/>  or <Flags Value="112"/>

EDIT 3: The changes are written back to <Flags Value.../> in a reportname.lrf file, but the behaviour of the header band doesn't change. So the value doesn't seem to be interpreted correctly when run.

EDIT 4: If you leave the 'DataSet' field in the page header empty, the correct data from the first master record will be displayed. I assumed that if data from the master table should be displayed in the page header, one has to enter the same dataset as for the master detail band. But then data from another master record is displayed (point 2 of my first post).

dseligo:

--- Quote from: laz_frank on March 28, 2022, 10:53:31 am ---EDIT 1: The option 'Show on all pages' works as expected if I don't use 'Save report'. (???)

EDIT 2: Verified: The XML-Code of the report in unit1.lfm gets not changed if 'Save report' has been used.
<Flags Value="48"/>  or <Flags Value="112"/>

--- End quote ---

In my example project report is stored within form (in .lfm file) and you don't have to use 'save report' (or better, you shouldn't use 'save report') in this case.
What probably happens is this: report has flag 'IsChanged' or similar. When you make a change in the report and press Save this flag is cleared. When it's time to save it in a form, flag is cleared and nothing is saved.
I just tried to add a memo to report, hit save and then close and re-open form. Memo wasn't in the report.
So, don't use save when report is stored in the form.

laz_frank:

--- Quote from: laz_frank on March 24, 2022, 03:45:50 pm ---1) Sometimes the error '... Undefined symbol: SqlQuery."fieldname" ' appears, even though this field is displayed exactly like this in the DB field list within LazReport designer. Most of the time the error message points to a different band than where the field was actually placed. Unfortunately, I can't reproduce this behaviour reliably yet.

--- End quote ---

This error message can be avoided if 


--- 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";}};} ---frReport1.Options := [roIgnoreSymbolNotFound];
is used.

In my case the error was caused by fields that were listed in the object inspector but were invisible in the design area. I still don't know how these invisible fields came about, but I deleted them in the object inspector and the error went away.

Navigation

[0] Message Index

[*] Previous page

Go to full version