I have a report which has 2 components , SSRS + attachment stored in Docref table.
When a user prints the report, the report prints via the printer user chooses in the print medium window , for example Printer A.
However the attachment prints via Printer B which is default printer in user's system.
Also when user prints multiple reports , all the SSRS stuff prints 1st & then all the documents from Docref table.
Please let me know what can i do to achieve the following.
1 . Both SSRS & Docref attachments prints through 1 printer which user chooses in print medium window, i.e. all via Printer A & nothing prints to Printer B.
2. When multiple reports are printed it prints like report1+ attachments for report 1, report 2 + attachment for report 2 & not like report 1 + report 2 + attachments 1 + attachments2..
I was thinking of making attachment as file object in SSRS report, but then that would be altogether different problem as attachments could spill unevenly across pages, plus read multiple articles suggesting not to include attachment as file object in SSRS report.
I think most probably i will have to print & store the report 1st as PDF & then print this PDF to printer followed by related attachments, however unsure how to get this technically done in X++.
Please suggest a solution.
Thanks & Stay safe.
Mav
Hi Mav,
Could you let me know how you managed to print SSRS report +Docuref table attachment. I have a similar requirement.
Thanks!
Hi Mav,
By the way, check if this solution can help you to print files to needed printer
I found a thread but with no solution :-( .
dynamicsuser.net/.../how-to-change-the-defalut-windows-printer-from-ax
This is exactly what i want to do but issue is that my report prints through the printer user chooses in printer window & the documents from doc ref table uses standard funtionality to print via [tag:ShellExePrint] which always uses system default printer. Requirement is to print both the report & docuref document to printer user chooses to print the report from.
Any ideas?
Hi Mav,
I think printing to PDF it good idea, than you can print all pdf to printer via .net (write own library and it to ax) or winapi.
docs.microsoft.com/.../system.drawing.printing.printdocument
Hi Mav,
Have you tried to use SRSPrintDestinationSettings class?
printDestinationSetting.printerName(printer);
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,782 Super User 2024 Season 2
Martin Dráb 229,067 Most Valuable Professional
nmaenpaa 101,150