Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How to print SSRS report to a system default printer

(0) ShareShare
ReportReport
Posted on by

Hi Folks,

Please suggest how to do i ensure via X++ that a report prints via the system default printer only.

I know that when we print attachment , the attachment goes through docref classes & it calls Winapi to print the attachment through system default printer. How can i ensure that my srsprintdesitination settings use the same command & prints via system default printer.

Docuref class i was refering to is Docuactionfile and method is print

the code line below calls the shell which basically calls the system default printer.

  filename = this.command(#ShellExePrint, docuRef);

Thanks

Mav.

  • Mav Profile Picture
    Mav on at
    RE: How to print SSRS report to a system default printer

    Mea_

    Does Winapi:Shellexecute not work in batch job, i did not know this. Thanks for sharing.

    I was thinking how about i write a line of code to get the system default printer 1st like using command from here to get default printer and then store the printer name in a variable, then in ssrs print destination i pass this printer name to print this report. Will that be a right approach?

    Is there any way i can translate this d365 code to Ax2012, this may help in converting the attachment document from docref to a contract & then send that contract to printer .

    https://community.dynamics.com/365/financeandoperations/b/ievgensaxblog/posts/msdyn365fo-how-to-send-pdf-document-to-a-printer-from-x

    Intent is to to print the report & attachment from doc ref to a same printer which is not set as default printer on user system.

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to print SSRS report to a system default printer

    But how would it work with batch job ?

  • Mav Profile Picture
    Mav on at
    RE: How to print SSRS report to a system default printer

    So is there no way I can use #shellexeprint in srsprint destinations. If there is a way to use #shellexeprint in srsprint desitinatoon then that would ensure the report and document gets printed via same printer which is system default printer at user’s computer .

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to print SSRS report to a system default printer

    It's a strange requirement, you can print report in a batch or from server side code, so each AOS can have it's own default printer or dont have printer at all. So I would rather set printer from code.

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…

Vahid Ghafarpour – Community Spotlight

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

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,399 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans