Item class

The Item class gives access to items in Reporter. More...

The REPORTER JavaScript API provides many class constants, properties and methods. For Arup to be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:

Class functions

Member functions

Item constants

Name Description
Item.ARROW Arrow item
Item.AUTO_TABLE Automatic table item
Item.D3PLOT D3PLOT item
Item.ELLIPSE Ellipse item
Item.IMAGE Image item
Item.IMAGE_FILE Image file item
Item.LIBRARY_IMAGE Library image item
Item.LIBRARY_PROGRAM Library program item
Item.LINE Line item
Item.NOTE Note item
Item.PLACEHOLDER Placeholder item
Item.PRIMER PRIMER item
Item.PROGRAM Program item
Item.RECTANGLE Rectangle item
Item.SCRIPT Script item
Item.SCRIPT_FILE Script File item
Item.TABLE Table item
Item.TEXT Text item
Item.TEXTBOX Textbox item
Item.TEXT_FILE Text file item
Item.THIS T/HIS item

Item properties

Name Type Description
active logical If item is active or not. Inactive items will be skipped during report/page/item generation.
autotableType constant Autotable type (whether the data is sourced from a file or a directory). Can be Reporter.AUTO_TABLE_DIRECTORY or Reporter.AUTO_TABLE_FILE. Valid for item type Item.AUTO_TABLE.
bottomCrop integer Bottom cropping value. Valid for item types Item.IMAGE, Item.IMAGE_FILE, Item.D3PLOT, Item.PRIMER and Item.THIS.
bottomMargin real Bottom margin width. Valid for item types Item.TEXTBOX, Item.TEXT_FILE, Item.TABLE and Item.AUTO_TABLE
columns (read only) integer The number of columns in the table. Valid for item types Item.TABLE and Item.AUTO_TABLE
conditions (read only) integer The number of conditions assigned to the item. Valid for item types Item.PROGRAM, Item.TEXT_FILE, Item.TEXT and Item.TEXTBOX
embed logical If image is embedded or not. Valid for item types Item.IMAGE
file string File or directory for item. Valid for item types:
Item.AUTO_TABLE
Item.D3PLOT
Item.IMAGE
Item.IMAGE_FILE
Item.PRIMER
Item.PROGRAM
Item.SCRIPT_FILE
Item.TEXT_FILE
Item.THIS
filetype (read only) string Output file type. Read-only but can be updated by changing the file extension on the item property "file". Valid for item types Item.D3PLOT Item.PRIMER and Item.THIS.
fillColour Colour object Colour of fill for the item.
Valid for item types Item.RECTANGLE, Item.ELLIPSE, Item.TEXTBOX, Item.PROGRAM and Item.TEXT_FILE
fontName string Font for the item e.g. "Courier". Can be any font accessible by REPORTER.
Valid for item types Item.TEXT, Item.TEXTBOX, Item.PROGRAM and Item.TEXT_FILE
fontSize integer Font size for the item (6 <= fontSize <= 72).
Valid for item types Item.TEXT, Item.TEXTBOX, Item.PROGRAM and Item.TEXT_FILE
fontStyle constant Font style for the item. Can be a combination of Reporter.TEXT_NORMAL, Reporter.TEXT_BOLD, Reporter.TEXT_ITALIC or Reporter.TEXT_UNDERLINE
Valid for item types Item.TEXT, Item.TEXTBOX, Item.PROGRAM and Item.TEXT_FILE
generatedRowHeight real The height of each generated row in an Autotable. Valid for item type Item.AUTO_TABLE.
generating (read only) logical true if the item is currently being generated
headerHeight real The height of the header in an Autotable. Valid for item type Item.AUTO_TABLE.
height real Height for "rectangular" items (absolute difference between y and y2). Note that depending on what your object reference corner preference is set to, changing this property will result in different behaviour.
job string Input job file. Valid for item types Item.D3PLOT and Item.THIS.
justify constant Text justification for the item. Can be Reporter.JUSTIFY_CENTRE, Reporter.JUSTIFY_LEFT or Reporter.JUSTIFY_RIGHT combined with Reporter.JUSTIFY_TOP, Reporter.JUSTIFY_MIDDLE or Reporter.JUSTIFY_BOTTOM
Valid for item types Item.TEXT, Item.TEXTBOX, Item.PROGRAM and Item.TEXT_FILE
leftCrop integer Left cropping value. Valid for item types Item.IMAGE, Item.IMAGE_FILE, Item.D3PLOT, Item.PRIMER and Item.THIS.
leftMargin real Left margin width. Valid for item types Item.TEXTBOX, Item.TEXT_FILE, Item.TABLE and Item.AUTO_TABLE
lineColour Colour object Colour of outline for the item.
Valid for item types Item.LINE, Item.ARROW, Item.RECTANGLE, Item.ELLIPSE, Item.TEXTBOX, Item.D3PLOT, Item.PRIMER, Item.THIS, Item.PROGRAM, Item.TEXT_FILE, Item.IMAGE_FILE, Item.TABLE and Item.AUTO_TABLE.
lineStyle constant Style of outline for the item. Can be Reporter.LINE_NONE, Reporter.LINE_SOLID, Reporter.LINE_DASH, Reporter.LINE_DOT, Reporter.LINE_DASH_DOT or Reporter.LINE_DASH_DOT_DOT
Valid for item types Item.LINE, Item.ARROW, Item.RECTANGLE, Item.ELLIPSE, Item.TEXTBOX, Item.D3PLOT, Item.PRIMER, Item.THIS, Item.PROGRAM, Item.TEXT_FILE and Item.IMAGE_FILE.
lineWidth real Width of outline for the item in mm.
Valid for item types Item.LINE, Item.ARROW, Item.RECTANGLE, Item.ELLIPSE, Item.TEXTBOX, Item.D3PLOT, Item.PRIMER, Item.THIS, Item.PROGRAM, Item.TEXT_FILE, Item.IMAGE_FILE, Item.TABLE and Item.AUTO_TABLE
name string Name of the Item
resolution integer Image resolution. Larger values yield a smaller image representation on screen. Valid for item type Item.IMAGE.
rightCrop integer Right cropping value. Valid for item types Item.IMAGE, Item.IMAGE_FILE, Item.D3PLOT, Item.PRIMER and Item.THIS.
rightMargin real Right margin width. Valid for item types Item.TEXTBOX, Item.TEXT_FILE, Item.TABLE and Item.AUTO_TABLE
rows (read only) integer The number of rows in the table. Valid for item type Item.TABLE
saveCSV bool Whether or not a CSV file of the table contents is written when the item is generated. Valid for item types Item.TABLE and Item.AUTO_TABLE
saveCSVFilename string The path and filename of the CSV file written when the item is generated. Valid for item types Item.TABLE and Item.AUTO_TABLE
saveXlsx bool Whether or not a Excel file of the table contents is written when the item is generated. Valid for item types Item.TABLE and Item.AUTO_TABLE
saveXlsxFilename string The path and filename of the Excel file written when the item is generated. Valid for item types Item.TABLE and Item.AUTO_TABLE
script string The script source text for the item.
Only valid for item type Item.SCRIPT. For Item.SCRIPT_FILE, use the file property.
text string The text for the item.
Valid for item types Item.TEXT, Item.TEXTBOX, Item.PROGRAM, Item.TEXT_FILE and Item.SCRIPT
textColour Colour object Colour of text for the item.
Valid for item types Item.TEXT, Item.TEXTBOX, Item.PROGRAM and Item.TEXT_FILE
topCrop integer Top cropping value. Valid for item types Item.IMAGE, Item.IMAGE_FILE, Item.D3PLOT, Item.PRIMER and Item.THIS.
topMargin real Top margin width. Valid for item types Item.TEXTBOX, Item.TEXT_FILE, Item.TABLE and Item.AUTO_TABLE
type (read only) constant type of the Item. Can be Item.LINE, Item.TEXT etc.
width real Width for "rectangular" items (absolute difference between x and x2). Note that depending on what your object reference corner preference is set to, changing this property will result in different behaviour.
x real X coordinate
x2 real Second X coordinate for "rectangular" items
y real Y coordinate
y2 real Second Y coordinate for "rectangular" items

Detailed Description

The Item class allows you to access the items in templates that Reporter currently has open.

Constructor

new Item(page[Page], type[constant], name (optional)[string], x (optional)[real], x2 (optional)[real], y (optional)[real], y2 (optional)[real])

Description

Create a new Item. The name and coordinates arguments are optional. Item.TABLE items are constructed with two rows and two columns by default. If you require only one row or column, use DeleteRow and DeleteColumn.

Arguments

  • page (Page)

    Page to create item in

  • type (constant)

    Item type. Can be Item.LINE, Item.ARROW, Item.RECTANGLE, Item.ELLIPSE, Item.TEXT, Item.TEXTBOX, Item.IMAGE, Item.PROGRAM, Item.D3PLOT, Item.PRIMER, Item.THIS, Item.TEXT_FILE, Item.IMAGE_FILE, Item.LIBRARY_IMAGE, Item.LIBRARY_PROGRAM, Item.TABLE, Item.AUTO_TABLE, Item.SCRIPT, Item.SCRIPT_FILE, Item.NOTE or Item.PLACEHOLDER.

  • name (optional) (string)

    Name of item

  • x (optional) (real)

    X coordinate

  • x2 (optional) (real)

    Second X coordinate for "rectangular" items

  • y (optional) (real)

    Y coordinate

  • y2 (optional) (real)

    Second Y coordinate for "rectangular" items

    Returns

    Item object

    Return type

    Item

    Example

    To create a new blank Item object:

    var i = new Item();

    Details of functions

    DeleteColumn(column[integer])

    Description

    Delete a column from a table. Valid for item type Item.TABLE and Item.AUTO_TABLE.

    Arguments

  • column (integer)

    The index of the column to delete. Note that indices start from 0.

    Returns

    No return value

    Example

    To delete the second column from table item i:

    i.DeleteColumn(1);


    DeleteRow(row[integer])

    Description

    Delete a row from a table. Valid for item type Item.TABLE.

    Arguments

  • row (integer)

    The index of the row to delete. Note that indices start from 0.

    Returns

    No return value

    Example

    To delete the second row from table item i:

    i.DeleteRow(1);


    Generate()

    Description

    Generate an item.

    Arguments

    No arguments

    Returns

    No return value

    Example

    To generate item i:

    i.Generate();


    GetAll(page[Page]) [static]

    Description

    Get all of the items on a page.

    Arguments

  • page (Page)

    Page to get items from.

    Returns

    Array of Item objects

    Return type

    Array

    Example

    To get all of the items on page p:

    var items = Item.GetAll(p);


    GetCellProperties(row[integer], column[integer])

    Description

    Get the properties of the specified cell. Valid for item type Item.TABLE.

    Arguments

  • row (integer)

    The row index of the cell of interest. Note that indices start from 0.

  • column (integer)

    The column index of the cell of interest. Note that indices start from 0.

    Returns

    Object with the following properties:

    Name Type Description
    bottomBorderWidth real Cell bottom border width. Can be 0.0, 0.1, 0.5, 0.75, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0. Other values will result in no border.
    colspan integer Number of columns this cell spans (for merged cells). 1 if not merged. Use columnMergeOrigin to find top-left cell.
    column integer The column index
    columnMergeOrigin integer The column index of the top-left cell in this merge cell group (if cell not merged then == column).
    conditions integer Number of conditions assigned to this cell.
    fillColour Colour object Fill colour
    fontName string Font name (e.g. "Courier").
    fontSize integer Font size (between 6 and 72).
    fontStyle integer Font style. See Text style constants for details.
    height real Cell height. Modifying this property will modify the height of all cells in the row.
    hyperlinkHTML string Hyperlink destination for HTML.
    hyperlinkPDF string Hyperlink destination for PDF.
    hyperlinkReport string Hyperlink destination for Report or page within Report.
    justify integer Text justification for the item. Same rules as justify property of Item Class.
    output string The output text from a Program or Library Program cell.
    prefix string Prefix text to appear before Library Program output.
    program string Path and filename for a Program cell, or the filename (e.g. title.js) for a Library Program cell.
    programArgs Array of strings Program arguments
    rightBorderWidth real Cell right border width. Can be 0.0, 0.1, 0.5, 0.75, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0. Other values will result in no border.
    row integer The cell row index.
    rowMergeOrigin integer The row index of the top-left cell in this merge cell group (if cell not merged then == row).
    rowSpan integer Number of rows this cell spans (for merged cells). == 1 if not merged. Use rowMergeOrigin to find top-left cell.
    suffix string Suffix text to appear after Library Program output.
    text string The cell text. For Program and Library Program cells, use the prefix, output and suffix properties.
    textColour Colour object Colour of text
    topBorderWidth real Cell top border width. Can be 0.0, 0.1, 0.5, 0.75, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0. Other values will result in no border.
    type integer Can be Item.TEXT,Item.LIBRARY_PROGRAM or Item.PROGRAM.
    variable string REPORTER variable for library program output.
    width real Cell width. Modifying this property will modify the width of all cells in the column.

    Return type

    object

    Example

    To get the properties of the top-left cell in a table:

    i.GetCellProperties(0, 0);


    GetColumnProperties(column[integer], header[constant])

    Description

    Get an autotable column properties. Valid for item type Item.AUTO_TABLE.

    Arguments

  • column (integer)

    The index of the column of interest. Note that indices start from 0.

  • header (constant)

    An argument to signify to get the properties of the header or the generated rows. Can be Reporter.AUTO_TABLE_HEADER or Reporter.AUTO_TABLE_ROWS.

    Returns

    Object with the following properties:

    Name Type Description
    conditions integer Number of conditions assigned to this cell.
    fillColour Colour object Fill colour
    fontName string Font name (e.g. "Courier").
    fontSize integer Font size (between 6 and 72).
    fontStyle integer Font style. Same rules as fontStyle property of
    hyperlinkHTML string Hyperlink destination for HTML.
    hyperlinkPDF string Hyperlink destination for PDF.
    hyperlinkReport string Hyperlink destination for Report or page within Report.
    justify integer Text justification for the item. Same rules as justify property of Item Class.
    program string Path and filename for a Program cell, or the filename (e.g. title.js) for a Library Program cell.
    programArgs Array of strings Program arguments
    text string The cell text. For Program and Library Program cells, use the prefix, output and suffix properties.
    textColour Colour object Colour of text
    type integer Can be Item.TEXT,Item.LIBRARY_PROGRAM or Item.PROGRAM.
    width real Cell width. Modifying this property will modify the width of all cells in the column.

    Return type

    object

    Example

    Returns the column properties of the header of the first column:

    i.GetColumnProperties(0, Reporter.AUTO_TABLE_HEADER);


    GetColumnWidth(row[integer])

    Description

    Get the width of a table column. Valid for item types Item.TABLE or Item.AUTO_TABLE.

    Arguments

  • row (integer)

    The index of the column of interest. Note that indices start from 0.

    Returns

    Integer. The width of the specified column.

    Return type

    Number

    Example

    To get the width of the first column in a table:

    i.GetColumnWidth(0);


    GetCondition(index[integer])

    Description

    Get the conditional formatting data for an item. Valid for item types Item.TEXT_FILE, Item.PROGRAM, Item.TEXT or Item.TEXTBOX (for Item.AUTO_TABLE and Item.TABLE, see GetCondition functions with additional arguments below).

    Arguments

  • index (integer)

    The index of the condition to get. Note that indices start from 0. See conditions for the total number of comditions

    Returns

    Object with the following properties:

    Name Type Description
    fillColour Colour object Fill colour
    fontName string Font name (e.g. "Courier").
    fontSize integer Font size (between 6 and 72).
    fontStyle integer Font style. See Text style constants for details.
    justify integer Text alignment for the item. See Justification constants for details.
    name string Condition name
    textColour Colour object Colour of text
    type integer See Condition types constants for details.
    value string First condition value
    value2 string Second condition value (where relevant)

    Return type

    object

    Example

    To get the data for the 2nd condition in item i:

    var condition = i.GetCondition(1);


    GetCondition(index[integer], column[integer])

    Description

    Get the conditional formatting data for an Item.AUTO_TABLE item.

    Arguments

  • index (integer)

    The index of the condition to get. Note that indices start from 0.

  • column (integer)

    The column to get the condition from. Note that indices start from 0.

    Returns

    Object with the following properties:

    Name Type Description
    fillColour Colour object Fill colour
    fontName string Font name (e.g. "Courier").
    fontSize integer Font size (between 6 and 72).
    fontStyle integer Font style. See Text style constants for details.
    justify integer Text alignment for the item. See Justification constants for details.
    name string Condition name
    textColour Colour object Colour of text
    type integer See Condition types constants for details.
    value string First condition value
    value2 string Second condition value (where relevant)

    Return type

    object

    Example

    To get the data for the 2nd condition from the 3rd column in autotable item i:

    var condition = i.GetCondition(1, 2);


    GetCondition(index[integer], row[integer], column[integer])

    Description

    Get the conditional formatting data for an Item.TABLE item.

    Arguments

  • index (integer)

    The index of the condition to get. Note that indices start from 0.

  • row (integer)

    The cell row to get the condition from. Note that indices start from 0.

  • column (integer)

    The cell column to get the condition from. Note that indices start from 0.

    Returns

    Object with the following properties:

    Name Type Description
    fillColour Colour object Fill colour
    fontName string Font name (e.g. "Courier").
    fontSize integer Font size (between 6 and 72).
    fontStyle integer Font style. See Text style constants for details.
    justify integer Text alignment for the item. See Justification constants for details.
    name string Condition name
    textColour Colour object Colour of text
    type integer See Condition types constants for details.
    value string First condition value
    value2 string Second condition value (where relevant)

    Return type

    object

    Example

    To get the data for the 2nd condition from the 4th row, 3rd column in table item i:

    var condition = i.GetCondition(1, 3, 2);


    GetFromName(page[Page], name[string]) [static]

    Description

    Get an Item from its name.

    Arguments

  • page (Page)

    Page to get item from

  • name (string)

    Item name

    Returns

    Item object (or null if item cannot be found)

    Return type

    Item

    Example

    To get the item with name test on page p:

    var item = Item.GetFromName(p, "test");


    GetGeneratedData(row_index[integer], column_index[integer])

    Description

    Get the text that appears in an autotable cell once generated. Valid for item type Item.AUTO_TABLE.

    Arguments

  • row_index (integer)

    The index of the row of interest. Note that indices start from 0.

  • column_index (integer)

    The index of the column of interest. Note that indicies start from 0.

    Returns

    String: the text displayed in the specified row and column.

    Return type

    String

    Example

    Get the data from the first cell in the first row and column in an autotable.

    i.GetGeneratedData(0, 0);


    GetRowHeight(row[integer])

    Description

    Get the height of a table row. Valid for item type Item.TABLE.

    Arguments

  • row (integer)

    The index of the row of interest. Note that indices start from 0.

    Returns

    integer

    Return type

    Number

    Example

    To get the height of the first row in a table:

    i.GetRowHeight(0);


    InsertColumn(column[integer])

    Description

    Insert a column into a table. Valid for item types Item.TABLE and Item.AUTO_TABLE.

    Arguments

  • column (integer)

    The index of the position where the inserted column will end up. Note that indices start from 0. If no argument is given, a column will be added to the bottom of the table.

    Returns

    No return value

    Example

    To insert a column that will become the second column from the left of the table:

    i.InsertColumn(1);


    InsertRow(row[integer])

    Description

    Insert a row into a table. Valid for item type Item.TABLE.

    Arguments

  • row (integer)

    The index of the position where the inserted row will end up. Note that indices start from 0. If no argument is given, a row will be added to the bottom of the table.

    Returns

    No return value

    Example

    To insert a row that will become the second row from the top of the table:

    i.InsertRow(1);


    MergeCells(topLeftRow[integer], topLeftColumn[integer], rows[integer], columns[integer])

    Description

    Merge specified cells in a table. Valid for item types Item.TABLE and Item.AUTO_TABLE.

    Arguments

  • topLeftRow (integer)

    The row index of the top-left cell in the group of cells to be merged. Note that indices start from 0.

  • topLeftColumn (integer)

    The column index of the top-left cell in the group of cells to be merged. Note that indices start from 0.

  • rows (integer)

    The number of rows of cells to be merged (measured from the topLeftRow position).

  • columns (integer)

    The number of columns of cells to be merged (measured from the topLeftColumn position).

    Returns

    No return value

    Example

    To merge the cells in first row and the first two columns in the table:

    i.MergeCells(0, 0, 1, 2);


    RemoveCondition(condition[integer])

    Description

    Remove the specified condition for an item. Valid for item types Item.TEXT_FILE, Item.PROGRAM, Item.TEXT or Item.TEXTBOX (for Item.AUTO_TABLE and Item.TABLE, see RemoveCondition functions with additional arguments below).

    Arguments

  • condition (integer)

    The index of the condition you wish to remove. Note that indices start at 0.

    Returns

    No return value

    Example

    To remove the condition for the condition index 1 in item i:

    i.RemoveCondition(1);


    RemoveCondition(condition[integer], column[integer])

    Description

    Remove the specified condition for an Item.AUTO_TABLE item.

    Arguments

  • condition (integer)

    The index of the condition you wish to remove. Note that indices start at 0.

  • column (integer)

    The column to remove the condition for. Note that indices start from 0.

    Returns

    No return value

    Example

    To remove the condition for condition index 1 in the third column in item i:

    i.RemoveCondition(1, 2);


    RemoveCondition(condition[integer], row[integer], column[integer])

    Description

    Remove the specified condition for an Item.TABLE item.

    Arguments

  • condition (integer)

    The index of the condition you wish to remove. Note that indices start at 0.

  • row (integer)

    The row to remove the condition for. Note that indices start from 0.

  • column (integer)

    The column to remove the condition for. Note that indices start from 0.

    Returns

    No return value

    Example

    To remove the condition for condition index 1 in the fourth row, third column in item i:

    i.RemoveCondition(1, 3, 2);


    SetCellProperties(properties[object], row[integer], column[integer])

    Description

    Set the properties of the specified cell. Valid for item type Item.TABLE.

    Arguments

  • properties (object)

    An object containing the cell properties.

    Object has the following properties:

    Name Type Description
    bottomBorderWidth (optional) real Cell bottom border width. Can be 0.0, 0.1, 0.5, 0.75, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0. Other values will result in no border.
    fillColour (optional) Colour object Fill colour
    fontName (optional) string Font name (e.g. "Courier").
    fontSize (optional) integer Font size (between 6 and 72).
    fontStyle (optional) integer Font style. See Text style constants for details.
    hyperlinkHTML (optional) string Hyperlink destination for HTML.
    hyperlinkPDF (optional) string Hyperlink destination for PDF.
    hyperlinkReport (optional) string Hyperlink destination for Report or page within Report.
    justify (optional) integer Text justification for the item. Same rules as justify property of Item Class.
    prefix (optional) string Prefix text to appear before Library Program output.
    program (optional) string Path and filename for a Program cell, or the filename (e.g. title.js) for a Library Program cell.
    programArgs (optional) Array of strings Program arguments
    rightBorderWidth (optional) real Cell right border width. Can be 0.0, 0.1, 0.5, 0.75, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0. Other values will result in no border.
    suffix (optional) string Suffix text to appear after Library Program output.
    text (optional) string The cell text. For Program and Library Program cells, use the prefix, output and suffix properties.
    textColour (optional) Colour object Colour of text
    topBorderWidth (optional) real Cell top border width. Can be 0.0, 0.1, 0.5, 0.75, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0. Other values will result in no border.
    type (optional) integer Can be Item.TEXT,Item.LIBRARY_PROGRAM or Item.PROGRAM.
    variable (optional) string REPORTER variable for library program output.

  • row (integer)

    The row index of the cell to be modified. Note that indices start from 0.

  • column (integer)

    The column index of the cell to be modified. Note that indices start from 0.

    Returns

    No return value

    Example

    To set the properties of the cell object to those of the object cell_obj:

    i.SetCellProperties(cell_obj, 0, 0);


    SetColumnProperties(properties[object], column[integer], header[constant])

    Description

    Set the properties of an autotable column. Valid for item type Item.AUTO_TABLE.

    Arguments

  • properties (object)

    Set the properties of an autotable column. Valid for item type Item.AUTO_TABLE.

    Object has the following properties:

    Name Type Description
    fillColour (optional) Colour object Fill colour
    fontName (optional) string Font name (e.g. "Courier").
    fontSize (optional) integer Font size (between 6 and 72).
    fontStyle (optional) integer Font style. Same rules as fontStyle property of
    hyperlinkHTML (optional) string Hyperlink destination for HTML.
    hyperlinkPDF (optional) string Hyperlink destination for PDF.
    hyperlinkReport (optional) string Hyperlink destination for Report or page within Report.
    justify (optional) integer Text justification for the item. Same rules as justify property of Item Class.
    program (optional) string Path and filename for a Program cell, or the filename (e.g. title.js) for a Library Program cell.
    programArgs (optional) Array of strings Program arguments
    text (optional) string The cell text. For Program and Library Program cells, use the prefix, output and suffix properties.
    textColour (optional) Colour object Colour of text
    type (optional) integer Can be Item.TEXT,Item.LIBRARY_PROGRAM or Item.PROGRAM.

  • column (integer)

    The index of the column of interest. Note that indices start from 0.

  • header (constant)

    An argument to signify to set the properties of the header or the generated rows. Can be Reporter.AUTO_TABLE_HEADER or Reporter.AUTO_TABLE_ROWS.

    Returns

    No return value

    Example

    Sets the column properties of the header of the first column with the properties of the object column_obj.

    i.SetColumnProperties(column_obj, 0, Reporter.AUTO_TABLE_HEADER);


    SetColumnWidth(column[integer], width[real])

    Description

    Set the width of a table column. Valid for item type Item.TABLE.

    Arguments

  • column (integer)

    The index of the column of interest. Note that indices start from 0.

  • width (real)

    The column width.

    Returns

    No return value

    Example

    To set the width of the first column in a table to 10.0:

    i.SetColumnWidth(0, 10.0);


    SetCondition(condition[integer], properties[object])

    Description

    Set the specified condition for an item. Valid for item types Item.TEXT_FILE, Item.PROGRAM, Item.TEXT or Item.TEXTBOX (for Item.AUTO_TABLE and Item.TABLE, see SetCondition functions with additional arguments below).

    Arguments

  • condition (integer)

    The index of the condition you wish to set. Note that indices start at 0. If a condition already exists at the specified index, it will be replaced. To add a new condition, specify an index equal to the number of existing conditions.

  • properties (object)

    The index of the condition you wish to set. Note that indices start at 0. If a condition already exists at the specified index, it will be replaced. To add a new condition, specify an index equal to the number of existing conditions.

    Object has the following properties:

    Name Type Description
    fillColour (optional) Colour object Fill colour
    fontName (optional) string Font name (e.g. "Courier").
    fontSize (optional) integer Font size (between 6 and 72).
    fontStyle (optional) integer Font style. See Text style constants for details.
    justify (optional) integer Text alignment for the item. See Justification constants for details.
    name string Condition name
    textColour (optional) Colour object Colour of text
    type (optional) integer See Condition types constants for details.
    value (optional) string First condition value
    value2 (optional) string Second condition value (where relevant)

    Returns

    No return value

    Example

    To set the conditions for the condition index 1 in item i to those of the object obj:

    var obj = { name:"example", type:Reporter.CONDITION_EQUAL_TO, value:"Test", textColour:Colour.Red() };
    i.SetCondition(1, obj);


    SetCondition(condition[integer], column[integer], properties[object])

    Description

    Set the specified condition for an Item.AUTO_TABLE item.

    Arguments

  • condition (integer)

    The index of the condition you wish to set. Note that indices start at 0. If a condition already exists at the specified index, it will be replaced. To add a new condition, specify an index equal to the number of existing conditions.

  • column (integer)

    The column to set the condition for. Note that indices start from 0.

  • properties (object)

    The column to set the condition for. Note that indices start from 0.

    Object has the following properties:

    Name Type Description
    fillColour (optional) Colour object Fill colour
    fontName (optional) string Font name (e.g. "Courier").
    fontSize (optional) integer Font size (between 6 and 72).
    fontStyle (optional) integer Font style. See Text style constants for details.
    justify (optional) integer Text alignment for the item. See Justification constants for details.
    name string Condition name
    textColour (optional) Colour object Colour of text
    type (optional) integer See Condition types constants for details.
    value (optional) string First condition value
    value2 (optional) string Second condition value (where relevant)

    Returns

    No return value

    Example

    To set the conditions for condition index 1 in the third column in item i to those of the object obj:

    var obj = { name:"example", type:Reporter.CONDITION_EQUAL_TO, value:"Test", textColour:Colour.Red() };
    i.SetCondition(1, 2, obj);


    SetCondition(condition[integer], row[integer], column[integer], properties[object])

    Description

    Set the specified condition for an Item.TABLE item.

    Arguments

  • condition (integer)

    The index of the condition you wish to set. Note that indices start at 0. If a condition already exists at the specified index, it will be replaced. To add a new condition, specify an index equal to the number of existing conditions.

  • row (integer)

    The row to set the condition for. Note that indices start from 0.

  • column (integer)

    The column to set the condition for. Note that indices start from 0.

  • properties (object)

    The column to set the condition for. Note that indices start from 0.

    Object has the following properties:

    Name Type Description
    fillColour (optional) Colour object Fill colour
    fontName (optional) string Font name (e.g. "Courier").
    fontSize (optional) integer Font size (between 6 and 72).
    fontStyle (optional) integer Font style. See Text style constants for details.
    justify (optional) integer Text alignment for the item. See Justification constants for details.
    name string Condition name
    textColour (optional) Colour object Colour of text
    type (optional) integer See Condition types constants for details.
    value (optional) string First condition value
    value2 (optional) string Second condition value (where relevant)

    Returns

    No return value

    Example

    To set the conditions for condition index 1 in the fourth row, third column in item i to those of the object obj:

    var obj = { name:"example", type:Reporter.CONDITION_EQUAL_TO, value:"Test", textColour:Colour.Red()
    }; i.SetCondition(1, 3, 2, obj);


    SetRowHeight(row[integer], height[real])

    Description

    Set the height of a table row. Valid for item type Item.TABLE and Item.AUTO_TABLE.

    Arguments

  • row (integer)

    The index of the row of interest. Note that indices start from 0.

  • height (real)

    The row height.

    Returns

    No return value

    Example

    To set the height of the first row in a table to 10.0:

    i.SetRowHeight(0, 10.0);


    UnmergeCells(row[integer], column[integer])

    Description

    Unmerge the specified cell in a table. All cells merged to the specified cell will be unmerged. Valid for item types Item.TABLE and Item.AUTO_TABLE.

    Arguments

  • row (integer)

    The row index of the cell to be unmerged. Note that indices start from 0.

  • column (integer)

    The column index of the cell to be unmerged. Note that indices start from 0..

    Returns

    No return value

    Example

    To unmerge the top-left cell in a table:

    i.UnmergeCells(0, 0);