The two strings entered in the Connection string and Query fields of the Free-Form Report Details page are sufficient for generating a free-form report. However, the flexibility and utility of the report can be enhanced greatly by adding parameters to the default XML file contained in the Parameters field. Once all parameters have been defined, a pop-up window for entering values for those parameters when generating the report displays.
The default XML file is as follows:
<custom>
<connection>
<params>
<!--<param name='@UID' disp_name='User id' type='TEXT' size='10'><value>user id</value></param>- >
<!--<param name='@PWD' disp_name='Password' type='PASSWORD' size='10'><value>password</value></param>- >
</params>
</connection>
<query>
<params>
<!--<param name='@PRM1' disp_name='PARAM 1' type='TEXT' size='10'><value>param1 value</value></param>- >
<!--<param name='@PRM2' disp_name='PARAM 2' type='LIST'><value>value 1</value><list><item><value>value 1</value><text>text 1</text></item><item><value>value 2</value><text>text 2</text></item></list></param>- >
<!--<param name="@PRM3" disp_name="PARAM 3" type="LIST">
<value>value</value>
<list>
<list_query>select customer_id value, customer_name text from t_customers</list_query>
</list>
</param>- >
</params>
</query>
<pdf>
<!--<option><name>pameter name</name><value>parameter value</value></option>- >
</pdf>
<chart>
<!--<precision>Numeric value from 0 to 5</precision>- >
</chart>
<!--<ContainsHTML>0/1</ContainsHTML>- >
<!--<headstyle>
<titlerow bgcolor="value or color name"></titlerow>
<firstcolumn bgcolor="value or color name"></firstcolumn>
</headstyle>
</custom>
The XML file contains the following main sections:
<connection>: Contains connection information for the database being queried
<query>: Contains the SQL query
<pdf>: Contains PDF printing options for the output, such as paper size, orientation and so on
Each parameter within the <connection> and <query> has its own <param> node that includes the following attributes:
name: The name of the parameter.
disp_name: The name of the parameter as it appears in the pop-up window.
type: The parameter type, which can be one of the following:
TEXT: Text input
PASSWORD: Text displayed as asterisks
DATE: Calendar field
LIST: Drop-down list with multiple selections
list_query: Drop-down list with multiple selections enabling dynamic list of values. For example:
<list>
<list_query>select some_value value, some_text text from some_table</list_query>
</list>
Note: The select statement should always contain two columns, one for value and one for the display text.
size: The maximum number of characters allowed in the input field.
The parameters within the <pdf> have the following attributes:
name: The name of the parameter
value: The value of the parameter
|
Copyright © 2012 CA.
All rights reserved.
|
|