Execute a Report Binder to PDF
The following example executes a report binder, saves the output as a PDF document and opens the file in the default PDF document viewer.
- Connect to the reporting web service.
- Specify the unique identifier of the report binder to execute in GUID format.
- Specify the customer or container against which to execute the report binder, by default this is the root container with identifier 1000.
- Optionally set the report binder parameter values.
- The user must have permissions to execute this report binder.
Code Sample
# Executes the report binder and saves the output as a PDF file in the user's temp directory.
$filename = "$env:TEMP\ReportBinderOutput.pdf"
$reportBinderIdentifier = [Guid]"7993bda0-6085-423f-8b03-80b196cde299";
$parameterValues = $reporting.GET_DefaultReportBinderParameterValues($reportBinderIdentifier);
$output = $reporting.DO_ExecuteReportBinderPdf($reportBinderIdentifier, $parameterValues, 1000);
[IO.File]::WriteAllBytes($filename, $output);
[System.Diagnostics.Process]::Start($filename);
For information about setting report parameters see the Execute a Report to PDF example.