Skip to main content

Notifications

Microsoft Dynamics AX forum
Suggested answer

Merging documents in SSRS report

Posted on by

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

  • D365 Developer Profile Picture
    D365 Developer 215 on at
    RE: Merging documents in SSRS report

    Hi Mav,

    Could you let me know how you managed to print SSRS report +Docuref table attachment. I have a similar requirement.

    Thanks!

  • Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,089 on at
    RE: Merging documents in SSRS report

    Hi Mav,

    By the way, check if this solution can help you to print files to needed printer

    www.artofcreation.be/.../

  • Mav Profile Picture
    Mav on at
    RE: Merging documents in SSRS report

    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?

  • Suggested answer
    Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,089 on at
    RE: Merging documents in SSRS report

    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

    www.theaxapta.com/.../print-pdf-files-from-ax-x-code.html

  • Blue Wang Profile Picture
    Blue Wang on at
    RE: Merging documents in SSRS report

    Hi Mav,

    Have you tried to use SRSPrintDestinationSettings class?

    printDestinationSetting.printerName(printer);

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

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,782 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,067 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,150

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans