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
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
reportId
longthe 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
reportId
longthe Id of the report
include
IEnumerable<ReportInclusion>used to specify the optional objects to include.
pageSize
int?(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.
page
int?(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
reportId
longthe Id of the report
include
IEnumerable<ReportInclusion>used to specify the optional objects to include.
pageSize
int?(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.
page
int?(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.
level
int?(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
reportId
longthe Id of the report
outputStream
BinaryWriterthe 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
reportId
longthe Id of the report
outputStream
BinaryWriterthe 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
paging
PaginationParametersthe pagination
modifiedSince
DateTime?restrict results to reports modified on or after the specified date
Returns
- PaginatedResult<Report>
A list of Report objects limited to the following attributes:
- id
- name
- accessLevel
- 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
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
reportId
longthe reportId
email
SheetEmailthe 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
reportId
longthe reportId
reportPublish
ReportPublishthe 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