Org Chart Options

From Lianjapedia
Jump to: navigation, search

See Also

Org Chart Section Attributes

Overview

Org Chart Section in Lianja Web Client



Org Chart Sections are used to display an organization chart with clickable nodes.

In the 'Lianja Org Chart Demo' here, clicking a node displays the details for that employee.



Lianja Org Chart Demo

example_orgchart App



The 'Lianja Org Chart Demo' (example_orgchart) is included in the Lianja App Builder distribution to demonstrate the use of an Org Chart Section.


example_orgchart App


Org Chart Section options

Org Chart Section options



Double-click the Section header or click the cog icon to access the Section Attributes.

The Details section at the top of the attributes dialog holds the specification of the database and table.

The Org Chart Section options are described here.


Child ID column

The Child ID column Attribute specifies the column name for the Child ID column (this must be numeric).

The 'Lianja Org Chart Demo' App uses the unique employee ID column:

employeeid

Parent ID column

The Parent ID column Attribute specifies the column name for the Parent ID column (this must be numeric).

The 'Lianja Org Chart Demo' App uses the numeric reference for the person the employee reports to.

reportsto

Caption expression

The Caption expression Attribute specifies an expression that will be evaluated and displayed as the node caption (may contain HTML).

The 'Lianja Org Chart Demo' App uses the employee's first and last names:

trim(firstname)+' '+trim(lastname)

Details expression

The Details expression Attribute specifies an expression that will be evaluated and displayed as the node details beneath the caption (may contain HTML).

The 'Lianja Org Chart Demo' App uses the employee's job title:

title

Child key column

The Child key column Attribute specifies the column that will be passed to the Click and DblClick delegates as an argument.

The 'Lianja Org Chart Demo' App uses the employee's last name:

lastname

Node width

The optional Node width Attribute specifies the display width of the nodes in pixels. The default is 160.

The 'Lianja Org Chart Demo' App specifies a width of 150 pixels:

150

Node height

The optional Node height Attribute specifies the display height of the nodes in pixels. The default is 60.

The 'Lianja Org Chart Demo' App specifies a height of 60 pixels:

60

Dynamic node backcolor

The optional Dynamic node backcolor Attribute specifies the delegate to return the background color for the node for the current record being processed.

The 'Lianja Org Chart Demo' App specifies a delegate:

oc_getBackColor

The delegate is contained in the Custom delegate library as described below.

proc oc_getBackColor()
	if lower(title) = "sales representative"
		return "lightgreen"
	elseif lower(title) = "vice president, sales"
		return "lightpink"
	elseif lower(title) = "sales manager"
		return "lightblue"
	elseif lower(title) = "inside sales coordinator"
		return "beige"
	else
		return ""
	endif
endproc

Dynamic node forecolor

The optional Dynamic node forecolor Attribute specifies the Delegate to return the foreground color for the node for the current record being processed.

This Attribute is not currently supported.

Custom delegate library

The optional Custom delegate library Attribute specifies the custom library containing the dynamic color delegates. The Custom delegate library should be the name of a Lianja script file (.prg). Clicking on the [...] button will automatically generate the name of the script file and take you to the Script Editor in the Apps Workspace to edit the file. It will be loaded as a procedure library by orgchart.rsp.

The 'Lianja Org Chart Demo' App specifies a library:

liboc_page1_section1.prg

This contains the Dynamic node backcolor delegate oc_getBackColor as detailed above.

Filter

The optional Filter Attribute specifies the filter expression that restricts which records will be included in the Org Chart.

The 'Lianja Org Chart Demo' App does not specify a filter, but this could for example be:

country = 'USA'

Other options

The optional Other options Attribute specifies other custom Org Chart options as ampersand-separated option=value pairs.

The 'Lianja Org Chart Demo' App does not specify other options, but this could for example be:

uoption1=value1&uoption2=value2

orgchart.rsp

The rsp Lianja Server Page script (orgchart.rsp) used by the Org Chart Section WebViewWidget is located in the Lianja Library directory.

Client Location
App Builder \lianja\library\
App Center \lianja\cloudserver\tenants\public\library
Web/Mobile Clients \lianja\cloudserver\tenants\public\wwwroot\library

It can be customized if required, but proceed with caution, as the modifications will apply to all Org Chart Sections and will be overwritten by product upgrades.

Alternatively, orgchart.rsp could be used as a template for your own rsp and specified as the URL/source for a WebView Section. The Reports in the 'Lianja Demo' (lianjademo) App use quickreport.rsp in this way.

Notes on Client Support

Attribute Notes
Child ID column -
Parent ID column -
Caption expression -
Details expression -
Child key column -
Node width -
Node height -
Dynamic node backcolor -
Dynamic node forecolor Not currently supported.
Custom delegate library -
Filter -
Other options -