Difference between revisions of "Including Criteria in ReportProperty"
From SmartWiki
Line 50: | Line 50: | ||
* Do not use single quotes to encapsulate criteria. | * Do not use 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 viewed on-demand. | * 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 viewed on-demand. | ||
− | * [Read Only]] fields with ReportProperty should '''never''' be included in list view. | + | * [[Read Only]] fields with ReportProperty should '''never''' be included in list view. |
Revision as of 10:02, 25 April 2016
This article describes the syntax used with the ReportProperty variable in order to pass parameters to a report to be used as report criteria.
Contents
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)
- 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
- Do not use 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 viewed on-demand.
- Read Only fields with ReportProperty should never be included in list view.