Item#

class ansys.dynamicreporting.core.Item(service: ADR = None, obj_name: str | None = 'default', source: str | None = 'ADR')#

Provides for creating an object that represents an Ansys Dynamic Reporting item.

Create an instance of this class for each item in the database that you want to interact with. When the object is created, no type is set. The type, determined the first time that you set the item_* attribute, cannot be changed.

This code creates an instance with the object my_txt as a text item:

>>> my_txt = adr_service.create_item()
>>> my_txt.item_text = '<h1>The test</h1>This is a text item'

The type of the item created in the preceding code cannot be changed. However, the attributes describing the object can be reset at any time. These changes are automatically propagated into the database. The attributes described in the following “Parameters” section can be used to control the rendering of these objects.

Note

These attributes mirror the generic data item attributes described in Data Items in the documentation for Ansys Dynamic Reporting.

Parameters:
serviceansys.dynamicreporting.core.Service, optional

Ansys Dynamic Reporting object that provides the connection to the database that the item is to interact with. The default is None.

obj_namestr, optional

Name of the item object in the database. The default is default.

sourcestr, optional

Name of the source for the item in the database. The default is "ADR".

Examples

Initialize the Service class inside an Ansys Dynamic Reporting service and create an object as a text item:

import ansys.dynamicreporting.core as adr
adr_service = adr.Service(ansys_installation = r'C:\Program Files\ANSYS Inc\v232')
adr_service.connect(url='http://localhost:8010')
my_txt = adr_service.create_item()
my_txt.item_text = '<h1>The test</h1>This is a text item'

Methods

Item.add_tag([tag, value])

Add a tag to the item.

Item.get_iframe([width, height])

Get the iframe object corresponding to the item.

Item.get_tags()

Get the tags on the item.

Item.rem_tag([tag])

Remove a tag on the item.

Item.set_tags([tagstring])

Set tags on the item.

Item.visualize([new_tab])

Render this item only.

Attributes

Item.url

URL corresponding to the item

Item.item_text

Text (HTML and LaTeX formatting)

Item.item_image

Image object (Image and PNG binary files)

Item.item_scene

3D scene (AVZ, PLY, SCDOC, GLB, and STL files)

Item.item_animation

Animation file (MP4/H.264 format files)

Item.item_table

Table values (Must be in a numpy array)

Item.format

Number format

Item.format_column

Column labels format

Item.labels_column

Column labels

Item.format_row

Row labels format

Item.labels_row

Row labels

Item.plot

Table display style

Item.title

Common title

Item.line_color

Linebarhistogrampiemarker colors

Item.line_marker

Markers

Item.line_marker_text

Marker text

Item.marker_text_rowname

Marker text row name

Item.line_marker_size

Marker size

Item.line_marker_opacity

Marker opacity

Item.line_marker_scale

Marker scaling

Item.line_error_bars

Error bars

Item.line_marker_aux0

Auxiliary data 0

Item.line_marker_aux1

Auxiliary data 1

Item.line_marker_aux2

Auxiliary data 2

Item.line_marker_aux3

Auxiliary data 3

Item.line_marker_aux4

Auxiliary data 4

Item.line_marker_aux5

Auxiliary data 5

Item.line_marker_aux6

Auxiliary data 6

Item.line_marker_aux7

Auxiliary data 7

Item.line_marker_aux8

Auxiliary data 8

Item.line_marker_aux9

Auxiliary data 9

Item.column_minimum

Column range minimums

Item.column_maximum

Column range maximums

Item.line_style

Line styling

Item.line_width

Line width

Item.stacked

Bar chart stacking Deprecated

Item.bar_mode

Bar chart Histogram config mode

Item.xaxis

X axis rows

Item.yaxis

Y axis rows

Item.palette

Color palette

Item.palette_position

Position of the colorbar

Item.palette_range

Range of the colorbar

Item.palette_show

Colorbar display

Item.palette_title

Colorbar title string

Item.histogram_threshold

Histogram rendering threshold

Item.histogram_cumulative

Cumulative histogram

Item.histogram_normalized

Normalize histogram

Item.histogram_bin_size

Histogram bin size

Item.bar_gap

Bar charts bar gap

Item.width

Chart width

Item.height

Chart height

Item.show_legend

Show legend

Item.legend_position

Position the legend

Item.show_legend_border

Show legend border

Item.show_border

Show plot border

Item.plot_margins

Plot margins

Item.plot_title

Plot title

Item.plot_xaxis_type

X axis style

Item.plot_yaxis_type

Y axis style

Item.xrange

X axis range

Item.yrange

Y axis range

Item.xaxis_format

X axis text format

Item.yaxis_format

Y axis text format

Item.xtitle

X axis title

Item.ytitle

Y axis title

Item.item_justification

Table item justification

Item.nan_display

NaN table display value

Item.table_sort

Table sorting

Item.table_title

Table title

Item.align_column

Column value alignment

Item.table_search

Search values

Item.table_page

Table paging

Item.table_pagemenu

Table paging menu

Item.table_scrollx

Horizontal scrolling

Item.table_scrolly

Vertical scrolling

Item.table_bordered

Table bordering

Item.table_condensed

Table compactness

Item.table_wrap_content

Table content wrapping

Item.table_default_col_labels

Default column labels

Item.table_cond_format

Table conditional formatting

Item.row_tags

List of tags for each table row

Item.col_tags

List of tags for each table column