Ask The Experts: ZENworks [39]

Some time ago in one of the Q&A’s I wrote about the ability to localise ZAPP:  this time another localisation issue that I’ve been asked about.

Q: How does ZENworks Reporting determine what date format is used?

A: For most customers the date format will automatically be detected based on their browser settings.

When looking at dates and timestamps in ad hoc reports, ZENworks Reporting will look at the language settings within the browser and try to adapt to this with the date format that it uses. For American English, the date format will be something like mm/dd/yy, while if your browser language is set to German this will change to dd.mm.yy and for customers with UK English set as their browser language the date will default to dd/mm/yy.

In addition to the browser settings mentioned above, at the login window you can select the default locale as shown in figure 1.

39-qa-zen-1
Figure 1: setting the locale on the login window

 

Q: When I look at the report from within the browser I get the proper date formatting, but when I schedule the report it has the American date formatting. How can I change this?

A:  For most customers the automated detection of the date format is working fine from within the browser, but when scheduling reports the system defaults to American English. When reports are scheduled you will need to specify the Output Locale for the report. On the page where you schedule the report go to the Output Options tab  and there you can specify the Output Locale.

Q: I don’t want to use this automated detection of date format. Can I specify a fixed date format?

A: In some countries the automated detection of the date format might be causing problems, and in addition some customers just want to create their own formatting. If we want to set our own fixed date format we will need to set this in one of the properties files on the server.

To set the date format open up the file: /opt/novell/zenworks-reporting/js/apache-tomcat/webapps/jasperserver-pro/WEB-INF/bundles/adhoc_mask.properties

In the adhoc_masks.properties file you can find the date formatting that is being used within the ad-hoc editor. The formatting uses the Java Customizing Formats and you will find things like medium, short and long. These are the predefined date formats within Java that will change based on the localisation settings. Within this file we can add a few lines to define the formatting we would like to use.

39-qa-zen-2
Figure 2: Creating your own date formats in the adhoc.masks.properties file

 

Before we start editing this file, let’s look at the attributes we report against. Most database entries we have within the ZENworks domains are actually timestamps, not just dates, so in the adhoc_mask.properties file we will need to add our additional date formats to the list of timestamp formats. Just add the formatting you need and after saving the file you will need to restart ZENworks Reporting. Now you should be able to use the formatting you just defined.

 

This article was first published in Open Horizons Magazine, Issue 39, 2017/4, p38.

 

 

....To view the full article you must have a full Digital Subscription.

 

Add a Comment