Endpoint Export Report (to PDF, Excel, CSV file)
Name
export_report
Description
Export Report to CSV, Excel or PDF file. [API reference]
Parameters
| Parameter | Required | Options | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Name:
Label: ReportId |
YES | |||||||||||||||||||||
|
Name:
Label: Format |
YES |
|
||||||||||||||||||||
|
Name:
Label: Paper Size (Only for PDF) |
|
Output Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| Id |
DT_WSTR
|
nvarchar(50)
|
50 | |
| Status |
DT_WSTR
|
nvarchar(50)
|
50 | |
| TargetFilePath |
DT_WSTR
|
nvarchar(2000)
|
2000 |
Input Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Examples
SSIS
Use Smartsheet Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Source
| Required Parameters | |
|---|---|
| ReportId | Fill-in the parameter... |
| Optional Parameters | |
| RawOutputDataRowTemplate | {"Id": "[$ReportId$]", "Status":"Done", "TargetFilePath":"[$TargetFilePath,FUN_JSONENC$]"} |
API Destination
| Required Parameters | |
|---|---|
| ReportId | Fill-in the parameter... |
| Optional Parameters | |
| RawOutputDataRowTemplate | {"Id": "[$ReportId$]", "Status":"Done", "TargetFilePath":"[$TargetFilePath,FUN_JSONENC$]"} |
ODBC application
Use these SQL queries in your ODBC application data source:
Export report
<p>Exports a report to a file (PDF, Excel, or CSV). You must specify the <code>ReportId</code>, <code>TargetFilePath</code>, and <code>Format</code>.</p>
SELECT * FROM export_report WITH(
ReportId=2972339541069700,
,TargetFilePath='c:\temp\exported_report_as_excel_file.xlsx' --or .pdf, .csv
,Format='application/vnd.ms-excel' --or-- application/pdf --or-- text/csv
--below Paper Size only valid for PDF
--,PaperSize='LETTER' --or LEGAL, WIDE, ARCHD, A4, A3, A2, A1, A0
)
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Export report
<p>Exports a report to a file (PDF, Excel, or CSV). You must specify the <code>ReportId</code>, <code>TargetFilePath</code>, and <code>Format</code>.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM export_report WITH(
ReportId=2972339541069700,
,TargetFilePath=''c:\temp\exported_report_as_excel_file.xlsx'' --or .pdf, .csv
,Format=''application/vnd.ms-excel'' --or-- application/pdf --or-- text/csv
--below Paper Size only valid for PDF
--,PaperSize=''LETTER'' --or LEGAL, WIDE, ARCHD, A4, A3, A2, A1, A0
)';
EXEC (@MyQuery) AT [LS_TO_SMARTSHEET_IN_GATEWAY];