Difference between revisions of "Criteria Template"

From SmartWiki
Jump to: navigation, search
Line 20: Line 20:
  
 
Note also that the @submitbutton@ and @exportbutton@ variables in the new ''Criteria Template'' expose the ''Submit'' and ''Export'' buttons on the page.
 
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==
 
==Variables==

Revision as of 10:10, 16 May 2014

The Criteria Template section on the Report Template tab of the Edit Report Page defines the criteria section of a custom report template containing the prompt(s) for report parameter(s) when report criteria are used.

When the Criteria Template is used, the report parameter prompt does not manifest as a pop-up when the report is run, but remains at the top of the page.

Example: Our report prompts the user for two criteria:
CriteriaTemplate-CriteriaSetInReport.png

When we run the report, we see the following criteria prompt:
CriteriaTemplate-DefaultCriteria.png

However, we want to make the First Name parameter default to the current user's first name. For this we need to build a custom Criteria Template.

In the Edit Report Page, we switch to the Report Template tab and enter the following in the Criteria Template section:
CriteriaTemplate-SampleCriteriaTemplate.png

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.
CriteriaTemplate-RevisedCriteria.png

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:
CriteriaTemplate-ChangeLabels.png


Variables

To show certain buttons on the criteria page, you can reference variables in the Criteria Template:

  • @submitbutton@
  • @exportbutton@
  • @fileexportbutton@

For reports containing multiple criteria, the variable syntax for the different criteria elements is argn 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

Notes

  • The Criteria template is not rebuilt when the report is rebuilt.

See Also