I am trying to send records from aggregates to a pdf document.
I am using the Screen to PDF
I use a loop to loop through each record from my aggregate to information from various aggregates to the MainContent
In the OnInitialize event , i have a ScreenToPDF_OnInitialize which I set the Preview to true.
I can see the content being send to the ContentBlock , but after each record , the pagebreak did not add a new page to allow the 2nd record to get printed.
I ended with only one record being send to the pdf document which is the last record.
Can someone help me , not sure which part i did wrong ? Why the pagebreak did not generate a new page to accept the respective record.
It is like , the next record just replace the previous record .
Thank you in advance
Hi Jerah,
could it be that your loop is 'just looping' and after looping through the last record, it just holds that information and shows it on screen?
Have you tried using a List on your screen inside MainContent and attach it to the source, which now is defined in your loop? And create a new Block and move the containers to that block, place all the aggregates into the Block and define the right input parameters.
That will create a loop over UI Blocks where the Block will get AND show the data of each record instead of reading all data and just show the latest record.
Good luck,
Hans
Hans ;
thank you for taking time to reply and really grateful.
After reading what you write and what i did, i had make changes to my screen lay out
In order that i can get each record from the aggregate printed i need to put the block inside the row cell.
So that the id from the aggregate will be past to the report block to generate the full details report and with this arrangement , the report will not override the previous one.
But as i put the block inside the row cell the report appear to be squeeze.
How can i adjust the margin such that i get more space on the width part
Instead of using a table widget, you can use the List widget. That already might solve your issue. Else, can you show a screenshot (anonymized when necessary)?
Regards Hans
That is definitely a better option , thank you
One last thing , do you have any idea how to remove the last empty page ?
I suggest to check if there is any margin on any of the surrounding containers, or a footer in the layout, or margin on a container in the Block that creates a bit of empty space that results in an empty page.
Noted with thanks
Can you create a demo OML and share it here for us to check the code?
Thanks,
Arnold