The following example executes a report binder, saves the output as a PDF document and opens the file in the default PDF document viewer.



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.