Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

Print SSRS Report through a Printer mentioned in Document Routing of Warehouse Management module

Posted on by 742

Hi Everyone,

Need urgent help on below issue,

I want to print a SSRS report through a printer which is mentioned in Warehouse Management > Setup > Document Routing > Document Routing

Please find highlighted printer name in attached screenshot.

What approach should I use?

My controller class' main is as below,

public static void main(Args _args)
{
#define.ReportDesign("CHI_GenerateRecLabelMobReport.Report")
CHI_GenerateRecLabelMobController generateRecLabelMobController;

generateRecLabelMobController = new CHI_GenerateRecLabelMobController();

generateRecLabelMobController.parmReportName(#ReportDesign);

generateRecLabelMobController.parmArgs(_args);

generateRecLabelMobController.parmShowDialog(false);

generateRecLabelMobController.parmLoadFromSysLastValue(false);

generateRecLabelMobController.startOperation();
}

Please suggest solution. Thank you in advance.

docRouting.png

  • Rhushikesh R Profile Picture
    Rhushikesh R 742 on at
    RE: Print SSRS Report through a Printer mentioned in Document Routing of Warehouse Management module

    Hi Crispin,

    please find prePromptModifyContract() method of my controller class,

    protected void prePromptModifyContract()

    {

       CHI_GenerateRecLabelMobContract  generateRecLabelMobContract;

       MyTable                                              myTable;

       args    = this.parmArgs();

       generateRecLabelMobContract = this.parmReportContract().parmRdpContract() as CHI_GenerateRecLabelMobContract;

       generateRecLabelMobContract.parmRecIdStr(this.parmArgs().parm());

       generateRecLabelMobContract.parmPrintSettings(new SRSPrintDestinationSettings(myTable.PrinterName));

    }

    This is the only change I require in my controller class, right?

    Will this work?

    And my controller class' main() method is as below,

    public static void main(Args _args)

    {

       #define.ReportDesign("CHI_GenerateRecLabelMobReport.Report")

       CHI_GenerateRecLabelMobController      generateRecLabelMobController;

       generateRecLabelMobController    = new CHI_GenerateRecLabelMobController();

       generateRecLabelMobController.parmReportName(#ReportDesign);

       generateRecLabelMobController.parmArgs(_args);

       generateRecLabelMobController.parmShowDialog(false);

       generateRecLabelMobController.parmLoadFromSysLastValue(false);

       generateRecLabelMobController.startOperation();

    }

    Do you think that it will work?

  • Rhushikesh R Profile Picture
    Rhushikesh R 742 on at
    RE: Print SSRS Report through a Printer mentioned in Document Routing of Warehouse Management module

    Hi Crispin below is the Logic written in setPrintSettings() method,

    /// <summary>

    /// Sets the print settings.

    /// </summary>

    public void setPrintSettings()

    {

       ProdUpdRelease          prodUpdRelease;

       ProdParmRelease         prodParmRelease;

       SrsReportDataContract   dataContract;

       if (args && (args.caller() is ProdUpdRelease))

       {

           prodUpdRelease = args.caller();

           prodParmRelease = prodUpdRelease.parmParmBuffer();

           dataContract = this.parmReportContract();

           dataContract.parmPrintSettings(new SRSPrintDestinationSettings(prodParmRelease.SetupPrintRouteCard));

       }

    }

    What should I pass in last line that is

    dataContract.parmPrintSettings(new SRSPrintDestinationSettings(prodParmRelease.SetupPrintRouteCard));

    As I browsed the ProdParmRelease   table's SetupPrintRouteCard field, found that it's blank.

    Where shall I pass Printer name ?

  • Rhushikesh R Profile Picture
    Rhushikesh R 742 on at
    RE: Print SSRS Report through a Printer mentioned in Document Routing of Warehouse Management module

    Hi Crispin,

    Thanks for the prompt reply.

    Could you please explain in details or could you share any link where I can refer the code of same.

    As I am new to AX world I am not aware how to wrap it to controller.

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans