Changes

Jump to: navigation, search

Criteria Template

7 bytes added, 18:17, 8 December 2014
Variables
''Example'': Our report prompts the user for two criteria:<br />
[[Image:CriteriaTemplate-CriteriaSetInReportCriteriaSetInReportSimple.png|link=]]
When we run the report, we see the following criteria prompt:<br />
In the [[Creating a Basic Report|Edit Report Page]], we switch to the [[Report Template]] tab and enter the following in the ''Criteria Template'' section:<br />
 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><table> <tr> <th class=Sub> @arg1.label@ </th> <td> @arg1@ </td> </tr> <tr> <th class=Sub> @arg2.label@ </th> <td> <input type=text id=@arg2.id@ name=@arg2.id@ value="@me.firstname@"> </td> </tr> <tr> <td colspan=2 class=Submit> @submitbutton@ @exportbutton@ </td> </tr></table></pre><!--[[Image:CriteriaTemplate-SampleCriteriaTemplate.png|link=]]-->
Notice that the first criteria is left unchanged. The second criteria is where we create our own HTML input element and define it as the second criteria. The ''value'' is defaulted to the user's first name.<br />
Note also that the @submitbutton@ and @exportbutton@ variables in the new ''Criteria Template'' expose the ''Submit'' and ''Export'' buttons on the page.
 
By changing ''@arg1.label@'' and ''@arg2.label@'' in the ''Criteria Template'' to ''Enter Record Name:'' and ''First Name:'' respectively, we can change the labels that show in the criteria prompt:<br />
[[Image:CriteriaTemplate-ChangeLabels.png|link=]]
 
==Variables==
* @fileexportbutton@
For reports containing multiple criteria, the variable syntax for the different criteria elements is arg''n'' where ''n'' is the order of the criteria defined in the [[Report Builder]]. * @arg1.label@ returns the text label of the input* @arg1@ returns the input field for the criteria* @arg1.id@ returns the element ID of the input{{MultipleCriteriaVariableSyntax}}
==Notes==
8,849
edits

Navigation menu