Difference between revisions of "Including Criteria in ReportProperty"

From SmartWiki
Jump to: navigation, search
(Created page with 'This article describes the syntax used with the ReportProperty variable in order to pass parameters to a report to be used as report criteria. ==Sy…')
 
 
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This article describes the syntax used with the ReportProperty [[Variables|variable]] in order to pass [[Parameter|parameters]] to a report to be used as report criteria.
+
This article describes the syntax used with the [[ReportProperty]] [[Variables|variable]] in order to pass [[Parameter|parameters]] to a report to be used as report [[:Category:Criteria|criteria]].
  
  
  
 
==Syntax for passing static parameters to a report==
 
==Syntax for passing static parameters to a report==
:<font size=3>@ReportProperty(''reportid'',''property'',,"''criteria''")@</font>
+
: <span style="font-size: medium;">@ReportProperty(''reportid'',''property'',,"''criteria''")@</span>
 +
'''Where:'''
  
'''Where:'''
+
* ''reportid'' is the system ID for the report (see [[Determining the reportid]]). The ReportProperty syntax also supports the Report Name, but you must ensure the Report Name does not include any special characters.
* ''reportid'' is the system ID for the report (see [[Determining the reportid]])
 
 
* ''property'' can be:
 
* ''property'' can be:
:* '''recordcount''' - Count of the number of records within a specified report  
+
** '''recordcount''' - Count of the number of records within a specified report
:* '''csvdata''' - Report data, with each field separated by commas
+
** '''csvdata''' - Report data, with each field separated by commas
:* '''exportdata'''- Report data, formatted as defined in the [[Exporting Reports|Advanced Export]] settings of the Report  
+
** '''exportdata''' - Report data, formatted as defined in the [[Exporting Reports|Advanced Export]] settings of the Report
* ''criteria'' is the  
+
* ''criteria'' is the answer to the ??? in the report referenced by the reportid
  
 +
'''Example''':
  
 +
* The report with reportid 12345 has a [[Prompting for Criteria in Reports|criteria]] on a date field of "=???"
 +
* To generate the number of records in the report with a date of 2009-10-26:
  
'''Examples''':
+
  @ReportProperty(12345,recordcount,,"2009-10-26")@
* To generate the number of records (equivalent to the number of rows in the report) for report with ID 12345
 
  @ReportProperty(12345,recordcount)@
 
  
 +
==Syntax for dynamic parameters to a report==
 +
: <span style="font-size: medium;">@ReportProperty2(''reportid'',''property'',,"''@criteria@''")@</span>
  
==Syntax for dynamic static parameters to a report==
+
'''Where:'''
:<font size=3>@ReportProperty2(''reportid'',''property'',,"''criteria''")@</font>
 
  
 +
* ''reportid'' is the system ID for the report (see [[Determining the reportid]])
 +
* ''property'' can be:
 +
** '''recordcount''' - Count of the number of records within a specified report
 +
** '''csvdata''' - Report data, with each field separated by commas
 +
** '''exportdata'''- Report data, formatted as defined in the [[Exporting Reports|Custom Export]] settings of the Report
 +
* ''criteria'' is the variable that returns the answer to the ??? in the report referenced by the reportid
  
 +
==Syntax for passing multiple parameters to a report==
 +
: <span style="font-size: medium;">@ReportProperty2(''reportid'',''property'',,"@''criteria1''@::@''criteria2''@")@</span>
 
'''Where:'''
 
'''Where:'''
 +
 
* ''reportid'' is the system ID for the report (see [[Determining the reportid]])
 
* ''reportid'' is the system ID for the report (see [[Determining the reportid]])
 
* ''property'' can be:
 
* ''property'' can be:
:* '''recordcount''' - Count of the number of records within a specified report  
+
** '''recordcount''' - Count of the number of records within a specified report
:* '''csvdata''' - Report data, with each field separated by commas
+
** '''csvdata''' - Report data, with each field separated by commas
:* '''exportdata'''- Report data, formatted as defined in the [[Exporting Reports|Advanced Export]] settings of the Report  
+
** '''exportdata'''- Report data, formatted as defined in the [[Exporting Reports|Advanced Export]] settings of the Report
* ''criteria'' is the  
+
* ''criteria1'', ''criteria2'', etc. are the variable that returns the answer to the ??? prompts in the report referenced by the reportid. ''Criteria1'' is matched against the first instance of the ??? prompt in the [[Report Builder]], ''criteria2'' is matched against the second instance, etc., working from left to right.
  
 +
'''Example''':
  
 +
* The report with reportid 12345 has [[Prompting for Criteria in Reports|criteria]] on a date field of ">=???" and "<=???"
 +
* To generate the number of records in the report with a date range of startdate to enddate:
  
==Syntax for passing multiple parameters to a report==
+
@ReportProperty2(12345,exportdata,,"@fullstartdate@::@fullenddate@")@
:<font size=3>@ReportProperty(12345,exportdata,,”criteria1”::”criteria2”)@</font>
+
 
or
+
==Notes==
:<font size=3>@ReportProperty2(''reportid'',''property'',,"''criteria''")@</font>
 
  
 +
* Use double quotes, not single quotes, to encapsulate criteria.
 +
* Note that if the ReportProperty variable is used in a Custom Field the report will be run every time the record is opened. Therefore, use this functionality sparingly or server performance may be impacted. Consider putting the ReportProperty onto a [[Custom Field Type: Display Only – Web Page View|web page view]] on the record, so it can be executed/viewed on-demand.
 +
* [[Read Only - System Variable|Read Only]] fields with ReportProperty should '''never''' be included in [[List View]]s. (All Read Only fields should be avoided when creating [[List Views]])
  
==Notes==
 
* When using any of the ReportProperty variables (recordcount, exportdata and csvdata) the object ID ([[opportunityid]], [[eventid]], [[userid]], etc) will be passed to the report processor. If the specified report includes the variable: '''@''objectid''@''', it will be replaced by the object ID of whichever object (Level 1, Level 2, Contact, etc) called the ReportProperty attribute.
 
  
  
 
==See Also==
 
==See Also==
 
* [[Using Variables in the Report Builder]]
 
* [[Using Variables in the Report Builder]]
* [[Reportproperty]]
+
* [[Reportproperty|Report Variables]]
 
* [[Passing Values Using Parameters]]
 
* [[Passing Values Using Parameters]]
 
* [[Prompting for Criteria in Reports]]
 
* [[Prompting for Criteria in Reports]]
  
[[Category:Variables]][[Category:Reports]]
+
[[Category:Variables]][[Category:Reports]][[Category:Criteria]]

Latest revision as of 15:55, 5 April 2022

This article describes the syntax used with the ReportProperty variable in order to pass parameters to a report to be used as report criteria.


Syntax for passing static parameters to a report

@ReportProperty(reportid,property,,"criteria")@

Where:

  • reportid is the system ID for the report (see Determining the reportid). The ReportProperty syntax also supports the Report Name, but you must ensure the Report Name does not include any special characters.
  • property can be:
    • recordcount - Count of the number of records within a specified report
    • csvdata - Report data, with each field separated by commas
    • exportdata - Report data, formatted as defined in the Advanced Export settings of the Report
  • criteria is the answer to the ??? in the report referenced by the reportid

Example:

  • The report with reportid 12345 has a criteria on a date field of "=???"
  • To generate the number of records in the report with a date of 2009-10-26:
@ReportProperty(12345,recordcount,,"2009-10-26")@

Syntax for dynamic parameters to a report

@ReportProperty2(reportid,property,,"@criteria@")@

Where:

  • reportid is the system ID for the report (see Determining the reportid)
  • property can be:
    • recordcount - Count of the number of records within a specified report
    • csvdata - Report data, with each field separated by commas
    • exportdata- Report data, formatted as defined in the Custom Export settings of the Report
  • criteria is the variable that returns the answer to the ??? in the report referenced by the reportid

Syntax for passing multiple parameters to a report

@ReportProperty2(reportid,property,,"@criteria1@::@criteria2@")@

Where:

  • reportid is the system ID for the report (see Determining the reportid)
  • property can be:
    • recordcount - Count of the number of records within a specified report
    • csvdata - Report data, with each field separated by commas
    • exportdata- Report data, formatted as defined in the Advanced Export settings of the Report
  • criteria1, criteria2, etc. are the variable that returns the answer to the ??? prompts in the report referenced by the reportid. Criteria1 is matched against the first instance of the ??? prompt in the Report Builder, criteria2 is matched against the second instance, etc., working from left to right.

Example:

  • The report with reportid 12345 has criteria on a date field of ">=???" and "<=???"
  • To generate the number of records in the report with a date range of startdate to enddate:
@ReportProperty2(12345,exportdata,,"@fullstartdate@::@fullenddate@")@

Notes

  • Use double quotes, not single quotes, to encapsulate criteria.
  • Note that if the ReportProperty variable is used in a Custom Field the report will be run every time the record is opened. Therefore, use this functionality sparingly or server performance may be impacted. Consider putting the ReportProperty onto a web page view on the record, so it can be executed/viewed on-demand.
  • Read Only fields with ReportProperty should never be included in List Views. (All Read Only fields should be avoided when creating List Views)


See Also