Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

ReportManager Class

Runs a report synchronously or asynchronously and with or without details.

Namespace

Reports

Usage

Gets instances of reports and describes the metadata of Reports.

ReportManager Methods

The following are methods for ReportManager. All methods are static.

describeReport(reportId)

Retrieves report, report type, and extended metadata for a tabular, summary, or matrix report.

Syntax

public static Reports.ReportDescribeResult describeReport(Id reportId)

Parameters

  • reportId:

    Type: Id

Return Value

Type: Reports.ReportDescribeResult

getDatatypeFilterOperatorMap()

Lists the field data types that you can use to filter the report.

Syntax

public static MAP<String,LIST<Reports.FilterOperator>> getDatatypeFilterOperatorMap()

Return Value

Type: Map<String, List<Reports.FilterOperator>>

getReportInstance(instanceId)

Retrieves results for an instance of a report that has been run asynchronously. The settings you use when you run your asynchronous report determine whether you can retrieve summary data or detailed data.

Syntax

public static Reports.ReportInstance getReportInstance(Id instanceId)

Parameters

  • instanceId:

    Type: Id

Return Value

Type: Reports.ReportInstance

getReportInstances(reportId)

Returns a list of instances for a report that was run asynchronously. Each item in the list represents a separate instance of the report, with metadata for the time at which the report was run.

Syntax

public static LIST<Reports.ReportInstance> getReportInstances(Id reportId)

Parameters

  • reportId:

    Type: Id

Return Value

Type: List<Reports.ReportInstance>

runAsyncReport(reportId, reportMetadata, includeDetails)

Runs a report asynchronously with the report ID. Includes details if includeDetails is set to true. Filters the report based on the report metadata in reportMetadata.

Syntax

public static Reports.ReportInstance runAsyncReport(Id reportId, Reports.ReportMetadata reportMetadata, Boolean includeDetails)

Parameters

Return Value

Type: Reports.ReportInstance

runAsyncReport(reportId, includeDetails)

Runs a report asynchronously with the report ID. Includes details if includeDetails is set to true.

Syntax

public static Reports.ReportInstance runAsyncReport(Id reportId, Boolean includeDetails)

Parameters

  • reportId:

    Type: Id

  • includeDetails:

    Type: Boolean

Return Value

Type: Reports.ReportInstance

runAsyncReport(reportId, reportMetadata)

Runs a report asynchronously with the report ID. Filters the results based on the report metadata in reportMetadata.

Syntax

public static Reports.ReportInstance runAsyncReport(Id reportId, Reports.ReportMetadata reportMetadata)

Parameters

Return Value

Type: Reports.ReportInstance

runAsyncReport(reportId)

Runs a report asynchronously with the report ID.

Syntax

public static Reports.ReportInstance runAsyncReport(Id reportId)

Parameters

  • reportId:

    Type: Id

Return Value

Type: Reports.ReportInstance

runReport(reportId, reportMetadata, includeDetails)

Runs a report immediately with the report ID. Includes details if includeDetails is set to true. Filters the results based on the report metadata in reportMetadata.

Syntax

public static Reports.ReportResults runReport(Id reportId, Reports.ReportMetadata reportMetadata, Boolean includeDetails)

Parameters

Return Value

Type: Reports.ReportResults

runReport(reportId, includeDetails)

Runs a report immediately with the report ID. Includes details if includeDetails is set to true.

Syntax

public static Reports.ReportResults runReport(Id reportId, Boolean includeDetails)

Parameters

  • reportId:

    Type: Id

  • includeDetails:

    Type: Boolean

Return Value

Type: Reports.ReportResults

runReport(reportId, reportMetadata)

Runs a report immediately with the report ID. Filters the results based on the report metadata in rmData.

Syntax

public static Reports.ReportResults runReport(Id reportId, Reports.ReportMetadata reportMetadata)

Parameters

Return Value

Type: Reports.ReportResults

runReport(reportId)

Runs a report immediately with the report ID.

Syntax

public static Reports.ReportResults runReport(Id reportId)

Parameters

  • reportId:

    Type: Id

Return Value

Type: Reports.ReportResults