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?
Hi guys,
it looks like this is not possible as of now because of browser limitations:
Thank you, if all fails then i will have to go this route.
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?
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
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?
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;
Maybe you can share the code you are using ?
Often easier to see whats going on then.
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?
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.
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.
I have attached a screenshot for a better overview of the process.
Thanks,
André Arnaud de Cal...
291,979
Super User 2025 Season 1
Martin Dráb
230,848
Most Valuable Professional
nmaenpaa
101,156