Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

send report in printer from AL

Posted on by 175
Hi,
 
can anyone suggest me how I can send report directly to printer from AL code?
 
 
Categories:
  • Suggested answer
    Judy Profile Picture
    Judy Microsoft Employee on at
    send report in printer from AL
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,698 Super User 2024 Season 2 on at
    send report in printer from AL
    Hi, do you want to print directly? The method mentioned by Umesh still requires opening the report in a browser and cannot print it directly.
    You can try Universal Print.
    More details:
    Print directly to local printers with Universal Print
    Set Up Universal Print Printers
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Umesh Pandit Profile Picture
    Umesh Pandit 9,261 User Group Leader on at
    send report in printer from AL
     
    In Microsoft Dynamics 365 Business Central, you can use AL (Application Language) to send a report to a printer by using the REPORT.RUNMODAL function. Below is a basic example:
     
    // Codeunit example
    procedure SendReportToPrinter()
    var
        ReportRunRequest: Record "Report Run Request";
    begin
        // Initialize the Report Run Request record
        ReportRunRequest.SETRANGE("User ID", UserId);
        // Specify the Report ID you want to print
        ReportRunRequest."Report ID" := 'YourReportID';
        // Optionally, set other parameters like filters
        // ReportRunRequest.SETFILTER("Field Name", 'Filter Value');
        // Run the report and send it to the printer
        IF ReportRunRequest.INSERT THEN
            REPORT.RUNMODAL(ReportRunRequest);
    end;

     
    In this example, replace 'YourReportID' with the actual Report ID you want to print. You can find the Report ID in the Object Designer in Business Central.
     
     
  • Suggested answer
    gdrenteria Profile Picture
    gdrenteria 12,183 Most Valuable Professional on at

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans