Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Printing report for many records at the same time

(0) ShareShare
ReportReport
Posted on by 5

Hi! I created report and RDLC layout. In the next step I want to print reports for more than one record at the same time (like Purchase Invoice printing with filtr on a few documents - for every document - new page occurs report).
How can I do this? I want the same behaviour - for every record - new page in printed report.

I pass on table records to report X and it works correctly - 'OnAfterGetRecord' for dataitem occurs X times. But report is printed only for first record.

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 76,909 Super User 2025 Season 1 on at
    RE: Printing report for many records at the same time

    Hi, I think you can refer to the standard report.
    for example, Standard Sales - Order Conf. (1305)

    pastedimage1664238233239v1.png

    Source Code and layout file:

    [View:/cfs-file/__key/communityserver-discussions-components-files/758/StandardSalesOrderConf.Report.al]

    [View:/cfs-file/__key/communityserver-discussions-components-files/758/StandardSalesOrderConf.docx]

    [View:/cfs-file/__key/communityserver-discussions-components-files/758/StandardSalesOrderConf.rdlc]

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 995 Super User 2024 Season 1 on at
    RE: Printing report for many records at the same time

    That really depends on how your report is built.

    Often when you want to print many records with a page shift in between you really want to process it as separate report executions.

    That is what the use of a repeat loop will do for you.

    A good example is an invoice or an order confirmation. You should loop through those document headers and print them one by one. Instead of getting a multi page report.

  • Maxim Rylev Profile Picture
    Maxim Rylev 75 on at
    RE: Printing report for many records at the same time

    Can you expand your answer?

    Where is needed to loop through records? If table with many records is passed to report (and trigger many times dataitem in OnAfterGetRecord trigger) - it is not this looping?

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 995 Super User 2024 Season 1 on at
    RE: Printing report for many records at the same time

    You need to loop through the records and put your report processing into a repeat statement.

    Read more about the repeat statement here:

    learn.microsoft.com/.../devenv-al-control-statements

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans