PrintOut (Method)

Applies To:

ChartSection object, (CubeQuery)QuerySection object, DataModelSection object, OLAPQuerySection object, PivotSection object, QuerySection object, ResultsSection object, Section object, TableSection object, ReportSection object

Description:

Interactive Reporting document file (BQY) and section level function. This method is available regardless of the state of the application. As long as the application is running, this method is available through scripting. The PrintOut() method in the studio or web client either prints the document according to the arguments provided, or opens a standard OS print box.

If the PrintOut (Method) is encountered while executing a script for a EPM Workspace user, when the server finishes the script processing, the data sent back to the client browser includes a PDF file as part of the data stream.

This PDF data opens in a new window using the Adobe Acrobat Reader (version 7.0.1 or later required), and the Adobe Print dialog is displayed. Due to an issue with Adobe Acrobat Reader, the default settings in the Print dialog are set to print only the first page. Users should reset the Print Range options in the dialog before clicking OK to initiate the printing. Note that the script is run in its entirety before the PDF data is sent to the client browser. This may cause some unexpected behavior with existing documents, such as those with a script that displays an Alert dialog saying “Print Complete”, when in fact it has not even started. Script authors should also be aware of these factors when designing the application.

Use of the Alert method after the Printout() method prevents the Printout() method from executing in an Interactive Reporting document file to be deployed in the EPM Workspace. When used in EPM Workspace mode, the optional parameters of the method, for example pages to print and number of copies are ignored. These options can be specified in the Adobe Acrobat Reader’s Print dialog. The Printout() method is not supported in scripts that run as the result of Document events (such as OnStartup); it is also not supported for section-level activation and deactivation events. The Printout() method has no effect on jobs and does not cause a printout to occur. It is not supported when used as a method of Query or Datamodel type section.

The PrintOut (Methods) takes five arguments. The user can define the start page, end page, number of copies, PrintOut filename and whether or not to prompt for a print dialog box. All arguments are optional, but placeholder empty string e.g. (“”,””,””,””, “”) must be used to pass no value. If insufficient arguments are passed to the method, the PrintOut dialog box open. The user cannot programmatically change the screen location where the PrintOut Dialog box opens.

The first argument is a number. This is equivalent to setting the first number to print in a print dialog box. Value provided must be a number representing the first page to print between 1 and the last page in the Interactive Reporting document file. This is an optional value. This value is ignored in EPM Workspace.

The second argument is a number. This is equivalent to setting the last number to print in a print dialog box. Value provided must be a number representing the last page to print between 1 and the last page in the Interactive Reporting document file. This is an optional value. This value is ignored in the EPM Workspace.

The third argument is a number. This is equivalent to setting the number of copies to be printed in a print dialog box. Value provided must be number representing 1 to n copies. This is an optional value. This value is ignored in the EPM Workspace.

The fourth argument is a string. This is equivalent to setting the filename for printing to file. The string should have a printer specific extension for later use, foe example. .prn or .ps . The file is generated by the default printer driver, not BI, and requires that a default printer be available. Populating this value has the effect of checking the print to file checkbox in the print dialog. The Value provided must be a string. representing a properly formatted local or UNC path. URL syntax is not supported. This is an optional value. This value is ignored in the EPM Workspace. The fifth argument is a boolean. This is equivalent to showing the print dialog or not. Value provided must false/0, or true/any number other than 0. The method does not persist with the Interactive Reporting document file/application.

Note:

If an Alert is used after the Printout (Method) in an Interactive Reporting document file deployed in the EPM Workspace, the Printout (Method) does not execute.

Syntax:

Expression.PrintOut([optional]FromPage as Number, [optional] ToPage As Number], [Copies As Long], [optional] Filename As String, [optional]Boolean Prompt)

Expression Required:

An expression that returns an object for any of these sections:

Example:

This example shows how to print multiple copies of a Pivot section:

var StartPage = 1
var EndPage = 1
var NumCopies =2
ActiveDocument.Sections["Pivot"].PrintOut(StartPage,EndPage,NumCopies)