Add a Data Format to a Locale

You can modify the cogformat.xml file to add data formats. For example, you may want to add a time format that is not included for your locale.

You must use valid syntax when adding a data format.

You can use Report Studio to show you the XML code that you need for a data format. In Report Studio, create a list report that contains the data that you want. Then, select the column and change the Data Format settings in the Report Studio Properties pane to get the format you want. It is a good idea to run the report to make sure the data format looks the way you want it to. Select View XML and use the same code syntax in the cogformat.xml file. (For an XML file that you can copy and paste from, follow instructions to Open and Save a Report Locally.)

For example, if you want to add a data format for date, create a report that contains a date column. Change the format of the date. Use the appropriate XML code syntax in the cogformat.xml file.

Your syntax might look similar to the bold code shown below:

<formatList name="qsdates" xml:lang="en-CA">
  <dateFormat dateStyle="short" datesSeparator="."
  </dateFormat>
  <dateFormat dateStyle="full">Friday, December 19,
2003</dateFormat>
  <dateFormat dateStyle="short">19/12/03</dateFormat>
  <dateFormat dateStyle="medium">19-Dec-03</dateFormat>
  <dateFormat dateStyle="long">December 19, 2003</dateFormat>
</formatList>

Procedure

  1. In the cogformat.xml file, locate the data format for the locale that you want to modify. For example, the following XML code defines time formats for the en-CA (English Canadian) locale:
    ...
    <formatList name="qstimes" xml:lang="en-ca">
      <timeFormat timeStyle="short">1:30 PM</timeFormat>
      <timeFormat timeStyle="medium">1:30:55 PM</timeFormat>
      <timeFormat timeStyle="long">1:30:55 EST PM</timeFormat>
      <timeFormat timeStyle="full">1:30:55 o&apos;clock
    PM EST</timeFormat>
    </formatList>...
  2. To add another time format, add another XML code line. For example, to add the time format "1:30 EST PM", add the following line:
    <timeFormat timeStyle="long" showSeconds="false">1:30
    EST PM</timeFormat>
  3. Insert the text that you want to appear in Query Studio into the line you copied and pasted. For example:
    <dateFormat dateStyle="short" dateSeparator="."
    show Years="showCentury">19.12.03</dateFormat>