Difference between revisions of "Report Variables"

From SmartWiki
Jump to: navigation, search
 
(4 intermediate revisions by 3 users not shown)
Line 5: Line 5:
  
 
==Syntax==
 
==Syntax==
:<font size=3>@ReportProperty(''reportid'',''property'')@</font>
+
: <span style="font-size: medium;">@ReportProperty(''reportid'',''property'')@</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|Custom Export]] settings of the Report
:* '''exportrawdata''' - Report data, without any formatting  
+
** '''exportrawdata''' - Report data, without any formatting
 +
 
 +
'''Note:'''
 +
 
 +
*:* ''ReportProperty'' is case sensitive. Using ''reportproperty'' will not work.
  
'''Note:'''
+
*
:* ''ReportProperty'' is case sensitive. Using ''reportproperty'' will not work.
+
===Using ReportProperty on reports with a Group By===
:* In order to use a ReportProperty on a report which has a group by clause, you need to add a distinct clause to the ReportProperty syntax.
+
 
 +
*:* In order to use a ReportProperty on a report which has a group by clause, you need to add a distinct clause to the ReportProperty syntax.
 +
 
 +
*
 
  @ReportProperty(''reportid'',''property'',distinct(''fieldname''))@
 
  @ReportProperty(''reportid'',''property'',distinct(''fieldname''))@
 
  Example: If a report is grouped by the tracking id, then your ReportProperty syntax would be
 
  Example: If a report is grouped by the tracking id, then your ReportProperty syntax would be
  @ReportProperty(''reportid'',''property'',distinct(op.opportunityid))@
+
  @ReportProperty(''reportid'',''property'',distinct(opportunityid))@
 
 
  
 
You can also pass '''criteria''' into the ReportProperty call. See [[Including Criteria in ReportProperty]].
 
You can also pass '''criteria''' into the ReportProperty call. See [[Including Criteria in ReportProperty]].
Line 28: Line 34:
 
==Record Count==
 
==Record Count==
 
'''recordcount''' can be used:
 
'''recordcount''' can be used:
:* In a [[Web Page View]] or as a [[Custom Field Type: Read Only – System Variables|Read Only - System Variable]] to display a record count
 
:* As part of [[Submit Logic]] to ensure a certain condition is met prior to submission of a record.
 
:* Included in the title of a [[Portal]] shortcut to indicate how many records are at a given status (for example)
 
  
 +
*:* In a [[Web Page View]] or as a [[Custom Field Type: Read Only – System Variables|Read Only - System Variable]] to display a record count
 +
*:* As part of [[Submit Logic]] to ensure a certain condition is met prior to submission of a record.
 +
*:* Included in the title of a [[Portal]] shortcut to indicate how many records are at a given status (for example)
  
'''Examples''':  
+
*
* To generate the number of records (equivalent to the number of rows in the report) for report with ID 12345
+
 
 +
'''Examples''':
 +
 
 +
** To generate the number of records (equivalent to the number of rows in the report) for report with ID 12345
 
  @ReportProperty(12345,recordcount)@
 
  @ReportProperty(12345,recordcount)@
  
  
* To display the number of records at a given status in a Portal Icon:
+
** To display the number of records at a given status in a Portal Icon:
:[[Image:CMPortal.png]]
+
*: [[Image:CMPortal.png]]
 
+
*
 
Will display as:
 
Will display as:
:[[Image:PIcon.png]]
 
  
 +
*: [[Image:PIcon.png]]
 +
*
  
  
 
==CSV Data==
 
==CSV Data==
 
When using the '''csvdata''' report variable, the variable will be replaced with data from the specified report, as comma separated values.
 
When using the '''csvdata''' report variable, the variable will be replaced with data from the specified report, as comma separated values.
:<font size=3>@ReportProperty(''reportid'',csvdata)@</font>
 
  
 +
*: <span style="font-size: medium;">@ReportProperty(''reportid'',csvdata)@</span>
 +
*
  
 
''The csvdata variable can be used in a [[Web Page View]] or [[Custom Field Type: Read Only – System Variables|Read Only - System Variables]] custom field, or be included in the body of a [[Workflow]] message.''
 
''The csvdata variable can be used in a [[Web Page View]] or [[Custom Field Type: Read Only – System Variables|Read Only - System Variables]] custom field, or be included in the body of a [[Workflow]] message.''
Line 58: Line 69:
  
 
==Export Data==
 
==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.
+
When using the Exportdata report variable, the variable will be replaced with data from the specified report, in the format defined by the custom export template.
:<font size=3>@ReportProperty(''reportid'',exportdata)@</font>
 
  
 +
*: <span style="font-size: medium;">@ReportProperty(''reportid'',exportdata)@</span>
 +
*
  
 
''The exportdata variable can be used in a [[Web Page View]] or [[Custom Field Type: Read Only – System Variables|Read Only - System Variables]] custom field, or be included in the body of a [[Workflow]] message.''
 
''The exportdata variable can be used in a [[Web Page View]] or [[Custom Field Type: Read Only – System Variables|Read Only - System Variables]] custom field, or be included in the body of a [[Workflow]] message.''
Line 69: Line 81:
 
==Export Raw Data==
 
==Export Raw Data==
 
When using the Exportrawdata report variable, the variable will be replaced with data from the specified report, without any formatting applied.
 
When using the Exportrawdata report variable, the variable will be replaced with data from the specified report, without any formatting applied.
:<font size=3>@ReportProperty(''reportid'',exporteawdata)@</font>
 
  
 +
*: <span style="font-size: medium;">@ReportProperty(''reportid'',exportrawdata)@</span>
 +
*
  
 
''The exportrawdata variable can be used in a [[Web Page View]] or [[Custom Field Type: Read Only – System Variables|Read Only - System Variables]] custom field, or be included in the body of a [[Workflow]] message.''
 
''The exportrawdata variable can be used in a [[Web Page View]] or [[Custom Field Type: Read Only – System Variables|Read Only - System Variables]] custom field, or be included in the body of a [[Workflow]] message.''
  
 +
==Notes==
  
==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.
* 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==
* [[Including Criteria in ReportProperty]]
+
** [[Including Criteria in ReportProperty]]
* [[Using Variables in the Report Builder]]
+
** [[Using Variables in the Report Builder]]
 
 
 
[[Category:Variables]][[Category:Reports]]
 
[[Category:Variables]][[Category:Reports]]

Latest revision as of 14:55, 5 April 2022

This article describes the Variables that can be used to display report data, 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:

  • 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 Custom Export settings of the Report
    • exportrawdata - Report data, without any formatting

Note:

    • ReportProperty is case sensitive. Using reportproperty will not work.

Using ReportProperty on reports with a Group By

    • In order to use a ReportProperty on a report which has a group by clause, you need to add a distinct clause to the ReportProperty syntax.
@ReportProperty(reportid,property,distinct(fieldname))@
Example: If a report is grouped by the tracking id, then your ReportProperty syntax would be
@ReportProperty(reportid,property,distinct(opportunityid))@

You can also pass criteria into the ReportProperty call. See Including Criteria in ReportProperty.

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


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.

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 custom 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.


Export Raw Data

When using the Exportrawdata report variable, the variable will be replaced with data from the specified report, without any formatting applied.

  • @ReportProperty(reportid,exportrawdata)@

The exportrawdata 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.

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