Jump to content
We've recently updated our Privacy Statement, available here ×
  • Ad Hoc View Calculated Measure Localization


    asimkin
    • Features: Ad Hoc, Localization Version: v6.4.0 Product: JasperReports® Server

    Issue Description

    We have created a Calculated Measure while creating an Ad Hoc view. Now, we need to localize that Calculated Measure.

    We are able to localize the Dimensions,  Measures and calculated filed created at Domain level.

    Is there any way to localize Ad Hoc View Calculated Meausre?


    Resolution

    When an Ad Hoc View created, JasperReports Server automatically creates a separate copy of domain bundle file which is stored in Ad hoc View internal structure.

    A possible solution to achieve the requirement is:

    • create a bundle file and assign it to domain (if the file is already there, skip this step)

    • create and Ad Hoc View from the domain, create required calculated measure, save the view

    • export the Ad Hoc View to a zip archive

    • unzip the arcive, locate topicJRXML.data file within the Ad Hoc view folder

    • locate created calc measure definition at the end of the file within <field name ... /field> XML tag

    • add 2 properties into the measure definition:

      <property name="semantic.item.desc.id" value="TAX.DESCR"/>
      <property name="adhoc.display" value="$R{TAX.LABEL}"/>
      

      where TAX.DESCR and TAX.LABEL are keys used to translate the measure

    • locate domaini18n.properties.data file inside the Ad Hoc View folder

    • add translations for the custom keys:

      TAX.LABEL=Freight TAX
      TAX.DESCR=Freight TAX Description
      
    • pack the files back into a zip archive and import it into the server with Update flag

    • test the Ad Hoc View

    Attached is a  printscreen that demonstrates the idea.

    localizecalcmeasure.png.3c3646fbb5095cbb500eb7458464c946.png

    Solution tested with TIBCO JasperReports® Server v.6.4.0


    Ref. Case 01552568

    localizecalcmeasure.png.6f0c96f964a91bd973fdab0ed08fa69b.png


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...