Printable Document Object Methods and Properties

This section provides an overview of the methods and properties available for use with the Printable Document Object.

Methods

The Printable Document object has these methods that you can call:

Method Use Additional Information

Show ()

Use this method to display your report as a pop-up document.

Just before launching the pop-up window, you can set various display properties on the PrintableDocument object to control the size and placement of the pop-up menu. You can also control what additional elements appear in the pop-up menu. For example, you can turn the toolbar, menu, and scroll bars on or off. Any attributes that are not set are provided by default from the client's browser environment.

Print ()

Use this method to send your report to a print dialog.

While the Show() method may be used to display pure XML in a pop-up window for the user to then manually print, the Print() method throws an exception if there is no XSL document to transform the XML. This occurs because JavaScript can only invoke its print() and close() methods on a window that contains HTML. Attempts to print or close a window with only XML fail, and thus the user is presented with a small, confusing, orphaned window.

SetStyle(&BU_Type, &BU, &Report_Type)

Use this method to set the XSLDocument property based on the Printable Document Framework Repository.

&BU_Type: OM for Order Management or AR for Accounts Receivable.

&BU: an OM or" AR Business Unit

&Report_Type: a valid translate value on the SCM_REP_TYPE field

includeXSLTemplate(&templateName as string)

Use this method to include XSL templates stored in HTML objects into an existing XSLDocument.

Several templates are shipped with the product.

Include these templates by passing to the includeXSLTemplate() method any PrintableDocument properties having names beginning with "pdXSLTmplt." It is not recommended that you directly pass in the HTML object names of these standard templates, as some require the inclusion of other templates to work properly. Using the pdXSLTmplt properties ensures that any other required templates are included as well.

Properties

This table lists the properties available for use with the Printable Document Object:

Property Use Examples, Additional Parameters

rowsetData

Use this property to set the datasource for your report using a rowset.

Example for setting the pop-up window attributes:

&pDoc.Height=400;
&pDoc.Width=600;
&pDoc.MenuBar=False;
&pDoc.StatusBar=True;
&pDoc.Resizeable=True;

XMLDocument

Use this property to set the datasource for a report using a XMLDoc or fetch the XMLDoc result from your rowsetData (convert a rowset to XML)

 

XSLDocument

Use this property to set the XSL Stylesheet or to fetch the XSL Stylesheet generated by the SetStyle() method.

 

HTMLString

Use this property to set the HTMLString for display or fetch the HTMLString generated from the XMLDocument and XSLDocument.

 

printHTML

Use this property if you already have an HTMLArea on the page, and can use it instead of including the delivered sub-page.

 

showHTML

Use this property if you already have an HTMLArea on the page, and can use it instead of including the delivered subpage.

 

pdXSLTmpltHeader

This is a delivered template for document headers. It puts the company logo in the upper left corner of the page, company address in the upper right, and document title centered and below the other two.

Parameters (any parameters omitted will not appear in the address block):

name — Piece of the address block

address1 — Piece of the address block

address2 — Piece of the address block

address3 — Piece of the address block

city — Piece of the address block

state — Piece of the address block

postal — Piece of the address block

reportTitle — The title for the report

pdXSLTmpltAddress

This is a delivered template for address blocks.

Parameters (any parameters omitted will not appear in the address block):

msgStr — A label for the address block

name — Piece of the address block

address1 — Piece of the address block

address2 — Piece of the address block

address3 — Piece of the address block

city — Piece of the address block

state — Piece of the address block

postal — Piece of the address block