Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Report dialog and user's language

Posted on by 20

When I add a controller class and specify a caption with label, the parameter dialog's caption is changed to Japanese.

but when I change to the user language to ja-JP in user options, the caption always displays in Japanese:

pastedimage1676422602250v1.png

What my problem is the caption to change as the user's language changes.

Forgive me if I didn't make myself clear before.

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: Report dialog and user's language

    I would use the debugger to see what exactly is happening.

  • richard man Profile Picture
    richard man 20 on at
    RE: Report dialog and user's language

    Thank you for your time and answer.

    I appended the following code to the controller, but it doesn't seem to have any effect. Is there any problem with my code appended?

        public ClassDescription caption()
        {
            return "@MyLabel111";
        }

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: Report dialog and user's language

    SysOperationsaContoller stores the caption in usage data and loads it together with parameters from the last run. If you don't want it, you can (for example) override caption() and always return your label, regardless of the value of dialogCaption variable.

  • richard man Profile Picture
    richard man 20 on at
    RE: Report dialog and user's language

    Just for this one.

    But the other report that I customized is ok because I add the code bellow in my UI Builder class,

        public void postRun()
        {
            Dialog dialogLocal = this.dialog();
            dialogLocal.dialogForm().formRun().design().caption("@labels:123456");
        }

    but for this report, as you can see from the image of the project structure, there is no UI Builder file, because I created an extension from a standard report.

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: Report dialog and user's language

    Is it a problem with all reports, or is it just about your customization?

  • richard man Profile Picture
    richard man 20 on at
    RE: Report dialog and user's language

    Does it mean that you changed the language to something else than  ja-JP?

    -> Yes, I changed the language to ja-JP when I want to confirm the Japanese. And en-US or en-SG for English.

    1.en-US

    pastedimage1676505984634v1.pngpastedimage1676506600999v2.png

    2.ja-JP

    pastedimage1676506677500v3.pngpastedimage1676506707614v4.png

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: Report dialog and user's language

    Thank you for these details, but could you also answer my questions, please?

  • richard man Profile Picture
    richard man 20 on at
    RE: Report dialog and user's language

    This is my code structure.

    pastedimage1676456178022v1.png

    We have 3 label txt file en-SG, en_US, ja-JP

    and this is the menu item's property.

    pastedimage1676456353222v2.png

    and this is my controller:

    public class CP_CustSalesOpenLinesbyCustController extends SrsReportRunController
    {
        /// 
        /// Report Controller
        /// 
        /// 
        public static void main(Args _args)
        {
            //define the new object for controller class
            CP_CustSalesOpenLinesbyCustController ssrsCustSalesRC;
     
            ssrsCustSalesRC = new CP_CustSalesOpenLinesbyCustController();
     
            //pass the caller args to the controller
            ssrsCustSalesRC.parmArgs(_args);
     
            //set the report name and report design to run
            ssrsCustSalesRC.parmReportName(ssrsReportStr(CustSalesOpenLines_Extension, ByCust_Extension));
            ssrsCustSalesRC.parmDialogCaption("@CP_Labels:CP01780");
     
            //execute the report
            ssrsCustSalesRC.startOperation();
        }
    
    }

    and this is my report property:

    pastedimage1676456661965v4.png

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: Report dialog and user's language

    Does it mean that you changed the language to something else than  ja-JP?

    Is it a problem with all reports, or is it just about your customization? It it's the latter, please share your code with us.

  • richard man Profile Picture
    richard man 20 on at
    RE: Report dialog and user's language

    Thank you. Martin.

    Sorry I didn't make my question clear.

    My problem is that when the user changes the language, the parameter dialog's caption of the report doesn't change.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans