Previous Topic: Queries

Next Topic: Document Type Definition


Parameters

A report definition can have a corresponding list of required parameters, which is stored elsewhere in prefix2/nm/reporter/usr/prompts/report-name.txt. There must be a corresponding <prompt> tag for each parameter. Where parameters are related to each other, they can be grouped by using the group attribute in the <prompt> tag. This attribute causes ReportCenter to check that the values chosen by the user are compatible with each other.

Examples: Parameters

<prompt name="System" group="SystemNameGroup">
<prompt name="Sysplex" group="SystemNameGroup">
<prompt name="Timeframe">

The first prompt is called the report's criteria and is used to help identify one instance of a report from another.

Within a group, the sequence of the prompts is important—it must match what is in the prompts file.

When a report is run, ReportCenter provides a value for each of these parameters. The parameter names and the parameter values are text strings.

You can substitute the value of a parameter into a <query> tag or into the report's <subtitle> tag by including a <parm> tag in the text of the query or subtitle. The <parm> tag requires a 'name' attribute, but has no other content.

Parameter names are case-sensitive. So, <parm name="TimeFrame" /> and <parm name="timeframe" /> are not the same.

You can substitute the value of a parameter into a <query> or the <subtitle> of the report by including a <parm> tag in the query or subtitle. The <parm> tag must have a name attribute.

Example: Parameter Substitution

<query>
   select * from <databasename/>.period 
   where pLevel = '<parm name="periodLevel" />'
</query>

After substitution, this may become:

select * from mydatabase.period where pLevel = 'DAILY'

The prompts file should contain an entry for each distinct name used in any <parm> tag. When a report is run, every parameter must have a value (even if only an empty string); otherwise, the report generator rejects the request.

Time Frames

Many reports operate over a selected time frame. Some special processing is included to support this. If the report's parameter list contains a parameter named Timeframe, ReportCenter creates some extra time frame related parameters and gives them values that correspond to the value of the Timeframe parameter. The extra, automatically created, parameters are StartRelativeDay, EndRelativeDay, StartDate, EndDate, and PeriodLevel. You can use these in a <parm> tag, like any other parameter.

Example: Time Frames

If today is 31 December 2007 and a report needs a Timeframe parameter with the value LAST 7 DAYS, then at the start of processing the report, the following parameters are created:

StartRelativeDay=11316
EndRelativeDay=11322
StartDate=2007-12-24
EndDate=2007-12-30
PeriodLevel=DAILY