Interface ReportResources
- Namespace
- Smartsheet.Api
- Assembly
- smartsheet-csharp-sdk.dll
This interface provides methods to access Report resources.
Thread Safety: Implementation of this interface must be thread safe.
public interface ReportResources
Properties
ShareResources
Return the ShareResources object that provides access to Share resources associated with Report resources.
ShareResources ShareResources { get; }
Property Value
- ShareResources
the share resources object
Methods
AddReportColumns(long, IEnumerable<ReportColumn>)
Add columns to a report specified by a report ID. Note: all indexes of the columns must be equal.
It mirrors to the following Smartsheet REST API method: POST /reports/{reportId}/columns
IList<ReportColumn> AddReportColumns(long reportId, IEnumerable<ReportColumn> reportColumns)
Parameters
reportIdlongthe reportId
reportColumnsIEnumerable<ReportColumn>list of report columns to be added (minItems: 1, maxItems: 400)
Returns
- IList<ReportColumn>
list of report columns that were added
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- ArgumentException
if reportColumns list is empty or exceeds 400 items
- SmartsheetException
if there is any other error during the operation
AddReportScope(long, IEnumerable<ReportScopeInclusion>)
Adds one or more specified sheet or workspace to the report scope.
void AddReportScope(long reportId, IEnumerable<ReportScopeInclusion> scopes)
Parameters
reportIdlongthe reportId
scopesIEnumerable<ReportScopeInclusion>an array of one or more objects denoting the sheets or workspaces associated with the report
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- ArgumentException
if scopes are empty
- SmartsheetException
if there is any other error during the operation
CreateReport(CreateReportRequest)
Create a new report by specifying name, destination, scope, columns and definition.
It mirrors to the following Smartsheet REST API method: POST /reports
CreateReportResult CreateReport(CreateReportRequest request)
Parameters
requestCreateReportRequestthe create report request containing name, destination, scope, columns, and optional definition
Returns
- CreateReportResult
the created report result containing id, name, accessLevel, and permalink
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
DeleteReport(long)
Deletes a report.
Mirrors the following Smartsheet REST API method: DELETE /reports/{reportId}
void DeleteReport(long reportId)
Parameters
reportIdlongthe report Id
Exceptions
- InvalidOperationException
if any argument is null or an empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
GetPublishStatus(long)
Get the publish status of a report.
It mirrors to the following Smartsheet REST API method: GET /reports/{id}/publish
ReportPublish GetPublishStatus(long reportId)
Parameters
reportIdlongthe reportId
Returns
- ReportPublish
The report publish status (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
GetReport(long, IEnumerable<ReportInclusion>?, int?, int?)
Gets the Report, including one page of Rows, and optionally populated with Discussions, Attachments, and source Sheets.
It mirrors to the following Smartsheet REST API method: GET /reports/{reportId}
Report GetReport(long reportId, IEnumerable<ReportInclusion>? include = null, int? pageSize = null, int? page = null)
Parameters
reportIdlongthe Id of the report
includeIEnumerable<ReportInclusion>used to specify the optional objects to include.
pageSizeint?(optional): Number of rows per page. If not specified, the default value is 100. This operation can return a maximum of 500 rows per page.
pageint?(optional): Which page number (1-based) to return. If not specified, the default value is 1. If a page number is specified that is greater than the number of total pages, the last page will be returned.
Returns
- Report
the report resource (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).
Remarks
This method returns the top 100 rows. To get more or less rows please use the other overloaded versions of this method
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
GetReport(long, IEnumerable<ReportInclusion>?, int?, int?, int?)
Gets the Report, including one page of Rows, and optionally populated with Discussions, Attachments, and source Sheets.
It mirrors to the following Smartsheet REST API method: GET /reports/{reportId}
Report GetReport(long reportId, IEnumerable<ReportInclusion>? include = null, int? pageSize = null, int? page = null, int? level = null)
Parameters
reportIdlongthe Id of the report
includeIEnumerable<ReportInclusion>used to specify the optional objects to include.
pageSizeint?(optional): Number of rows per page. If not specified, the default value is 100. This operation can return a maximum of 500 rows per page.
pageint?(optional): Which page number (1-based) to return. If not specified, the default value is 1. If a page number is specified that is greater than the number of total pages, the last page will be returned.
levelint?(optional): compatiblity level
Returns
- Report
the report resource (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).
Remarks
This method returns the top 100 rows. To get more or less rows please use the other overloaded versions of this method
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
GetReportAsCSV(long, BinaryWriter)
Get a report as a CSV file.
It mirrors to the following Smartsheet REST API method:
GET /reports/{reportId} with "text/csv" Accept HTTP header
void GetReportAsCSV(long reportId, BinaryWriter outputStream)
Parameters
reportIdlongthe Id of the report
outputStreamBinaryWriterthe output stream to which the Excel file will be written.
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
GetReportAsExcel(long, BinaryWriter)
Gets the Report in the format specified, based on the Report ID.
It mirrors to the following Smartsheet REST API method:
GET /reports/{reportId} with "application/vnd.ms-excel" Accept HTTP header
void GetReportAsExcel(long reportId, BinaryWriter outputStream)
Parameters
reportIdlongthe Id of the report
outputStreamBinaryWriterthe output stream to which the Excel file will be written.
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
ListReports(PaginationParameters?, DateTime?)
Gets the list of all Reports that the User has access to, in alphabetical order, by name.
It mirrors to the following Smartsheet REST API method: GET /reports
PaginatedResult<Report> ListReports(PaginationParameters? paging = null, DateTime? modifiedSince = null)
Parameters
pagingPaginationParametersthe pagination
modifiedSinceDateTime?restrict results to reports modified on or after the specified date
Returns
- PaginatedResult<Report>
A list of Report objects limited to the following attributes:
<ul><li>id</li><li>name</li><li>accessLevel</li><li>permalink</li></ul>
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
RemoveReportScope(long, IEnumerable<ReportScopeInclusion>)
Removes one or more specified sheet or workspace from the report scope.
void RemoveReportScope(long reportId, IEnumerable<ReportScopeInclusion> scopes)
Parameters
reportIdlongthe reportId
scopesIEnumerable<ReportScopeInclusion>an array of one or more objects denoting the sheets or workspaces associated with the report
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- ArgumentException
if scopes are empty
- SmartsheetException
if there is any other error during the operation
SendReport(long, SheetEmail)
Send a report as a PDF attachment via Email to the designated recipients.
It mirrors to the following Smartsheet REST API method: POST /reports/{reportId}/emails
void SendReport(long reportId, SheetEmail email)
Parameters
reportIdlongthe reportId
emailSheetEmailthe Email
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
UpdatePublishStatus(long, ReportPublish)
Sets the publish status of a report and returns the new status, including the URLs of any enabled publishing.
It mirrors to the following Smartsheet REST API method: PUT /reports/{id}/publish
ReportPublish UpdatePublishStatus(long reportId, ReportPublish reportPublish)
Parameters
reportIdlongthe reportId
reportPublishReportPublishthe ReportPublish object
Returns
- ReportPublish
The report publish status (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
UpdateReportDefinition(long, ReportDefinition)
Update a Report's definition based on the specified ID
Note:
This endpoint supports partial updates only on root level properties of the report definition, such as filters, groupingCriteria and summarizingCriteria. For example, you can update the report's filters without affecting its grouping criteria. However, nested properties within these objects, such as a specific filter or grouping criterion, cannot be updated individually and require a full replacement of the respective section.
It mirrors to the following Smartsheet REST API method: PUT /reports/{reportId}/definition
void UpdateReportDefinition(long reportId, ReportDefinition reportDefinition)
Parameters
reportIdlongthe reportId
reportDefinitionReportDefinitionthe ReportDefinition object