Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

SectionConfiguration and Access InformationExamples
Expressions
NameConfigurationComments
PrefixDefault is #This value is required
SuffixDefault is #This value is required

Both will help to identify in the template pieces of text that are expected to be replaced with data.

If you stick  with the default values, then everything that is between the # character will be replaced:

#myDataset.myValue#

You can change to the Suffix and Prefix to be an character, for example the $ character, then you should be able to access your data in your template this way:

$myDataset.myValue$

Repeating Sections

The output data of your report might have rows and columns of information instead of just having one single value. If this is your case, then you should configure Repeating Sections to access all of your rows and/or columns.

As a side note, if the data of your report has a lot of rows and columns, might be possible that the XLS Report Renderer  is more suitable for you.

The following options literally mean if a sheet | row | column should be repeated in a template.

NameConfigurationComments
SheetNumber of the sheet to be repeated.This option should be a number and not the name of the sheet.
RowNumber or range of numbers separated with a dash that indicates the rows to be repeated. 
ColumnNumber or range of numbers separated with a dash that indicates the columns to be repeated. 
DatasetName of the Data Set the sheet | row | column option should work with.if you work with any of the options above, you should explicitly indicate which Data Set should be used to render and which sheet for the row and column options.

For the following examples let's assume that our report output the following table using the encountersByType key as name for the Data Set Definition:

Option NameWhat we wantWhat our template should haveWhat our configuration should haveWhat to expect
SheetA sheet for each type of Encounter.
RowOne row in our template for each row in the output data.

We only want to repeat the row number 5, if we want to repeat also the heading of the row ( Type and Num ) then we should indicate this in our configuration by typing 4-5 instead of 5.

Notice that along with the row number we should indicate the sheet number, even if we don't want the output shown in the sheet example.

ColumnOne column in our template for each type.
Designing Properties

You can define any key-value property that your template might need.

NameConfigurationComments
KeyTo identify the property.In the template you can access any property by suffixing its key to the word "property".
ValueValue for the property defined. 
What we wantWhat our template should haveWhat our configuration should haveWhat to expect
Define a property named "customReportTitle" that contains a title for my report.
Miscellaneous
  • About Indicator Data Set Definition:
    • if the output data of your report contains only a single Data Set Definition of type Indicator then its values can be accessed via its indicator number. For example: #1.A#.
    • But If if the report contains multiple Data Set Definitions then indicator values must be prefixed with the Data Set Definition name.  For example: #myDataSet.1.A#
    • Since Reporting 0.7.2.2 you can specify the number of trailing digits. Assume an Indicator Data Set Definition whose output is single value(5 for this example):

      AddOutput
      #1.A|0#5
      #1.A|1#5.0
      #1.A|2#5.00
      #1.A|3#5.000
  • Parameters:
    • Every parameter to the report is available by its name prefixed with the word "parameter". Additionally, if this parameter is of type date you can formatted the output by adding a Java date and time patter String:

      AssumeIn the templateExpected output
      A date whose key value is "endDate" is asked to the user.
      Without any format:
      With a Java date and time patter:
  • Contextual information:

    VariableDescription
    #context.generatedBy#Contains the name of the user who generated the report. In some setups, this will be the default scheduled program user.
    #context.generationDate#Contains the date on which the report was generated and can be formatted as a parameter of type date.

     

     

...

  • Handles multiple data set definitions.
  • Handles templates with scripting in Groovy an and Velocity.
1Select HTML/text-based template option from the drop-down list and click on the Add another button.
2

Only the description field is optional. Let's assume a Data Set Definition that can be accessed with the name "encountersByTypeByGender" and the following template.

Code Block
languagehtml/xml
linenumberstrue
<?xml version="1.0"?>
<dataset>
    <rows>
        <%     
            dataset = reportData.dataSets.get("encountersByTypeByGender");
            for (row in dataset) { 
        %>
            <row>
                <% 
                    for (column in dataset.metaData.columns) { 
                        colValue = row.getColumnValue(column);
                        colValue = (colValue instanceof java.util.Date) ? util.format(colValue, 'dd/MMM/yyyy') : util.format(colValue);
                %>
                    <$column.label>$colValue</$column.label>
                <% 
                     }
                %>
            </row>
        <% 
            }
        %>
    </rows>
</dataset>



3If you run your report, the new added design will appear as an output option of the Report Definition you previously linked it to and it will be added to the list displayed on the Report Designs Manager page as well.
4The expected output is a text file, an XML in this example.

...