Skip to main content
Windward

Format Dates and Numbers with the Out Tag

Overview

This article will show you how to apply different formatting to data both entering and leaving Out Tags as output. When selecting an Out Tag, the Format Data icon in the AutoTag Ribbon (shown below) will allow you to visually set the format of the numbers and dates you want to output. If you built your template in Microsoft Excel then you should continue to use Excel's native cell formatting. If you are using Microsoft Word, things should look very similar as Windward has designed a date and number formatter that closely resembles Microsoft Excel's. This was done to make it easier for our users to format dates and numbers.

When Do I Use This Function?

  • This function is only used for Out Tags as the number and date formatting affects output printed in the final report. This is the only tag where the format button is visible in the AutoTag Ribbon.
  • The input pattern (located under Advanced in the Tag Editor) allows you to specify the format of data coming from your data source. This is especially useful if your dates are stored in a non standard format and you need to convert them to a format Windward can understand.
  • The format pattern fields (located under Tag in the Tag Editor) are the advanced form of the format button above. This field allows you to specify different patterns to convert your data into the desired output format.  For Example, a date returned at 3-14-2016 could have a format pattern "category:date;type:10;format:[$-409]MMMM d, yyyy~@;" and this would print the date as March 14, 2016.

Data Sources  

  • All data sources are supported
  • Note: XML data sources do not type numbers or dates without an additional XSD file to specify these types

Sample

Examples of each of the supported formatting options below are in the attached sample.

 

Date and Number Formatting Sample - Template.docx

Formatting Supported

  • General
  • Number
  • Currency
  • Accounting
  • Date
  • Time
  • Date and Time (both)
  • Percentage
  • Fraction
  • Scientific
  • Text
  • Special
  • Custom

But wait, I want European-formatted numbers!

If that's the case, all you need to do is change the Locale options.

Interface

When you double-click on the Out Tag in your template, the AutoTag Ribbon will display Format Data as part of the Out Tag Properties. When you click on that button, the Format Axis interface will appear as shown below.

 

Basic Example

Dates

  1. Open the sample template from above and select the first date example Out Tag [Static Date Full Text Format]
  2. In the AutoTag Ribbon select the Format Data button  to open the date and number formatting window
  3. Under the category section select date.
  4. Under the type section select the date format you would like your date to display as in the final report and click Apply.
  5. Click on the Evaluate icon  to preview your newly formatted date.
  6. Note: Using the Format Data button will automatically choose the type of the data to be a date by analyzing the result and automatically applying it.

Numbers

  1. Open the sample template from above and select the first number example Out Tag [Static Date Full Text Format].
  2. In the AutoTag Ribbon select the Format Data button  to open the date and number formatting window
  3. Under the category section select number.
  4. Under the type section select the number format you would like your date to display as in the final report and click Apply.
  5. Click on the Evaluate icon  to preview your newly formatted date.
  6. Note: Using the Format Data button will automatically choose the type of the data to be either a number by analyzing the result and automatically applying it.

Advanced Formatting using Pattern and Input Fields

Taking advantage of the pattern attribute in the Tag Editor will allow you to apply an output pattern to change how a date or number looks in the final report. You will also need to set the type attribute to date for date formats and number for number formats to allow Windward to understand basic date and number formats. 

What if dates are stored in my data source in a non standard format?

If your dates are not formatted in standard MM/dd/yyyy, yyyy/mm/dd or MM/dd/yyyy'T'hh:mm:ss format then you will need to make use of the input attribute to apply a pattern for how your dates are formatted.

Example

If your date is formatted in your data source as 2016-30-07T12:45:36 meaning you have the date 07/30/2016 at the time 12:45:36 PM.  You will need to set the type=date and apply the following input pattern:

yyyy-dd-MM'T'hh:mm:ss

Below are screenshots of how to apply and use the different date attributes from the links of the following Java libraries.

Additional Formatting

The following Java libraries are used by Windward to specify the symbols you can use to create patterns that reflect additional number and date formatting you may need that are not not mentioned on this page.

DATES

  1. To format a date you need to take advantage of the input pattern attribute in the Tag Editor to apply an output format format pattern to change how the date looks in the final report.

 

 

Date_Formatting2.png

 

  1. You will need to set the type attribute to date to enable Windward understand basic date formats. If your dates are not formatted in the following standard formats below then you will need to make use of the input attribute to apply a pattern for how your dates are formatted in your data source.
  • MM/dd/yyyy
  • yyyy/MM/dd
  • MM/dd/yyyy'T'hh:mm:ss  

Example

Your date is formatted as 1996-30-07T12:45:36 meaning you have the date 07/30/1996 at the time 12:45:36 PM. You will need to set the type=date and apply the following input pattern below.

 

yyyy-dd-MM'T'hh:mm:ss

 

Date_Formatting3.png

 

Date_Formatting5.pngDate_Formatting4.png

 

NUMBERS

Numbers can be formatted using the DecimalFormat Java Library symbols which will mostly consist of a series of "#" or "0".

 

Number_Formatting1.png

 

  1. You will need to set the type attribute to number in order to have the formatting applied to the number returned from your data source.

 

Number_Formatting2.png

 

  1. Now you will need to apply the format pattern using the DecimalFormat Java Library symbols. Applying a pattern of 000.000 will place leading and trailing zeros even if there is not a number present.  This would transform the number 32.38 to output as 032.380.  However, this is most likely not the desired result you are looking for.  To remove the leading and trailing zeros, apply the pattern in step 3 below.

 

Number_Formatting3.png

 

  1. Applying a format pattern of ###.000 will remove the leading zero as the symbol # will print a number if present but if not it will not print a number.  The pattern will tranform the number 32.38 to output 32.380.

 

Number_Formatting4.png

Additional Notes

Internationalization (I18N) Note: The number format always uses a comma (,) for the thousand separator and a period (.) for the decimal separator. These are replaced with the characters for the default locale-specific settings of the computer generating the output. This allows a single format setting to be used by all locales.