Creating Customized Panes in Syspro - Documentation

27
Customized Panes Documentation.doc Customized Panes Date: Thursday, February 14, 2008 Introduction This document describes changes to docking panes to allow end-users to create new docking panes which can contain objects such as graphs, web browsers, list views, Crystal reports or PDF documents. By allowing this, customers can effectively create their own executive views just about anywhere in SYSPRO. In addition, the objects are controlled using VBScripting which allows for very flexible customization. Introduction to Customized Panes Customized panes allow you to create your own ‘panes’ within any docking pane application; each ‘pane’ can contain an object such as a graph, list view, or web browser (inter alia). The behaviour of these objects is controlled via VBScript. The end result is that you can easily create dashboards or executive views just about anywhere in SYSPRO or you can create your own list views and ‘forms’. A customized pane can interact with other customized panes and any other entry or display form or list view that is associated with the same docking pane application; for example, if the contents of a form is refreshed, then you can cause a refresh event to occur on multiple customized panes. A customized pane can be automated to refresh its contents after a specified timeout (in minutes or seconds). Additionally, you can program an application to show desktop alerts dependent on certain criteria being met; a desktop alert is a popup window whose contents can be dynamically created and can include hyperlinks to other SYSPRO applications or executables. Availability of customized panes Customized panes is available as part of SYSPRO 6.0 Issue 010 Service Pack2 (SP2). Customized panes functionality is included as part of the core product and does not require any separate licensing.

Transcript of Creating Customized Panes in Syspro - Documentation

Page 1: Creating Customized Panes in Syspro - Documentation

Customized Panes Documentation.doc

Customized Panes

Date: Thursday, February 14, 2008

Introduction

This document describes changes to docking panes to allow end-users to create new docking panes which can contain objects such as graphs, web browsers, list views, Crystal reports or PDF documents. By allowing this, customers can effectively create their own executive views just about anywhere in SYSPRO. In addition, the objects are controlled using VBScripting which allows for very flexible customization.

Introduction to Customized Panes

Customized panes allow you to create your own ‘panes’ within any docking pane application; each ‘pane’ can contain an object such as a graph, list view, or web browser (inter alia). The behaviour of these objects is controlled via VBScript. The end result is that you can easily create dashboards or executive views just about anywhere in SYSPRO or you can create your own list views and ‘forms’. A customized pane can interact with other customized panes and any other entry or display form or list view that is associated with the same docking pane application; for example, if the contents of a form is refreshed, then you can cause a refresh event to occur on multiple customized panes. A customized pane can be automated to refresh its contents after a specified timeout (in minutes or seconds). Additionally, you can program an application to show desktop alerts dependent on certain criteria being met; a desktop alert is a popup window whose contents can be dynamically created and can include hyperlinks to other SYSPRO applications or executables.

Availability of customized panes

Customized panes is available as part of SYSPRO 6.0 Issue 010 Service Pack2 (SP2). Customized panes functionality is included as part of the core product and does not require any separate licensing.

Page 2: Creating Customized Panes in Syspro - Documentation

Page 2 2/14/2008

How to create, modify or delete a customized pane

To add a customized pane: Click on the menu pull-down option on a docking pane’s caption and select Customized Pane, New.

Notes:

1. The options to create or modify customized panes are not available if the following security option against the operator is set as denied:

Listview/Forms – VBScript editing and form adjustments by operator

2. When you create a customized pane it is added to the current docking pane layout. Some applications have more than one docking pane layout so when creating customized panes make sure you have selected the pull-down menu option from any docking pane window that is in that layout’s group. In the main system menu there is a special Executive View docking pane layout reserved specifically for customized panes; to add panes to this view you must click on the button Click to add customized pane.

3. To modify a customized pane: Click on the menu pull-down option on a docking pane’s caption and select Customized Pane, Properties.

4. To delete a customized pane:

Click on the X at the top right of the customized pane caption. This will delete the customized pane AND the VBScript associated with it.

5. Resetting Layouts

If you use the Reset Layout option (available in the docking pane menu) then the customized panes will be re-applied in their original docking positions.

Page 3: Creating Customized Panes in Syspro - Documentation

Page 3 2/14/2008

Entering customized pane properties After selecting New the Customized Pane Editor window is displayed. The Preview tab is where preview of the selected object will be displayed; the Customized Panes tab will display a list of the customized panes you have created under your operator’s name. Customized Panes created using roles will be shown in the Customization Management program. The VBScript tab will display the contents of the VBScript associated with the customized pane.

Select the type of object you wish to add to your customized pane.

For Graphs and Listviews you can select to use templates – double-click on the required template and a preview of the output will be shown.

Enter the window title as required, as well as other options.

Click on Save to save the customized pane in your docking pane application and start to create another pane, or click on Save and Exit to save the customized pane and exit. If you wish or need to modify the VBScript associated with the customized pane click on the Edit…button next to the VBScript file name.

Page 4: Creating Customized Panes in Syspro - Documentation

Page 4 2/14/2008

Features

Virtually unlimited customized panes per each docking pane application (up to 99 customized panes).

Automatic refresh. Customized panes can be refreshed manually by clicking on the Refresh button on the pane’s toolbar. However, you can decide that the contents of a customized pane can be refreshed periodically (every 5 minutes, for example).

A customized pane can show various objects include a graph, web browser, list view, Crystal report or PDF document.

o Graphs. Graphs can be selected from a standard template or built from scratch. Graphs consist of two properties – the graph properties themselves (graph title, legends and so on), and the data required to populate the graph. The basic properties for a graph are indicated in the design editor, including setting simple conditional attributes (highlight exceptions); however, these properties can be further defined in the graph properties XML.

o List views. List views can be selected from a standard template or built from scratch. List views can be displayed in data grid (the default) or form style. A data grid is used for recurring items, such as a list of A/R invoices for a customer or inventory warehouses for a stock code. A ‘form’ list view is used to display single occurrence information in form style (see below for more information) such as all the information about a specific stock code or supplier. Smart Links work with both ‘data grid’ and ‘form’ style list views. Data grids and form style list views can be editable.

o Web browser. A web browser is used to display any web page. It is in effect the equivalent of hosting Internet Explorer in a customized pane, but without the address bar. Navigating to a specific URL is done either by pointing the web browser to a URL at load time, or by using VBScript to point a new URL. It is also possible to launch standard SYSPRO programs directly from any web page by embedding special code in the HTML page. This is achieved by adding a href link and embedding the SYSPRO program in it, as in this example: href='#SYSPROAPSPEN&lt;' The href must contain #SYSPRO followed immediately by the SYSPRO program you wish to call, followed by one of these delimiter characters: < = ! When the href is clicked the web browser will detect this and inform SYSPRO to call the SYSPRO program rather than attempt to navigate to the href itself.

o Crystal report. This object hosts the Crystal report viewer. You can point the report viewer to a crystal report (.rpt) either at load time, or you can use VBScript to view whatever report you wish. Note that the .RPT must already have been created by using SYSPRO Reporting Services or a Crystal report.

o PDF viewer. This object is used to view any PDF document. . You can point the viewer to a PDF document either at load time, or you can use VBScript to view whatever document you wish.

You can create desktop alerts. Desktop alerts are popup windows and can have hyperlinks to SYSPRO programs and/or executables.

You can cause refresh events to be posted to a customized pane from another form, list view or indeed another customized pane.

Business objects can be CALLed directly using client/server technology rather than via web services or DCOM. This is faster and easier to use. There is a built-in IDE to help call business objects. Note that by default the function calls a business object using an

Page 5: Creating Customized Panes in Syspro - Documentation

Page 5 2/14/2008

instance ‘auto’ of SYSPRO (this will automatically determine the current SYSPRO instance from the registry); you can force the instance number in the VBScript – in the example below the QUERY business object will be invoked using instance ‘2’: XMLOut = CallBO("INVQRY",XMLIn,"2") You can also call TRANSACTION and SETUP business objects with CallTrn and CallSetup functions respectively.

There is a GlobalVariable uniquely associated with each customized pane. This is a read-write property. This can be used to determine if a desktop alert, for example, should be invoked or if the alert has already been displayed.

Understanding Customized Pane Events

The content and behavior of objects is entirely controlled via VBScript using various events. These events are shown when you load the VBScript editor for a customized pane – click on the Edit… button next to the VBScript name in the Customized Pane Editor.

The VBScript editor will load and show the various events associated with the current pane object:

Page 6: Creating Customized Panes in Syspro - Documentation

Page 6 2/14/2008

OnLoad. This event fires once when the customized pane is created and the object is initially instantiated. Typically in this event you would create the Graph properties or list view column headings.

OnRefresh. This event fires each time the customized pane is asked to be refreshed (either by clicking on the Refresh button or when automatically refreshed using the timer, or if the pane is asked to be refreshed by another pane or form). Typically in this event you would refresh the contents of the object in the pane, such as populating the list view the graph.

OnClick. This event fires when clicking on a graph bar. The information about the item clicked in is returned in the VBScript variables BarLabelClicked, BarPointClicked, and BarSeriesClicked.

OnDblClick. This event fires when double-clicking either on a graph bar or any row in a list view. The information about the graph bar is returned as explained above (for a single click event), and for a list view the contents of each cell in the list view row are returned in the variable ListviewRowReturned; each cell is separated by a TAB character.

OnLinkClicked. This event fires when you click on a hyperlink in a cell. The contents of each cell in the list view row are returned in the variable ListviewRowReturned; each cell is separated by a TAB character. The column in which the cell was clicked can be identified using the variable ColumnClicked.

OnPopulate. This event fires after a list view has been populated with new data. You can use this event to iterate through the list view rows and modify the cell attributes for exception purposes; for example, you might want to highlight in red if a warehouse’s quantity on hand is negative. To iterate through a list view’s rows you use the CustomizedPane.CodeObject.Array, and to modify the list view you would use CustomizedPane_OUT.CodeObject.Array variable as shown in the example below; in this example the first column (using zero-based indexing) in each row will be displayed in bold. You can click on Field Properties on the editor’s toolbar to view the various attributes that may be set against a list view cell.

dim lngubound

dim lngindex

dim Row

dim Column

Column = 0 ‘ The first column, using zero-based indexing

lngubound = ubound(CustomizedPane.CodeObject.Array,2)

‘Second parameter indicates number of rows in the array

for lngindex = 0 to lngUBound

CustomizedPane_OUT.CodeObject.Array(Column,lngIndex)="<Field IsBold='true' >

</Field>"

next

Page 7: Creating Customized Panes in Syspro - Documentation

Page 7 2/14/2008

Understanding Customized Pane Variables

Each customized pane has a unique set of both events and variables associated with it, dependent on the type of object contained in the pane. There are some variables that are common to all type of objects: DesktopAlert variable

Write-only Double-click on this variable to implement a desktop alert. A desktop alert is a popup window that can be programmed to contain hyperlinked text. Enter the required information and click on Insert VBScript code to create an XML string in your VBScript code. Make sure you have positioned your cursor in the VBScript editor window first as the code will be inserted at the current cursor position. Note that you can modify the generated VBScript code to include any variables. For example, you might want to pass the customer number to the called SYSPRO program on the hyperlinked text ‘AR Query’: Prog = "ARSPEN " & CustomerNumber

Popup = Popup & "<Popup Duration='05' Animation='Fade'>"

Popup = Popup & "<Heading Text='AR Query' SYSPROProgram='" & Prog & "' />"

Click on the Preview button to see how your popup window will look, as in the following example.

The text Note the customers balance will be hyperlinked because we have associated running a SYSPRO program with it; clicking anywhere on the text will run the SYSPRO

Page 8: Creating Customized Panes in Syspro - Documentation

Page 8 2/14/2008

program ARSPEN. You can optionally add parameters to SYSPRO programs (as in ARSPEN 000001); the parameters depend on the SYSPRO program itself, but SYSPRO query programs typically assume that the first parameter is the primary key to be passed. An executable can have parameters passed to it, as in notepad “test.txt”.

GlobalVariable variable

Read-write This is a unique variable for the current customized pane only. Here’s an example where you might use this variable: Assume that you wish to show a desktop alert where a bank balance is greater than, say, 50,000.00. Now, when the bank balance exceeds this figure then the desktop alert would be displayed. However, you would want the desktop alert to be shown once only and so you would use the global variable to store the highest bank balance value.

RefreshValue variable Read-write Contains the value passed by another form or pane to this customized pane. See the section entitled How to make a customized pane to be „refreshed‟.

Page 9: Creating Customized Panes in Syspro - Documentation

Page 9 2/14/2008

How to implement a Graph in a customized pane

A graph consists of two parts: properties (where you define the columns/bars and other basic information) and data (where you define the data to be populated in the graph). In both cases the definitions are in XML format. The variables available for use with a graph are indicated beneath the CustomizedPane tree variable in the script editor. The properties must be passed into the variable GraphProperties and the data must be passed into the variable GraphData. These, and other available variables, are explained below.

GraphProperties variable

Write-only Takes an XML string and creates the columns to be used in the graph. Example: CustomizedPane.CodeObject.GraphProperties = xml string Typically this code would be applied in the OnLoad event, and the data would be applied in the OnRefresh event. To help define the XML string, double-click on this variable in the tree view and the following window will be displayed:

Page 10: Creating Customized Panes in Syspro - Documentation

Page 10 2/14/2008

Enter the required titles and attributes and click on Insert VBScript Code. Make sure you have positioned your cursor in the VBScript editor window first as the program will create the appropriate VBScript code for you and insert it into your code window at the current cursor position. You can now modify and add XML attributes to the GraphProperties as required. Remember that some of these attributes only apply as initial settings to the graph. Once a graph has been created once then any changes to the graph in terms of appearance will be automatically saved and restored. The attributes that cannot be changed by the user include Graph title, X axis title, Y axis title, Allow drag, Allow edit and conditional attributes. The conditional attributes only apply to a scatter graph and allow you to configure point attributes for graph points that meet a configured condition.

GraphData variable Write-only Takes an XML string and populates the graph with the specified data. The data is passed as columns and rows, the same as with a table. Example: CustomizedPane.CodeObject.GraphData = xml string

Page 11: Creating Customized Panes in Syspro - Documentation

Page 11 2/14/2008

To help define the XML string, double-click on this variable in the tree view and the following window will be displayed:

This window shows a sample format of the graph data in the XML string, and you can use it as the basis for your graph. Click on Insert VBScript Code to insert the sample XML code. The format for columns looks like this: <COLUMNS>

<COLUMN NAME="Column1_Name" TYPE="Column1_Type" DESCRIPTION="Column1_Description"

/>

...

COLUMN NAME="ColumnN_Name" TYPE="ColumnN_Type"DESCRIPTION="ColumnN_Description" />

</COLUMNS>

Each bar/column in the graph is represented by the Column element, with a Name attribute to describe the column and the type of value contained in the column identified by the attribute Type; the supported data types are String, Integer, Double, Short, Float, Boolean, Byte and Date. The Description attribute is optional. If it is included, it will be used as a Series or Value legend. If it is not present, the Name will be assigned as a Series or Value legend instead. Every row is then defined using the following format: <ROW Column1_Name="Value" ... ColumnN_Name="Value"/>

As an example, this XML string:

<CHARTFX>

<COLUMNS>

<COLUMN NAME="Product" TYPE="String"/>

<COLUMN NAME="Q1" TYPE="Integer"/>

<COLUMN NAME="Q2" TYPE="Integer"/>

<COLUMN NAME="Q3" TYPE="Integer"/>

<COLUMN NAME="Q4" TYPE="Integer"/>

</COLUMNS>

<ROW Product="ChartFX 98" Q1="9200" Q2="7835" Q3="10245" Q4="8762"/>

Page 12: Creating Customized Panes in Syspro - Documentation

Page 12 2/14/2008

<ROW Product="ChartFX IE 3.5" Q1="14350" Q2="11233" Q3="16754" Q4="987"/>

<ROW Product="ReportFX" Q1="12398" Q2="7654" Q3="5678" Q4="9087"/>

<ROW Product="Image Toppings" Q1="8742" Q2="12358" Q3="14321" Q4="8702"/>

<ROW Product="ChartFX IE 2000" Q1="15672" Q2="17529" Q3="16524" 4="654"/>

<ROW Product="WebBarFX" Q1="6890" Q2="12389" Q3="9804" Q4="10723"/>

<ROW Product="WebTreeFX" Q1="11320" Q2="12908" Q3="6521" Q4="7590"/>

</CHARTFX>

will produce this graph:

BarLabelClicked variable Read-only Contains the label of the bar that was clicked.

BarPointClicked variable

Read-only Contains the point of the bar that was clicked.

BarSeriesClicked variable

Read-only Contains the series of the bar that was clicked.

GraphDataIn variable Read-only Contains the legend name(s) and the graph values separated by a TAB character. This variable is useful if you allowed the user to edit the graph values and you wish to retrieve these values at some point.

Page 13: Creating Customized Panes in Syspro - Documentation

Page 13 2/14/2008

How to implement a List View in a customized pane

A list view consists of two parts: properties (where you define the column headings and other basic information) and data (where you define the data to be populated in a list view). In both cases the definitions are in XML format. The variables available for use with a list view are indicated beneath the CustomizedPane tree variable in the script editor. The properties must be passed into the variable ListviewProperties and the data must be passed into the variable ListviewData. These, and other available variables, are explained below.

ListviewProperties variable

Write-only Takes an XML string and creates the columns to be used in the list view. Example: CustomizedPane.CodeObject.ListviewProperties = xml string The structure of the XML string should be as follows:

<Columns PrimaryNode='Header' Style='form' AutoInsert=’false’> <Column Name='Customer' Link='true' Tooltip=’Click here’ /> <Column Name='DateLastSale' /> <Column Name='HighestBalance' Type=’numeric’ /> <Column Name='Name' Alignment=’center’ HdrAlignment=’left’ /> <Column Name='NumOutstOrd' Description=’Outstanding orders’ /> <Column Name='OutstOrdVal' Total='true' /> <Column Name=’Balance’ Source=’TotalSection/CurrentBalance’ /> </Columns>

The Columns element is the root node, and has the following attributes:

The PrimaryNode is an XML element in the XML data stream, and the column names are child XML elements. The Style element defines whether the list view is to be displayed as a form (Style=‟form‟) or as a data grid (Style=‟DataGrid‟). If the Style element is omitted the default is ‘DataGrid’. The AutoInsert element defines whether the user can add rows to an editable data grid. If the value for this element is true, and at least one column is described as ‘editable’ then when the user TABs off the last cell in the last row then a new row will be opened in the datagrid. The default is false.

The Column element defines a column to be shown, and has the following attributes:

The Name element refers to the name of an XML child element that should exist below the PrimaryNode XML element in the XML stream. This must be an exact match. Note: You can also add columns for XML elements that do not exist as child elements; simply insert a source= attribute to point to a single XML node. For example, source=‟TotalSection/CurrentBalance‟ indicates the element

Page 14: Creating Customized Panes in Syspro - Documentation

Page 14 2/14/2008

CurrentBalance beneath the element TotalSection which is directly beneath the root node. The XML element names must match exactly. The Description element describes the description to be used in the caption in the list view. If this element is omitted then the caption will default to the Name element with capitalized letters replaced with a space character and made lower-case (for example, HighestBalance will be shown as Highest balance). Captions will be automatically translated into the foreign language. You can make cells hyperlinked by adding the Link=‟true‟ element. When you click on a hyperlink the OnLinkClicked event will fire; contents of each cell in the list view row are returned in the variable ListviewRowReturned (see further on for more information). You can make a numeric cell automatically total in a footer row by adding the element Total=‟true‟. You can make a cell editable by adding the element Editable=‟true‟. This will allow the user to modify the contents of this cell. You can retrieve the contents of the list view using the variable CustomizedPane.CodeObject.Array (see the ListviewArrayIn variable). The Tooltip element describes an optional tooltip for the column. The Type element is optional; it defines the type of data in the column. This is normally determined by the system analyzing the contents of the first row inserted into the list view; each cell in the row is analyzed to see if it contains a date field or numeric characters and if so then the column data type is defined. However, there may be occasions when you wish to force the data type for a column, and this can be done by inserting the attribute:

Type=’date’ Type=’numeric’ Type=’alpha’ Type=’address’

The Alignment attribute determines how the field in the column is to be aligned (left, right or center). If this attribute is omitted the default is ‘left’. The HdrAlignment attribute determines how the column header is to be aligned (left, right or center). If this attribute is omitted the default is ‘left’.

The columns will be displayed in the sequence that is indicated in the XML stream. The columns shown above will be displayed in the style of a form as Sales Order, Customer, Order Date and Branch from top to bottom. To make it easier to identify the XML elements, and if you intend to use a standard e.net solutions’ business object, double-click on the ListviewProperties item in the Variables window and a window will be displayed requesting the name of the query business object to be entered. Enter the required business object or press F9 to view a list of available business objects. The program will process the XSD schema associated with the business object and present a list of XML elements in a tree view. Select an XML element and the associated columns for that XML node are displayed. Select the columns you wish to see displayed in the list view and click on Insert VBScript in the toolbar. Make sure you have positioned your cursor in the VBScript

Page 15: Creating Customized Panes in Syspro - Documentation

Page 15 2/14/2008

editor window first as the program will create the appropriate VBScript code for you and insert it into your code window at the current cursor position. Notes:

The columns will be shown in the sequence displayed. You can drag and reposition the columns as required.

If you wish to have a column totaled in the list view footer, then select the checkbox in the Total column. This would make sense only if the column is for a numeric value.

You can have hyperlinked cells by selecting the checkbox in the Hyperlink column. Hyperlinked cells will be displayed in blue and underlined in the list view.

You can make a cell editable by selecting the Editable check box.

You can supply your own tooltip in the Tooltip field.

You can change the descriptions of the columns in the Column Description field.

You can decide on the column alignments.

You can select the data type to override the default setting.

ListviewData variable

Write-only Takes an XML string and populates the list view with XML elements associated with the PrimaryNode as defined in the variable ListviewProperties. Example: CustomizedPane.CodeObject.ListviewData = xml string It’s important to note that only child elements one level below the PrimaryNode will be processed and added to the list view. The structure of this XML string is irrelevant, as long as there exists a parent XML element named as defined in the PrimaryNode. As an example, here’s an XML structure (which matches the ListviewProperties variable indicated above):

<?xml version="1.0" encoding="Windows-1252"?> <ARStatement> <SystemInformation> <CssStyle/> <SeparatorToUse>,</SeparatorToUse> </SystemInformation> <Header> <Customer>0000009</Customer> <Name>Grand Adventures</Name> <DateLastSale>2006-11-09</DateLastSale> <OutstOrdVal> 66850.00</OutstOrdVal> <NumOutstOrd> 2</NumOutstOrd> <HighestBalance> 64500.00</HighestBalance> </Header> </ARStatement>

Notes:

The XML declaration (<?xml…) is not mandatory and can be safely omitted.

The XML element Header can be at any level in the XML structure.

Only child elements below Header will be processed and added to the list view.

Page 16: Creating Customized Panes in Syspro - Documentation

Page 16 2/14/2008

To make it easier to create the XML stream, and if you intend to use a standard e.net solutions’ business object, click on the Call Business Object button on the editor’s toolbar (see How to call a Business Object below). Once to you have created your XML stream you would pass it into the variable ListviewData, as in the following example: CustomizedPane.CodeObject.ListviewData = xmlout

ListviewRowReturned variable Read-only When the user double-clicks on a row in a list view the contents of each cell in a row are returned in this variable. Each cell is separated by a TAB character (a blank cell will still contain a space character before the TAB character). The OnDblClick event can be used to trap the event when you double-click on a row. Note: For a ‘form’ style list view there are 4 cells returned, as explained below: Cell 1

Contains the description (as defined in the ListviewProperties XML document). This field is automatically translated so your original description of ‘Stock code’ will be converted to ‘Code stock’ if you are using French language.

Cell 2 Contains the value of the field.

Cell 3 Contains the original XML element name (this third cell is hidden). You should always use the contents of the third cell for any special coding regarding a row, as the XML element name cannot change but the Description could.

Cell 4 Contains the original English wording for the description based on the original XML element. This is a hidden field and is used to detect for Smart Links.

ListviewArrayIn variable

Read-only Double-click on this variable in the tree view to insert the following variable into the script editor: CustomizedPane.CodeObject.Array This contains an array of all rows and columns in the list view. You should use this variable to interrogate the contents of all cells in all rows in the list view. If you wish to change the contents or attributes of any cell then you should modify the variable ListviewArrayOut. Typically, you would be use this variable in the OnPopulate event, since this event fires when the list view has been updated with new data; you would then iterate through the list view array and modify any cells as appropriate using the ListviewArrayOut array. For example, this statement will interrogate the cell in column 1 in row 2 to see if it contains the value ‘000006’:

if CustomizedPane.CodeObject.Array(0,1)= "0000006" then

Note that the array uses zero-based indexing.

ListviewArrayOut variable

Page 17: Creating Customized Panes in Syspro - Documentation

Page 17 2/14/2008

Write-only Double-click on this variable in the tree view to insert the following variable into the script editor: CustomizedPane_OUT.CodeObject.Array This contains information about cells in the list view that you wish to modify. The array is two-dimensional consisting of columns and rows. For example, this statement will update the cell to be in bold in column 1 in row 2. Note that the array uses zero-based indexing: CustomizedPane_OUT.CodeObject.Array(0,1)="<Field IsBold='true' > </Field>"

ColumnClicked variable

Read-only Contains the column number for the OnLinkClicked event.

Example list view form

Here’s a screenshot of a list view in form style, followed by the VBScript code that created it:

Function CustomizedPane_OnLoad()

dim ListXML

ListXML = "<Columns PrimaryNode='Header' Style='form' >" & _

"<Column Name='Customer' Link='true' />" & _

"<Column Name='DateLastSale' />" & _

"<Column Name='HighestBalance' />" & _

"<Column Name='Name' />" & _

"<Column Name='NumOutstOrd' />" & _

"<Column Name='OutstOrdVal' />" & _

"</Columns>"

CustomizedPane.CodeObject.ListviewProperties = ListXML

End Function

Function CustomizedPane_OnRefresh()

dim XMLOUT

Page 18: Creating Customized Panes in Syspro - Documentation

Page 18 2/14/2008

XMLOUT = "<ARStatement>" & _

"<SystemInformation>" & _

"<CssStyle/>" & _

"<SeparatorToUse>,</SeparatorToUse>" & _

"</SystemInformation>" & _

"<Header>" & _

"<Customer>0000009</Customer>" & _

"<Name>Grand Adventures</Name>" & _

"<DateLastSale>2006-11-09</DateLastSale>" & _

"<OutstOrdVal> 66850.00</OutstOrdVal>" & _

"<NumOutstOrd> 2</NumOutstOrd>" & _

"<HighestBalance> 64500.00</HighestBalance>" & _

"</Header>" & _

"</ARStatement>"

CustomizedPane.CodeObject.ListviewData = XMLOUT

End Function

Page 19: Creating Customized Panes in Syspro - Documentation

Page 19 2/14/2008

How to make a customized pane to be „refreshed‟

You can cause the OnRefresh event to fire in a customized pane in a number of ways:

1. By clicking on the ‘Refresh’ button on the customized pane’s toolbar. 2. Each time the automatic timeout has occurred on the customized pane. You can define

the timeout in the Properties window of the customized pane. 3. When a customized pane is ‘called’ by another form, list view or another customized

pane. This is typically used when you wish to refresh the contents of an object in a customized pane using a key, such as a supplier or customer. To achieve this you open the tree view item CustomizedPanes in the Variables pane of the VBScript editor; a list of all customized panes (shown with their window titles) for the current application will be displayed. Position your cursor in the editor window where you wish to cause a Refresh event and double-click on the required customized pane. This dialog box will be displayed:

Select the type of action you wish to have performed on the customized pane, and click on Insert VBScript Code. For an OnRefresh event the following statement will be inserted into your VBScript code:

CustomizedPanes.CodeObject.ExecutiveFinancialSummary = "xxxxxxx" When the VBScript is executed, this statement will fire the OnRefresh event in the customized pane and pass it the value in the variable RefreshValue; you can place any values you like, such as a supplier code or customer or whatever is appropriate – this value can be retrieved in the called customized pane’s variable RefreshValue. If you have selected to ‘set focus’ to another customized pane then this statement will be inserted:

CustomizedPanes.CodeObject.ExecutiveFinancialSummary = "setFocus" If, at run-time, the referenced customized pane is currently ‘auto-hidden’ then it will be automatically made visible.

Page 20: Creating Customized Panes in Syspro - Documentation

Page 20 2/14/2008

Customized Panes and VBScripts by role

It is important to understand the relationship between forms or list views and other customized panes. If your VBScript code interacts with other customized panes then this is done by referencing the Window title of the customized pane. Thus, if a customized pane’s window title is Stock Information then you would cause a Refresh event on this pane by issuing the VBScript

statement: CustomizedPanes.CodeObject.StockInformation = "doRefresh" The window title Stock Information has been converted into a VBScript variable ending StockInformation. Such variables are generated as a script is about to be executed and are dependent on the available customized panes at that time. This has a couple of important implications:

1. If you subsequently change the window title of the Stock Information pane then this VBScript will fail, which is why you should be careful about changing window titles of customized panes after they have been created. If you changed the window title, in the above example, to be Stock Info, then as the script is about to be executed the variable

CustomizedPanes.CodeObject.StockInfo will be generated. Now your script will

attempt to reference a variable that does not exist and will therefore fail. 2. Using roles you can have different customized panes (and VBScripts) associated with an

application. Again, you may wish to interact with other customized panes; in your script you might have this statement: CustomizedPanes.CodeObject.StockInformation = "doRefresh"

The customized pane you are referencing may, OR MAY NOT, exist for the layout for the current role for the application. It’s at this point you should consider creating VBScripts for each role. This is simple to do by selecting to edit the VBScript for the current role rather than the system-wide script. The VBScript will be saved with the extension of the role-code preceded by an underscore character, as in the example ARSPENLV_001. Such scripts are also saved in the ...work\vbscripts folder on the application server.

Page 21: Creating Customized Panes in Syspro - Documentation

Page 21 2/14/2008

Customized Management and Customized Panes

The Customization Management program (IMPROL) has been modified to cater for customized panes and VBScripts by role as follows:

1. The Customization Management program will show forms and list views with their associated VBScripts. The program will attempt to show the VBScript at the role level first, if it exists, or at the system-wide level next.

2. Customized panes are indicated in the display with the title Customized Pane followed by the window title of that pane. You cannot either reset or copy these panes, because they are linked to the docking pane layout for that role. Clicking on reset or copy for a docking pane layout will also reset/copy any associated customized panes; any VBScripts associated with the customized panes will also be deleted.

3. Both export and import facilities cater for role-based VBScripts. The list of available scripts to export includes both system-wide scripts and scripts at the role level.

Page 22: Creating Customized Panes in Syspro - Documentation

Page 22 2/14/2008

Exporting and Importing Customized Panes

If roles are not in use, then you can export and import customized panes associated with any docking pane. You can also export/import customized panes from your main system menu.

Select the Export Customized Panes option from the pull-down menu:

and this window will be displayed:

Enter the name of the export file, and optionally select to email the export file. The export file will contain the attributes of each the customized panes associated with the current docking pane, and the VBScripts associated with each customized pane. To import customized panes, select the Import… option and this window will be displayed:

Page 23: Creating Customized Panes in Syspro - Documentation

Page 23 2/14/2008

Click on Import to import the customized panes. Notes:

1. Importing customized panes will first reset the current docking pane layout before applying the new customized panes.

2. You can export customized panes from any docking pane and import into a different docking pane layout. For example, you could export customized panes from your main system menu and then import then into your Customer Query application. In other words, the customized panes do not have to be imported into the same docking pane application.

3. The imported customized panes are always added to your existing docking pane layout. So, if you import more than once then the program will continue to add the imported customized panes to your docking pane layout.

4. You can export customized panes from one operator and import them into a different operator.

Page 24: Creating Customized Panes in Syspro - Documentation

Page 24 2/14/2008

Adding XML Attributes to a Graph

The graph object understands many properties to set visual attributes and formatting for your graphs. Some of these are defined when using the GraphProperties wizard. You can determine some of these XML graph properties by creating and showing a graph; now modify the graph visual styles as required and then exit the application. Your graph settings (in XML format) will be saved in your ...base\settings\operator_graphscriptname.xml (example: Phil_graph_IMPMEN01.xml); inspect this file and you can see the various XML formatting options available to apply. Formatting examples:

How to format a tooltip Use the TIPMASK attribute: <TIPMASK></TIPMASK> Variables can be accessed using the % following the variable you want to include: l Shows X-Axis Legend. k Shows X-Axis Key Legend. s Shows Series Legend. S Shows the Series Index. x Shows XValue (XY charts, when they were set with X values). i Shows IniValues (Gantt). v Shows Data Value. v <n> For types that require more than one series, these are replaced by the value of each one. (n represents an index). t Series Total (Sum of all points in this series). p Percentage of total this point represents (Pie). T Point Total (Sum of all series for this point). P Percentage of total this series represents (Used in stacked charts). X displays the marker X value for any chart type including those that do not support X values such as bar. N Shows the index for the point. Example:

<TIPMASK>I'm series: " + "%S " + vblf + " my value is: " + "%v</TIPMASK>

would show this tooltip when hovering over a bar:

How to format the decimals for values By default, the graph object is set to make values formatted to two decimals. If you wish to change this you will need to add a CUSTOMFORMAT attribute. The following example sets the number of decimals to 4 places:

<CUSTOMFORMAT>###,###,##0.0000</CUSTOMFORMAT>

This attribute must be within the <LABELSFORMAT> tag of the ITEM tag, as in this example:

Page 25: Creating Customized Panes in Syspro - Documentation

Page 25 2/14/2008

<AXIS> <ITEM index='0'> <LABELSFORMAT> <CUSTOMFORMAT>###,###,##0.0000</CUSTOMFORMAT> </LABELSFORMAT> <TITLE> <FONT><SIZE>10</SIZE></FONT> <TEXT>Balance in local currency</TEXT> <AREA>Left</AREA> </TITLE> </ITEM>

...

Page 26: Creating Customized Panes in Syspro - Documentation

Page 26 2/14/2008

Technical Information

Information about customized panes is contained in 3 different files as follows: 1. The docking pane layout. This contains references to each of the customized panes

associated with a docking pane layout. This file is ADMLSD.DAT/IDX located in \base\settings on the client or in ADMLAY.DAT/IDX in base\settings on the application server if role-based UI is in use.

2. The customized pane information is stored in the file ADMPNL.DAT/DX in base\settings folder on the client or in ADMLAY.DAT/IDX in base\settings on the application server if roles-based UI is in use.

3. The folder and filename for a VBScript associated with a customized pane depends on the following:

VBScripts for customized panes are located in the ...\settings folder on the client machine if either you are customizing the main system menu (IMPMEN) or roles are not in use. The name of each script is operator_VBS_vbscriptname. For example, if the logged-in operator is ADMIN and you are adding customized panes to the main system menu, then the VBScript file name might be ADMIN_VBS_IMPMEN00.

VBScripts for customized panes for use with roles (with the exception of the main system menu) are located in …\work\vbscripts on the application server.

When a customized pane is added to a docking pane layout, the system creates a unique VBScript name consisting of the docking pane name itself (often the name of the program, such as ARSPEN, followed by the characters LZ) plus a two-digit number starting from 00 upwards. Thus, if you created two customized panes for ARSPEN, you should expect to see two new VBScripts created ARSPENLZ00 and ARSPENLZ01. When a customized pane is deleted, then the VBScript, the record in ADMPNL (or ADMLAY, if role-based UI is in use) and the docking pane itself are all removed. In addition, if the customized pane contained a list view object then the list view settings record (located in base\settings\ADMLSR.DAT, or ADMLAY if role-based UI is in use) is also removed. For a graph object the graph settings XML record in base\settings is deleted. Roaming Users If roles are in use then customized panes information is saved on the application server. This means that you can switch between client desktop computers and, using the same role, you will have the same view of the User Interface. However, the same is not true if roles are not in use or for the main system menu. As explained above, in this circumstance customized panes information and VBScripts are saved in the …\settings folder on the client desktop. This means that if you now switch to another computer and login you will not see the expected views. To overcome this you can use roaming users so that the various files are not saved in the …\settings folder but in the special folder designed for roaming users. When you logout of Windows then your application settings are saved for you on the network and restored when you login on another client machine. FAQs

Why is the main system menu (IMPMEN) excluded from the role-based User Interface? IMPMEN is the operator’s personal desktop for launching SYSPRO applications. It is not an application such as Sales Order Entry, for example. For this reason it is not practical or useful to have the main menu included in the role-based UI. However if you wanted to create an executive view, for example for the CFO of the organization, then the administrator would have to log into the CFO desktop computer as the CFO in order to create an executive view. This would not be practical at all. To overcome this difficulty the administrator can create an executive view on his/her own desktop in SYSPRO and export that view to a text

Page 27: Creating Customized Panes in Syspro - Documentation

Page 27 2/14/2008

file; then the CFO can log into SYSPRO and just import that text file into the customized panes.