Difference between revisions of "Prompting for Criteria in Reports"

From SmartWiki
Jump to: navigation, search
(Using the Same Criteria Multiple Times)
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{SeqReportPageHeader}}
 +
 
You can prompt the person that runs the report for the criteria, by replacing the criteria string with three question marks - '''???'''.
 
You can prompt the person that runs the report for the criteria, by replacing the criteria string with three question marks - '''???'''.
  
Line 7: Line 9:
 
2. Click the '''Edit''' button.
 
2. Click the '''Edit''' button.
  
3. Click the '''Report Builder''' tab.
+
3. Click the '''[[Report Builder]]''' tab.
  
4. Click the [[SmartSimple]] '''Special Criteria Values''' tab.
+
4. Open the Report Builder Help Panel and click on the '''[[Report Builder Column Settings|Special SmartSimple Criteria Values]]''' tab.
  
[[Image:Reps38.png]]
+
[[Image:ReportBuilderHelp-SSCriteriaValues.PNG|link=]]
 
   
 
   
There are three special functions displayed.
+
There are four special functions displayed.
 +
 
 +
:{| border="1" cellpadding="5"
 +
|+
 +
!Function!!Purpose
 +
|+
 +
|???||Prompts the user for an input value. You can combine this string with any other selection operator. You can use ??? multiple times in the same report.
 +
|+
 +
|@userid@||Uses the current [[userid]] as the criteria. This is useful when you need to create a generic report that displays all the records for the user running the report.
 +
|+
 +
|@companyid@||Uses the current user's [[companyid]] as the criteria. This is useful when you need to create a generic report that displays all the records for the user running the report.
 +
|+
 +
|@objectid@||When using [[Report Variables|ReportProperty]], the object ID (opportunityid, eventid, userid, etc., depending on the [[entity]] being reported upon) will be passed to the report processor.
 +
|}
 +
 
 +
* To allow the user to enter multiple values to be matched against the same field enter '''REGEXP ???''' in the Criteria of the report builder.
 +
::* When prompted a list of values to be filtered on can be entered, delimited by pipes. I.E: '''This|That|The Other'''
  
[[Image:Reps34.png]]
 
  
 
5. Replace the current criteria with the criteria shown below:
 
5. Replace the current criteria with the criteria shown below:
Line 21: Line 38:
 
[[Image:Reps39.png]]
 
[[Image:Reps39.png]]
 
   
 
   
6. Click the '''Build Query''' button.
+
6. Click the {{BuildQueryButton}} button.
  
7. Click the '''Save''' button.
+
7. Click the {{SaveButton}} button.
  
8. Click the '''Preview''' button.
+
8. Click the {{PreviewButton}} button.
  
 
The '''Criteria Prompt''' window is displayed.
 
The '''Criteria Prompt''' window is displayed.
Line 39: Line 56:
 
11. '''Close''' the current report.
 
11. '''Close''' the current report.
  
[[Category:Reports]]
+
==Using the Same Criteria Multiple Times==
 +
You might want to build a report that uses the same criteria multiple times. For example, a report can prompt the user to enter a date value:
 +
 
 +
[[Image:ReportsPromptingForDate.png|link=]]<br />
 +
When the report is run, the user will be prompted to select a date value:<br />
 +
[[Image:ReportsPromptingForDatePrompt.png|link=]]<br />
 +
But if the report should display all grants where the date specified is the ''Start Date'' OR the ''Approval Date'', the report would be configured as follows:<br />
 +
[[Image:ReportsPromptingForTwoDates.png|link=]]<br />
 +
This would result in two prompts unnecessarily being displayed to the user:<br />
 +
[[Image:ReportsPromptingForTwoDatesPrompt.png|link=]]<br />
 +
The solution is to use the ''@arg1@'' syntax. Entering ''=@arg1@'' as the second criteria will mean that the system will re-use the user-entered criteria for two comparisons:<br />
 +
[[Image:ReportsPromptingForTwoDatesUsingArg1.png|link=]]
 +
 
 +
{{MultipleCriteriaVariableSyntax}}
 +
 
 +
==See Also==
 +
* [[Passing Prompt Criteria to a Sub-Report]]
 +
* [[Criteria Template]]
 +
 
 +
{{PrevNextStart}} [[Specifying Multiple Criteria in Reports]]
 +
{{PrevNextMid}} [[Prompting for a Criteria using a Wildcard]] {{PrevNextEnd}}
 +
 
 +
 
 +
[[Category:Reports]][[Category:Criteria]]

Latest revision as of 13:35, 8 December 2014

caption Click here to watch a video on SmartSimple's integrated reporting subsystem.

You can prompt the person that runs the report for the criteria, by replacing the criteria string with three question marks - ???.

1. Make a new copy of the current report named – Prompt for Title.

Reps37.png

2. Click the Edit button.

3. Click the Report Builder tab.

4. Open the Report Builder Help Panel and click on the Special SmartSimple Criteria Values tab.

ReportBuilderHelp-SSCriteriaValues.PNG

There are four special functions displayed.

Function Purpose
??? Prompts the user for an input value. You can combine this string with any other selection operator. You can use ??? multiple times in the same report.
@userid@ Uses the current userid as the criteria. This is useful when you need to create a generic report that displays all the records for the user running the report.
@companyid@ Uses the current user's companyid as the criteria. This is useful when you need to create a generic report that displays all the records for the user running the report.
@objectid@ When using ReportProperty, the object ID (opportunityid, eventid, userid, etc., depending on the entity being reported upon) will be passed to the report processor.
  • To allow the user to enter multiple values to be matched against the same field enter REGEXP ??? in the Criteria of the report builder.
  • When prompted a list of values to be filtered on can be entered, delimited by pipes. I.E: This|That|The Other


5. Replace the current criteria with the criteria shown below:

Reps39.png

6. Click the Buildquery.PNG button.

7. Click the SaveButton.PNG button.

8. Click the PreviewButton.PNG button.

The Criteria Prompt window is displayed.

Reps40.png

9. Type President.

10. Click the View Report button.

Only records matching the entered criteria are displayed.

11. Close the current report.

Using the Same Criteria Multiple Times

You might want to build a report that uses the same criteria multiple times. For example, a report can prompt the user to enter a date value:

ReportsPromptingForDate.png
When the report is run, the user will be prompted to select a date value:
ReportsPromptingForDatePrompt.png
But if the report should display all grants where the date specified is the Start Date OR the Approval Date, the report would be configured as follows:
ReportsPromptingForTwoDates.png
This would result in two prompts unnecessarily being displayed to the user:
ReportsPromptingForTwoDatesPrompt.png
The solution is to use the @arg1@ syntax. Entering =@arg1@ as the second criteria will mean that the system will re-use the user-entered criteria for two comparisons:
ReportsPromptingForTwoDatesUsingArg1.png

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.

  • @argn.label@ returns the text label of the input
  • @argn@ returns the input field for the criteria
  • @argn.id@ returns the element ID of the input

See Also




Previous.png Specifying Multiple Criteria in Reports Prompting for a Criteria using a Wildcard Next.png