Captions in a report

poppinspoppins Member Posts: 647
edited 2017-12-07 in NAV Three Tier
Hi everyone,

I am designing a report where the customer wants the caption to be like this: caption in language a/caption in language b.
For example, if language a =ENU and language b = FR, the caption for the field Name in the report would be Name/Nom.
What is the better way to do this: I am thinking of writing the combination directly in the report designer, but is there a way to achieve it through NAV text constants?

Thanks in advance :)

Answers

  • frankmortensenfrankmortensen Member Posts: 42
    Once you know which language the report should be printed in use CurrReport.LANGUAGE :=... to change to this language. After setting the language with CurrReport.LANGUAGE all text constants field captions etc. will show in this language.
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    The caption information for fields cannot be easilly extracted during the runtime, there is no buildin function to get a field caption a language other than the current language (either default client language or set via CurrReport.LANGUAGE call)

    The workaround I could think of is to build a generic empty report, having only one a function retrieving current field caption:
    GetCurrCaption(TableNo, FieldNo) 
    RecRef.OPEN(TableNo)
    FieldRef := RecRef.FIELD(FieldNo);
    Exit(FieldRef.CAPTION)
    
    Then in your code use that to get captions for the field in desired language
    LanguageExtractReport.LANGUAGE('FRA');
    MyFRCaption := LanguageExtractReport.GetCurrCaption(myTableId, MyFieldNo);
    
    Its just an idea, haven't tried it myself.
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Sign In or Register to comment.