Execute a Report Binder (Basic)
The following example executes a report binder, saves the output as a PDF file or Microsoft Word document and opens the file in the default document viewer.
- Connect to the reporting web service.
- Specify the file format as either "DOCX" or "PDF".
- Specify the unique identifier of the report binder to execute in GUID format.
- The user must have permissions to execute this report binder.
Code Sample
# Set the file format to DOCX/PDF.
$fileformat = "DOCX";
$reportBinderIdentifier = [Guid]"0f22bce4-7428-4a11-84a5-9e23abfbcb71";
# Execute the report binder.
$documentPackage = $reporting.DO_ExecuteReportBinderBasic($reportBinderIdentifier, $fileformat);
# Save and open the file.
$filename = "$($env:TEMP)\$($documentPackage.Filename)"
[IO.File]::WriteAllBytes($filename, $documentPackage.FileData);
[System.Diagnostics.Process]::Start($filename);