web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Printing 2 reports in a sequence business central

(5) ShareShare
ReportReport
Posted on by 216

Hi guys, 

I am having a problem with printing 2 reports (sales shipment and sales invoice) in a sequence by manually calling the print records functions on the respective records in BC20 On Premises. Its only printing the second report but both documents are incrementing the number printed field.

Any idea what could be causing this? 

I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    Can you have a default printer selection that makes it print on a printer you are not aware of, or could the reports have been saved as a file?

  • Suggested answer
    YUN ZHU Profile Picture
    95,331 Super User 2025 Season 2 on at

    Hi, have you tried using the standard feature to print two reports?

    For example,

    pastedimage1660610483870v1.png

    Hope this helps.

    Thanks.

    ZHU

  • Rebe.Gwaindepy Profile Picture
    216 on at

    Hello everyone, thanks for the responses. My situation is like this: We have Shipment and Delivery addition to the Sales process that combines various sales orders to one "Delivery Order" for shipment and Invoicing, so when the user Dispatches the delivery order it posts all sales orders and afterwards Prints the Shipments  and Invoices using the Record.PrintRecords function . Everything is going well up to the point of printing, BC is only printing the last print command (Invoices). The No. printed for shipment is increasing (i can see the print command is running)  but somehow the actual print does not happen.

    In the meantime i had to put a confirmation of print After the Shipments command and they all print fine, for now. I would appreciate if you suggest another way i can handle this.

    I see an almost similar issue was reported here but on BC15 here.

    pastedimage1660758323504v1.png

    I have attached a screenshot for a better overview of the process.

    Thanks,

  • Rebe.Gwaindepy Profile Picture
    216 on at

    I am using the print to pdf printer as my default printer on my machine and it automatically downloads the files. I am certain they are not being saved elsewhere.

  • Rebe.Gwaindepy Profile Picture
    216 on at

    Hi ZHU, thanks for the response. :-), I am a huge fan. Unfortunately for my case i cant use this feature because i a printing report 1306 and 1308.  As a side note, is there a way to call post and print for a number of orders in a sequence with Commit Suppressed?

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    Maybe you can share the code you are using ?

    Often easier to see whats going on then.

  • Rebe.Gwaindepy Profile Picture
    216 on at

    Below is the code i am using for printing(i am calling this procedure after posting all orders and i commit):

       procedure PrintDispatchDocuments(DeliveryOrderHeader: Record "ADV Delivery Order Header"; )

       var

           SalesShipmentHeader: Record "Sales Shipment Header";

           SalesInvoiceHeader: Record "Sales Invoice Header";

       begin

           //>> Delivery Notes

           SalesShipmentHeader.reset();

           SalesShipmentHeader.SetRange("Delivery Order No.", DeliveryOrderHeader."No.");

           SalesShipmentHeader.FindSet(true);

           repeat

               SalesShipmentHeader.PrintRecords(false);

           until SalesShipmentHeader.Next() = 0;

           //<<Delivery Notes

           //>> Delivery Invoices

           SalesInvoiceHeader.Reset();

           SalesInvoiceHeader.SetRange("Delivery Order No.", DeliveryOrderHeader."No.");

           SalesInvoiceHeader.FindSet(true);

           repeat

               SalesInvoiceHeader.PrintRecords(false);

           until SalesInvoiceHeader.Next() = 0;

           //<<Delivery Invoices

       end;

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    Could not find anything obvious in the code.

    Have you defined a report for the sales shipment in report selection sales?

    The printrecord function seems to depend on what is defined in report selection sales.

    And have you checked with printrecord(true) to check if the request form actually is executed?

  • Suggested answer
    YUN ZHU Profile Picture
    95,331 Super User 2025 Season 2 on at

    Hi, I'm not sure if this will help you, I have used the solution below to combine different reports into the one PDF and letting the client print this PDF.

    Merge PDF in Business Central (linkedin.com)

    Source: GitHub - gonzaloriosley/Merge-PDF-Business-Central

    Hope this helps.

    Thanks.

    ZHU

  • Rebe.Gwaindepy Profile Picture
    216 on at

    My report selections is defined ok with report 1308 for D Note. If i flip the code to print invoice first, then it will print D notes only. I have also debugged and indeed the system is calling the reports (and they increment No. printed). Is your post and print function for Cash receipt journal printing both GL register and Customer payment report?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans