Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

AX 2012 R3. Print alternative design of static SalesInvoiceReport

Posted on by 2,983

I've created a new design in SalesInvoice report called DesignAlt. As this report is marked as static in the Report Options form, I've added and marked SalesInvoice.DesignAlt as a static report as well.

After implementing, I get a SalesInvoice.DesignAlt for each active language in SSRS.

Now I've modified SalesInvoiceController.preRunModifyContract() and added this line

this.parmReportName(ssrsReportStr(SalesInvoice, DesignAlt));

However, when I print the report, it prints the original design SalesInvoice.Report

Any ideas on how to solve this issue? I need to print SalesInvoice.DesignAlt in stead.

*This post is locked for comments

  • Suggested answer
    Ghetz Profile Picture
    Ghetz 2,983 on at
    RE: AX 2012 R3. Print alternative design of static SalesInvoiceReport

    I think we can't provide a new menuitem with a static design, as SalesInvoice doesn't directly point to the report, but to the SalesInvoice Report controller class.

    However, I found a solution, hope this can help other users trying to achieve the same result.

    Certainly, SalesInvoiceController class has the method runPrintMgmt. I could change the report design, adding this code to the method:

    if (this.parmArgs().parm() == 'DesignAlt') //This is my MenuItem parameter
            {
                if(formLetterReport.moveNextPrintSetting())
                {
                    printSettingDetail = formLetterReport.getCurrentPrintSetting();
    
                    if(printSettingDetail.parmReportFormatName() == PrintMgmtDocType::construct(PrintMgmtDocumentType::SalesOrderInvoice).getDefaultReportFormat())
                    {
                        
                        this.parmReportName(ssrsReportStr(SalesInvoice, DesignAlt));
    
                        printSettingDetail.parmReportFormatName(this.parmReportName());
                    }
                    else
                    {
                        // Uses the SSRS Report name configured by user on Print Management
                        this.parmReportName(printSettingDetail.parmReportFormatName());
                    }
    
                    this.resetReportDataContract();
                    formLetterReport.parmReportRun().loadSettingDetail(printSettingDetail);
                }
    
    
            }


    Also remember to add the new design to Report Management following this post: http://blogs.msdn.com/b/axsupport/archive/2012/05/24/dynamics-ax-2012-reporting-how-to-specify-new-design-for-sales-order-confirmation.aspx

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AX 2012 R3. Print alternative design of static SalesInvoiceReport

    I think you need to take a look in print management in details because by changing report name on the basis of parameter does not work as it somehow fetches the value from print management.

    You may try by creating a separate menu item providing the static design to it and calling that menu item with the code.

    Hope this resolve your problem.

  • Ghetz Profile Picture
    Ghetz 2,983 on at
    RE: AX 2012 R3. Print alternative design of static SalesInvoiceReport

    Thanks for your answer,

    I am using both the Original design (Report) and the new Design (DesignAlt). I need to choose one or the other depending on the caller MenuItem.

    Is this possible??

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AX 2012 R3. Print alternative design of static SalesInvoiceReport

    There are two possible solution.

    1. Change the value of report design in print management settings.

    2. If you are not using the original design "Report" rename it as "Report_Backup" and change name of customized design to "Report".

    Hope this solves your issue.

  • Ghetz Profile Picture
    Ghetz 2,983 on at
    RE: AX 2012 R3. Print alternative design of static SalesInvoiceReport

    Update here.. I've followed this post, and enabled my new design in the Accounts Receivable - Form Settings - Print Management.

    I've created an aditional "Copy design" to make it "conditional", as specified in this link (specify conditional settings) However, I dont't have the select button described in step 5 to specify a query.

    Anyway, this approach won't work for me, as my condition to print the original report or the AltDesign is not query based, but just based on the parameters of my MenuItem.

    What can we do here? Any ideas?

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans