Oasys.REPORTER.Item class

Constants

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

Properties

property Item.active: boolean

If item is active or not. Inactive items will be skipped during report/page/item generation

property Item.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

property Item.bottomCrop: integer

Bottom cropping value. Valid for item types Item.IMAGE, Item.IMAGE_FILE, Item.D3PLOT, Item.PRIMER and Item.THIS

property Item.bottomMargin: float

Bottom margin width. Valid for item types Item.TEXTBOX, Item.TEXT_FILE, Item.TABLE and Item.AUTO_TABLE

property Item.columns(readonly): integer

The number of columns in the table. Valid for item types Item.TABLE and Item.AUTO_TABLE

property Item.conditions(readonly): integer

The number of conditions assigned to the item. Valid for item types Item.PROGRAM, Item.TEXT_FILE, Item.TEXT and Item.TEXTBOX

property Item.embed: boolean

If image is embedded or not. Valid for item types Item.IMAGE

property Item.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

property Item.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

property Item.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

property Item.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

property Item.fontSize: integer

Font size for the item (6 <= fontSize <= 72).
Valid for item types Item.TEXT, Item.TEXTBOX, Item.PROGRAM and Item.TEXT_FILE

property Item.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

property Item.generatedRowHeight: float

The height of each generated row in an Autotable. Valid for item type Item.AUTO_TABLE

property Item.headerHeight: float

The height of the header in an Autotable. Valid for item type Item.AUTO_TABLE

property Item.height: float

Height for “rectangular” items (absolute difference between y and y2)

property Item.job: string

Input job file. Valid for item types Item.D3PLOT and Item.THIS

property Item.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

property Item.leftCrop: integer

Left cropping value. Valid for item types Item.IMAGE, Item.IMAGE_FILE, Item.D3PLOT, Item.PRIMER and Item.THIS

property Item.leftMargin: float

Left margin width. Valid for item types Item.TEXTBOX, Item.TEXT_FILE, Item.TABLE and Item.AUTO_TABLE

property Item.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

property Item.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

property Item.lineWidth: float

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

property Item.name: string

Name of the Item

property Item.resolution: integer

Image resolution. Larger values yield a smaller image representation on screen. Valid for item type Item.IMAGE

property Item.rightCrop: integer

Right cropping value. Valid for item types Item.IMAGE, Item.IMAGE_FILE, Item.D3PLOT, Item.PRIMER and Item.THIS

property Item.rightMargin: float

Right margin width. Valid for item types Item.TEXTBOX, Item.TEXT_FILE, Item.TABLE and Item.AUTO_TABLE

property Item.rows(readonly): integer

The number of rows in the table. Valid for item type Item.TABLE

property Item.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

property Item.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

property Item.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

property Item.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

property Item.script: string

The script source text for the item.
Only valid for item type Item.SCRIPT. For Item.SCRIPT_FILE, use the file property

property Item.text: string

The text for the item.
Valid for item types Item.TEXT, Item.TEXTBOX, Item.PROGRAM, Item.TEXT_FILE and Item.SCRIPT

property Item.textColour: Colour object

Colour of text for the item.
Valid for item types Item.TEXT, Item.TEXTBOX, Item.PROGRAM and Item.TEXT_FILE

property Item.topCrop: integer

Top cropping value. Valid for item types Item.IMAGE, Item.IMAGE_FILE, Item.D3PLOT, Item.PRIMER and Item.THIS

property Item.topMargin: float

Top margin width. Valid for item types Item.TEXTBOX, Item.TEXT_FILE, Item.TABLE and Item.AUTO_TABLE

property Item.type(read only): constant

type of the Item. Can be Item.LINE, Item.TEXT etc

property Item.width: float

Width for “rectangular” items (absolute difference between x and x2)

property Item.x: float

X coordinate

property Item.x2: float

Second X coordinate for “rectangular” items

property Item.y: float

Y coordinate

property Item.y2: float

Second Y coordinate for “rectangular” items

Constructor

classmethod Item(page, type, name=Oasys.gRPC.defaultArg, x=Oasys.gRPC.defaultArg, x2=Oasys.gRPC.defaultArg, y=Oasys.gRPC.defaultArg, y2=Oasys.gRPC.defaultArg)

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

Parameters:
Returns:

Item object

Return type:

dict

Example

To create a new blank Item object:

i = Oasys.REPORTER.Item()

Static methods

classmethod Item.GetAll(page)

Get all of the items on a page

Parameters:

page (Page) – Page to get items from

Returns:

List of Item objects

Return type:

list

Example

To get all of the items on page p:

items = Oasys.REPORTER.Item.GetAll(p)
classmethod Item.GetFromName(page, name)

Get an Item from its name

Parameters:
  • page (Page) – Page to get item from

  • name (string) – Item name

Returns:

Item object (or None if item cannot be found)

Return type:

dict

Example

To get the item with name test on page p:

item = Oasys.REPORTER.Item.GetFromName(p, "test")

Instance methods

Item.DeleteColumn(column)

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

Parameters:

column (integer) – The index of the column to delete. Note that indices start from 0

Returns:

No return value

Return type:

None

Example

To delete the second column from table item i:

i.DeleteColumn(1)
Item.DeleteRow(row)

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

Parameters:

row (integer) – The index of the row to delete. Note that indices start from 0

Returns:

No return value

Return type:

None

Example

To delete the second row from table item i:

i.DeleteRow(1)
Item.Generate()

Generate an item

Returns:

No return value

Return type:

None

Example

To generate item i:

i.Generate()
Item.GetCellProperties(row, column)

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

Parameters:
  • 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:

Dict with properties

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 (read only):

(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:

(List 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 (read only):

(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,:py:const:Item.LIBRARY_PROGRAM <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:

dict

Example

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

i.GetCellProperties(0, 0)
Item.GetColumnProperties(column, header)

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

Parameters:
  • 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:

Dict with properties

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:

(List 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,:py:const:Item.LIBRARY_PROGRAM <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:

dict

Example

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

i.GetColumnProperties(0, Reporter.AUTO_TABLE_HEADER)
Item.GetColumnWidth(row)

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

Parameters:

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:

int

Example

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

i.GetColumnWidth(0)
Item.GetCondition(index)

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)

Parameters:

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

Returns:

Dict with properties

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:

dict

Example

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

condition = i.GetCondition(1)
Item.GetAutotableCondition(index, column)

Get the conditional formatting data for an Item.AUTO_TABLE item

Parameters:
  • 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:

Dict with properties

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:

dict

Example

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

condition = i.GetCondition(1, 2)
Item.GetTableCondition(index, row, column)

Get the conditional formatting data for an Item.TABLE item

Parameters:
  • 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:

Dict with properties

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:

dict

Example

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

condition = i.GetCondition(1, 3, 2)
Item.GetGeneratedData(row_index, column_index)

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

Parameters:
  • 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:

str

Example

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

i.GetGeneratedData(0, 0)
Item.GetRowHeight(row)

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

Parameters:

row (integer) – The index of the row of interest. Note that indices start from 0

Returns:

integer

Return type:

int

Example

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

i.GetRowHeight(0)
Item.InsertColumn(column)

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

Parameters:

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

Return type:

None

Example

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

i.InsertColumn(1)
Item.InsertRow(row)

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

Parameters:

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

Return type:

None

Example

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

i.InsertRow(1)
Item.MergeCells(topleftrow, topleftcolumn, rows, columns)

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

Parameters:
  • 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

Return type:

None

Example

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

i.MergeCells(0, 0, 1, 2)
Item.SetCellProperties(properties, row, column)

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

Parameters:
  • properties (dict) –

    An object containing the cell properties

    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,:py:const:Item.LIBRARY_PROGRAM <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

Return type:

None

Example

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

i.SetCellProperties(cell_obj, 0, 0)
Item.SetColumnProperties(properties, column, header)

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

Parameters:
  • properties (dict) –

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

    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,:py:const:Item.LIBRARY_PROGRAM <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

Return type:

None

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)
Item.SetColumnWidth(column, width)

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

Parameters:
  • column (integer) – The index of the column of interest. Note that indices start from 0

  • width (float) – The column width

Returns:

No return value

Return type:

None

Example

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

i.SetColumnWidth(0, 10.0)
Item.SetCondition(condition, properties)

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)

Parameters:
  • 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 (dict) –

    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

    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 (optional):

    (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

Return type:

None

Example

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

obj = {"name" : "example", "type" : Reporter.CONDITION_EQUAL_TO, "value" : "Test", "textColour" : Colour.Red()}
i.SetCondition(1, obj)
Item.SetAutotableCondition(condition, column, properties)

Set the specified condition for an Item.AUTO_TABLE item

Parameters:
  • 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 (dict) –

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

    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 (optional):

    (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

Return type:

None

Example

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

obj = {"name" : "example", "type" : Reporter.CONDITION_EQUAL_TO, "value" : "Test", "textColour" : Colour.Red()}
i.SetCondition(1, 2, obj)
Item.SetTableCondition(condition, row, column, properties)

Set the specified condition for an Item.TABLE item

Parameters:
  • 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 (dict) –

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

    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 (optional):

    (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

Return type:

None

Example

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

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

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

Parameters:
  • row (integer) – The index of the row of interest. Note that indices start from 0

  • height (float) – The row height

Returns:

No return value

Return type:

None

Example

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

i.SetRowHeight(0, 10.0)
Item.UnmergeCells(row, column)

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

Parameters:
  • 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

Return type:

None

Example

To unmerge the top-left cell in a table:

i.UnmergeCells(0, 0)