--- title: "Report Viewer Scripting Functions" --- # Report Viewer Scripting Functions > This page details the various component and extension functions available for Vision's Report Viewer component. ## Component Functions ### .print(printerName, showDialog) :::note The following print method will only work if a report has finished loading on the Report Viewer component. ::: * Description * Uses the named printer and determine if the print dialog window should appear or not. * Parameters * String **printerName** - The name of the printer the report should be sent to. Will use the default printer if left blank. [optional] * Boolean **showDialog** - True if the dialog window should appear, False if the dialog window should be skipped. Will be true if left blank. [optional] * Return * None * Scope * Client ### getBytesPDF() * Description * Return the bytes of the generated report in the Report Viewer using PDF format. * Parameters * None * Return * Byte Array - The bytes of the report in PDF format. :::note This function will return null if the trial has expired. ::: * Scope * Client ### getBytesPNG() * Description * Return the bytes of the generated report in the Report Viewer using PNG format. * Parameters * Nothing * Return * Byte Array - The bytes of the report in PNG format. :::note This function will return null if the trial has expired. ::: * Scope * Client ### saveAsPDF(fileName) * Description * Prompts the user to save a copy of the report as a PDF. Shows a file selection window with the extension set to PDF. * Parameters * String **fileName** - A suggested filename to save the report as * Return * Nothing * Scope * Client ### saveAsPNG(fileName) * Description * Prompts the user to save a copy of the report as a PNG. Shows a file selection window with the extension set to PNG. * Keyword Args * String **fileName** - A suggested filename to save the report as. * Return * Nothing * Scope * Client ### saveAsXls(fileName) * Description * Prompts the user to save a copy of the report as an XLS file. Shows a file selection window with the extension set to XLS. * Keyword Args * String **fileName** - A suggested filename to save the report as. * Return * Nothing * Scope * Client ## Extension Functions ### onReportGenerated * Description * Called when the Report generation process has been completed. * Keyword Args * Component **self** - A reference to the component invoking this method. * Byte Array **pdfBytes** - The PDF formatted bytes generated by the Report. * Return * Nothing * Scope * Client