Report Variables

From SmartWiki
Revision as of 15:30, 18 May 2010 by Cameron (talk | contribs)

Jump to: navigation, search

This article describes the Variables that can be used to display Reports, or properties of reports.

For details on Variables that can be used when creating reports see Using Variables in the Report Builder.


Syntax

@ReportProperty(reportid,property)@


Where:

  • 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


Record Count

recordcount can be used:


Examples:

  • To generate the number of records (equivalent to the number of rows in the report) for report with ID 12345
@ReportProperty(12345,recordcount)@


  • To display the number of records at a given status in a Portal Icon:
CMPortal.png

Will display as:

PIcon.png


Important: The recordcount property does not work if your Report includes Group By. It can only be used to count the records in a report based on filtered criteria.


Export Data

When using the Exportdata report variable, the variable will be replaced with data from the specified report, in the format defined by the advance export template.

@ReportProperty(reportid,exportdata)@


The exportdata variable can be used in a Web Page View or Read Only - System Variables custom field, or be included in the body of a Workflow message.

Most often exportdata is used with report export settings defined as HTML.

Example: To display the exported report for the report with ID 12345

@ReportProperty(12345,exportdata)@


CSV Data

When using the csvdata report variable, the variable will be replaced with data from the specified report, as comma separated values.

@ReportProperty(reportid,csvdata)@


The csvdata variable can be used in a Web Page View or Read Only - System Variables custom field, or be included in the body of a Workflow message.


csvdata is most often used within the body of a plain-text workflow e-mail.

When using the csvdata variable the header and footer defined on the Report Export page will be used.


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.