Recent

Author Topic: LazReport with multiple stretched memos in same band does not work  (Read 2797 times)

worktwohard

  • Newbie
  • Posts: 4
LazReport with multiple stretched memos in same band does not work
« on: September 23, 2021, 07:06:03 am »
I am new to this forum and Lazarus, so I may get things wrong here. I am using Laz 2.0.12 on windows 10 with SQLite3.
I have a report that requires more than 1 stretched memo (one full width memo after the other) on the one stretched band.
Each memo is connected to a field in the database. eg. Field1=Memo1, Field2=Memo2 etc.
When I preview the report it does not stack the memos one after the other then stretch them but stretches to the largest of all memos on the band from where they are placed in design mode, on top of each other.
How do I get multiple stretched memos to work correctly, eg move down when 1st memo stretches and then stretch next memo.
I have tried putting them on different bands (even different types of bands) but that does not work as it prints all the first memo records before printing the next memo records even though they are on the same Database record.
I did get it to work in preview when in design mode (by not assigning the second band a dataset) but soon as you go to Show report in the running app it goes wrong again. See attached examples.
Is this a bug or am I missing something simple.

worktwohard

  • Newbie
  • Posts: 4
Re: LazReport with multiple stretched memos in same band does not work
« Reply #1 on: September 25, 2021, 06:52:59 am »
Jamie,
Thanks for the reply.
You say you can only picture my issue ?
Did you see the attachments showing the design setup and related preview and running version ?
What anchors are you referring to ?
I have not seen anything to do with anchors in the report writer.
I don't believe I anchored anything, just place them in the bands, and I don't change things from design to running (Showreport).
I have even run this in Fortes report and the bands and stretching I can get to work but it has a different problem of having the second band (with 3 columns) and memo's stretch with extra lines after each paragraph for the 3 columns, so there are large gaps at the end of each column (almost like it thinks each line from each column is added to the stretch length).
So that doesn't help either.
Any other thoughts would be appreciated.

worktwohard

  • Newbie
  • Posts: 4
Re: LazReport with multiple stretched memos in same band does not work
« Reply #2 on: September 26, 2021, 03:12:09 pm »
Jamie, Thanks for the reply.
I am not creating memos on the fly. The report is created in the VCL designer and saved so that it is called with 1 call ReportName.Showreport.
The report is simple and the fields are tied to the memos in design mode in the report, there is no code written in Lazarus or the report to change the report at runtime. The alignment is not changed at anytime.
That is why I say it is probably a bug.
I don't change anything from previewing the report while in design mode to running it in the application.
Again thanks I will just persist and try other options.

worktwohard

  • Newbie
  • Posts: 4
Re: LazReport with multiple stretched memos in same band does not work
« Reply #3 on: September 27, 2021, 04:52:00 am »
I finally worked out how to use more than 1 (full width of report) stretched memo per record.
For the second or more memos you need to add a child band with the memo inserted after any stretched memo and link the child band to the previous band.
This appears to work for the reports I have used.

 

TinyPortal © 2005-2018