report.hwxpptxtypes Module#

Image class#

class Image(name=None, **kwargs)#

Bases: CommonProperties

Image class creates new image entity

If ‘name’ value is None, creates new image with unique name.

If ‘name’ value is not None and session of ‘name’ does not exists, then new image gets created with given name.

If ‘name’ value is not None and session of ‘name’ exists, then error thrown.

Parameters:
  • name (str) – Image name.

  • session (str) – Session name. If not specified, uses currently active report session name

  • path (str) – Source image file path.

  • source (str) – Valid values are ‘graphic’ and ‘file’ (default).

setAttributes(**kwargs)#

Method to set multiple attributes.

Parameters:

kwargs (dict) – Valid keywords are name, source, type, path, caption, page, and window.

property binarydata#

The image content as binary data.

Getter:

Gets the image content as binary data.

Setter:

Sets the image content as binary data.

Type:

numpy-ndarray

property caption#

The image caption.

Getter:

Gets the image caption.

Setter:

Sets the image caption.

Type:

str

property ensureFit#

The flag to activate or deactivate the ensure fit.

Getter:

Gets the status of the ensure fit.

Setter:

Sets the status of the ensure fit.

Type:

bool

property name#

The name of the entity.

Getter:

Gets the name of the entity.

Setter:

Sets the name of the entity.

Type:

str

property page: Any#
property path#

The image file path.

Getter:

Gets the image file path.

Setter:

Sets the image file path.

Type:

str

property session#

Returns session to which this entity belongs.

Returns:

Report session

Return type:

ReportSession

property source#

The image source type. Valid values are ‘graphic’ and ‘file’.

Getter:

Gets the image source type.

Setter:

Sets the image source type.

Type:

str

property type#

The image format type. Valid values are ‘jpg’, ‘png’, and ‘bmp’.

Getter:

Gets the image format type.

Setter:

Sets the image format type.

Type:

str

property window: Any#

Layout class#

class Layout(name=None, **kwargs)#

Bases: object

Layout class creates a layout object as a child of the ReportLayout object.

Parameters:

name (str) – Layout name

getPlaceholderInfo()#

Method to print the placeholder details of this layout.

Returns:

Placeholders present in this layout

Return type:

list

property name#

The layout name.

Returns:

Layout name

Return type:

str

Location class#

class Location(layout, **kwargs)#

Bases: object

Location class creates a placeholder object as a child of layout.

Parameters:
  • layout (Layout) – Layout object

  • session (ReportSession) – ReportSession object (optional)

property height#

The location height value.

Getter:

Gets the height value.

Setter:

Sets the height value.

Type:

int

property name#

The name of the Location.

Getter:

Gets the name of the Location.

Setter:

Sets the name of the Location.

Type:

str

property position#

The location and dimensions in the [x, y, width, height] format.

Getter:

Gets the position.

Setter:

Sets the position.

Type:

list

property width#

The location width value.

Getter:

Gets the width value.

Setter:

Sets the width value.

Type:

int

property x#

The location x value.

Getter:

Gets the x value.

Setter:

Sets the x value.

Type:

int

property y#

The location y value.

Getter:

Gets the y value.

Setter:

Sets the y value.

Type:

int

Presentation class#

class Presentation(name=None, **kwargs)#

Bases: CommonProperties

Presentation class creates a new powerpoint presentation object in specified session.

If ‘name’ value is None, creates new presentation with unique name.

If ‘name’ value is not None and no entity of same name exists in specified report session, a new presentation gets created with given name.

If ‘name’ value is not None and entity of same name exists in specified session, an error is returned.

Parameters:

name (str) – Presentation name.

savePDF(path=None, **kwargs)#

Method to save the presentation as a PDF file.

Parameters:
  • path (str) – The presentation file path.

  • kwargs (dict) – Valid keywords are range and open.

savePPTX(path=None, **kwargs)#

Method to save the presentation as a PPTX file.

Parameters:
  • path (str) – The presentation file path.

  • kwargs (dict) – Valid keywords are range, mode, and open.

setAttributes(**kwargs)#

Method to set multiple attributes.

Parameters:

kwargs (dict) – Valid keywords are name, resolution, and template.

size(aspect_ratio)#

Method to set aspect ratio for all slides. Valid values are ‘16:9’, ‘4:3’, and ‘16:10’.

Parameters:

aspect_ratio (str) – Slides aspect ratio

property name#

The name of the entity.

Getter:

Gets the name of the entity.

Setter:

Sets the name of the entity.

Type:

str

property resolution#

The presentation resolution type. Valid values are ‘HD’, ‘UHD’, ‘Desktop’, and ‘Medium’.

Getter:

Gets the presentation resolution type.

Setter:

Sets the presentation resolution type.

Type:

str

property session#

Returns session to which this entity belongs.

Returns:

Report session

Return type:

ReportSession

property template#

The template file used for the PPTX presentation.

Getter:

Gets the template file path.

Setter:

Sets the template file path.

Type:

str

ReportManager class#

class ReportManager(**kwargs)#

Bases: object

ReportManager class can provide information about all available report sessions and the active report session.

getAllSessionNames()#

Method to return list of all available report session names.

Returns:

All report session names

Return type:

list

property activeSession#

The active session.

Getter:

Gets the active session name.

Setter:

Sets the active session.

Type:

str

ReportSession class#

class ReportSession(name=None, **kwargs)#

Bases: object

ReportSession can create new report session or return an existing report session.

If ‘name’ value is None, ReportSession can create new session with unique name.

If ‘name’ value is not None and session of ‘name’ does not exists, then ReportSession creates new session.

If ‘name’ value is not None and session of ‘name’ exists, then ReportSession returns existing session.

Parameters:

value (str) – Report session name

close()#
delete(objects)#

Method to delete entities from the session.

Parameters:

objects (Single object or list of Table | Text | Image | Presentation | Slide | SlideImage | SlideTable | SlideText | Chapter | Document | DocImage | DocTable | DocText) – Entity object to be deleted or list of entity objects to be deleted

get(entity_type, entity_name)#

Method to find and return an entity object based on entity type and name. If not found, returns None.

Parameters:
Returns:

Report entity object

Return type:

Table | Text | Image | Presentation | Slide | SlideImage | SlideTable | SlideText | Chapter | Document

getLayouts(output_type=None)#

Method to return all layout objects or layout names in the session.

Parameters:

output_type (str | None) – Valid values are ‘name’ and None.

Returns:

List of layout names or layout objects

Return type:

list

paste(paste_objects, destination)#

Method to copy entities and create new entities in the destination.

Parameters:
  • paste_objects (Single object or list of DocImage | DocTable | DocText) – Entity object to be pasted or list of entity objects to be pasted

  • destination (Document | Chapter) – Destination object where entity will be pasted

reset()#

Method to delete all entities present in the report session.

property activePresentation#

The active presentation in the report session.

Getter:

Gets the active presentation name.

Setter:

Sets the active presentation.

Type:

str

property name#

Returns report session name.

Returns:

Report session name

Return type:

str

property session#

Slide class#

class Slide(name=None, presentation=None, **kwargs)#

Bases: object

Slide class creates slide object as child of presentation.

If ‘name’ value is None, creates new slide with unique name.

If ‘name’ value is not None and no entity of same name exists in specified report session, a new slide gets created with given name.

If ‘name’ value is not None and any entity of same name exists in specified session, an error is returned.

Parameters:
  • name (str) – Slide name

  • presentation (Presentation) – Presentation object. If not specified, the active presentation is used.

add(obj, name, position=None)#

Method to add a text, image, or table as a child of the slide.

Parameters:
  • obj (Text | Image | Table object) – The object to clone as a slide child

  • name (str) – Name of the entity to be created. It should be unique name in the active session.

  • position (Location | list | str) – Position and dimension for the new object. Can be defined as a location object, a list of values in [x, y, width, height] format, or as a placeholder name.

applySlidePlaceholderList(index)#

Method to enable the slide to use placeholder information of slide available at ‘index’ in presentation.

Parameters:

index (int) – Slide index

layout(value)#

Method to set the slide layout.

Parameters:

value (str) – Layout name

setAttributes(**kwargs)#

Method to set multiple attributes.

Parameters:

kwargs (dict) – Valid keywords are name and titleText.

titlePosition(x, y, width, height)#

Method to set title position for slide title.

Parameters:
  • x (int) – Title x position

  • y (int) – Title y position

  • width (int) – Title width

  • height (int) – Title height

property name#

The name of the slide.

Getter:

Gets the name of the slide.

Setter:

Sets the name of the slide.

Type:

str

property presentation#

Returns the slide parent presentation.

Returns:

Parent presentation

Return type:

Presentation

property titleText#

The text of the slide title.

Getter:

Gets the text of the slide title.

Setter:

Sets the text of the slide title.

Type:

str

SlideImage class#

class SlideImage(**kwargs)#

Bases: SlideLocation

SlideImage creates reference of already existing image (parent of existing image is ReportPalette object). This means any property value changes made in palette image get reflected in SlideImage.

If any changes need to be made to ‘SlideImage’, create copy of image and then update the changes. So that, original image remains unchanged.

Parameters:
  • slide (Slide) – Parent of this slide image.

  • image (Image) – Reference of this image gets created

  • location (Location | list) – Position and dimension information for image as a location object or a list in [x, y, width, height] format

setAttributes(**kwargs)#

Method to set multiple attributes.

Parameters:

kwargs (dict) – Valid keywords are name, source, type, path, caption, position, x, y, width, and height.

property caption#

The image caption.

Getter:

Gets the image caption.

Setter:

Sets the image caption.

Type:

str

property height#

The height value. Valid value range is 0 to 100.

Getter:

Gets the height value.

Setter:

Sets the height value.

Type:

int

property name#

The name of the slide image.

Getter:

Gets the name of the slide image.

Setter:

Sets the name of the slide image.

Type:

str

property path#

The image file path.

Getter:

Gets the image file path.

Setter:

Sets the image file path.

Type:

str

property position#

The location and dimensions in the [x, y, width, height] format, or the placeholder name.

Getter:

Gets the position.

Setter:

Sets the position.

Type:

list | str

property session#

Returns session to which this slide image belongs.

Returns:

Report session

Return type:

ReportSession

property source#

The image source type. Valid values are ‘graphic’ and ‘file’.

Getter:

Gets the image source type.

Setter:

Sets the image source type.

Type:

str

property type#

The image format type. Valid values are ‘jpg’, ‘png’, and ‘bmp’.

Getter:

Gets the image format type.

Setter:

Sets the image format type.

Type:

str

property width#

The width value. Valid value range is 0 to 100.

Getter:

Gets the width value.

Setter:

Sets the width value.

Type:

int

property x#

The location x value. Valid value range is 0 to 100.

Getter:

Gets the x value.

Setter:

Sets the x value.

Type:

int

property y#

The location y value. Valid value range is 0 to 100.

Getter:

Gets the y value.

Setter:

Sets the y value.

Type:

int

SlideLocation class#

class SlideLocation(**kwargs)#

Bases: object

Base class for SlideImage, SlideText, and SlideTable.

setAttributes(key, value)#

Method to set multiple attributes.

Parameters:

kwargs (dict) – Valid keywords are position, x, y, width, and height.

property height#

The height value. Valid value range is 0 to 100.

Getter:

Gets the height value.

Setter:

Sets the height value.

Type:

int

property position#

The location and dimensions in the [x, y, width, height] format, or the placeholder name.

Getter:

Gets the position.

Setter:

Sets the position.

Type:

list | str

property width#

The width value. Valid value range is 0 to 100.

Getter:

Gets the width value.

Setter:

Sets the width value.

Type:

int

property x#

The location x value. Valid value range is 0 to 100.

Getter:

Gets the x value.

Setter:

Sets the x value.

Type:

int

property y#

The location y value. Valid value range is 0 to 100.

Getter:

Gets the y value.

Setter:

Sets the y value.

Type:

int

SlideTable class#

class SlideTable(**kwargs)#

Bases: SlideLocation

SlideTable creates reference of already existing table (parent of existing table is ReportPalette object). This means, any property value changes made in palette table, gets reflected in SlideTable.

If any changes need to be made to ‘SlideTable’, copy of table gets created and then update the changes. So that, original table remains unchanged.

Parameters:
  • slide (Slide) – Parent of this slide table.

  • table (Table) – Reference of this table gets created

  • location (Location | list) – Position and dimension information for table as a location object or a list in [x, y, width, height] format

setAttributes(**kwargs)#

Method to set multiple attributes.

Parameters:

kwargs (dict) – Valid keywords are name, csvFile, caption, split, splitBy, maxRows, maxColumns, position, x, y, width, and height.

property caption#

The table caption.

Getter:

Gets the table caption.

Setter:

Sets the table caption.

Type:

str

property csvFile#

The path of the CSV file loaded as the table data.

Getter:

Gets the table CSV file path.

Setter:

Sets the table CSV file path.

Type:

str

property maxColumns#

The maximum number of columns in the table.

Getter:

Gets the maximum number of columns in the table.

Setter:

Gets the maximum number of columns in the table.

Type:

int

property maxRows#

The maximum number of rows in the table.

Getter:

Gets the maximum number of rows in the table.

Setter:

Gets the maximum number of rows in the table.

Type:

int

property name#

The name of the slide table.

Getter:

Gets the name of the slide table.

Setter:

Sets the name of the slide table.

Type:

str

property session#

Returns session to which this slide table belongs.

Returns:

Report session

Return type:

ReportSession

property split#

The flag to activate or deactivate the table split.

Getter:

Gets the status of the table split.

Setter:

Sets the status of the table split.

Type:

bool

property splitBy#

The rule defining how the table is split. Valid values are ‘rows’ and ‘columns’.

Getter:

Gets the table split rule.

Setter:

Sets the table split rule.

Return type:

str

SlideText class#

class SlideText(**kwargs)#

Bases: SlideLocation

SlideText creates reference of already existing text (Parent of existing text is ReportPalette object). This means, any property value changes made in palette text, gets reflected in SlideText.

If any changes need to be made to ‘SlideText’, copy of text gets created and then update the changes. So that, original text remains unchanged

Parameters:
  • slide (Slide) – Parent of this slide text.

  • text (Text) – Reference of this text gets created

  • location (Location | list) – Position and dimension information for table as a location object or a list in [x, y, width, height] format

setAttributes(**kwargs)#

Method to set multiple attributes.

Parameters:

kwargs (dict) – Valid keywords are name, text, position, x, y, width, height, and alignment.

property alignment#

The text alignment. Valid values are ‘none’, ‘left’, ‘right’, ‘center’, ‘justify’, ‘justifyLow’, and ‘distribute’.

Getter:

Gets the text alignment.

Setter:

Sets the text alignment.

Type:

str

property name#

The name of the slide table.

Getter:

Gets the name of the slide table.

Setter:

Sets the name of the slide table.

Type:

str

property session#

Returns session to which this slide table belongs.

Returns:

Report session

Return type:

ReportSession

property text#

The text content.

Getter:

Gets the text content.

Setter:

Sets the text content.

Type:

str

Table class#

class Table(name=None, **kwargs)#

Bases: CommonProperties

Table class creates table entity.

If ‘name’ value is None, creates new table with unique name.

If ‘name’ value is not None and no entity of same name exists in specified report session, a new table gets created with given name.

If ‘name’ value is not None and any entity of same name exists in specified session, an error is returned.

Parameters:
  • name (str) – Table name.

  • session (ReportSession) – Session name. If not specified, uses currently active report session name.

  • datafile (str) – CSV file path.

addColumn()#

Method to add new column to table.

exportCsv(file: str) int#

Method to export the table content to a CSV file.

Parameters:

file (str) – CSV file path

loadCsv(file: str) int#

Method to loads content of a CSV file to the table entity.

Parameters:

file (str) – CSV file path

removeColumn(index: int)#

Method to remove column at specified index.

Parameters:

col (int) – Column index

removeRow(index: int)#

Method to remove row at specified index.

Parameters:

row (int) – Row index

setAttributes(**kwargs)#

Method to set multiple attributes.

Parameters:

kwargs (dict) – Valid keywords are name, csvFile, caption, split, splitBy, maxRows, maxColumns, and stretch.

setCellValue(row: int, col: int, value)#

Method to set cell value for at particular index.

Parameters:
  • row (int) – Row index

  • col (int) – Column index

setColumnColor(index: int = 0, color: list = [0, 0, 0])#

Method to set column color.

Parameters:
  • index (int) – Column index

  • color (list) – RGB color

setColumnWidth(index: int, width: float)#

Method to set column width.

Parameters:
  • index (int) – Column index

  • width (float) – Column width

setDimension(rows: int, cols: int)#

Method to set number of rows and columns for table.

Parameters:
  • rows (int) – Row count

  • cols (int) – Column count

setRowColor(index: int = 0, color: list = [0, 0, 0])#

Method to set row color.

Parameters:
  • index (int) – Row index

  • color (list) – RGB color

setRowHeight(row_index: int, height: float)#

Method to set row height.

Parameters:
  • index (int) – Row index

  • height (float) – Row height

property autoFilter#

The flag to activate or deactivate autofilter.

Getter:

Gets the status of the autofilter.

Setter:

Sets the status of the autofilter.

Type:

bool

property autoSort#

The flag to activate or deactivate autosort.

Getter:

Gets the status of the autosort.

Setter:

Sets the status of the autosort.

Type:

bool

property autoToolTip#

The flag to activate or deactivate autotooltip.

Getter:

Gets the status of the autotooltip.

Setter:

Sets the status of the autotooltip.

Type:

bool

property borderVisibility#

The table border visibility. An enumeration.

Getter:

Gets the table border visibility.

Setter:

Sets the table border visibility.

Type:

TableBordersVisibility

property caption#

The table caption.

Getter:

Gets the table caption.

Setter:

Sets the table caption.

Type:

str

property columns#

Returns table column count.

Returns:

Column count

Return type:

int

property csvFile#

The path of the CSV file loaded as the table data.

Getter:

Gets the table CSV file path.

Setter:

Sets the table CSV file path.

Type:

str

property fontsize#

The font size.

Getter:

Gets the name of the size.

Setter:

Sets the name of the size.

Type:

str

property name#

The name of the entity.

Getter:

Gets the name of the entity.

Setter:

Sets the name of the entity.

Type:

str

property rows#

Returns table row count.

Returns:

Row count

Return type:

int

property session#

Returns session to which this entity belongs.

Returns:

Report session

Return type:

ReportSession

property stretch#

The flag to activate or deactivate the table stretch.

Getter:

Gets the status of the table stretch.

Setter:

Sets the status of the table stretch.

Type:

bool

TableBordersVisibility class#

enum TableBordersVisibility(value)#

Valid values are as follows:

ALL_BORDERS = <TableBordersVisibility.ALL_BORDERS: 0>#
NO_BORDERS = <TableBordersVisibility.NO_BORDERS: 1>#
BOTTOM = <TableBordersVisibility.BOTTOM: 2>#
TOP = <TableBordersVisibility.TOP: 3>#
LEFT = <TableBordersVisibility.LEFT: 4>#
RIGHT = <TableBordersVisibility.RIGHT: 5>#
INSIDE_HORIZONTAL = <TableBordersVisibility.INSIDE_HORIZONTAL: 6>#
INSIDE_VERTICAL = <TableBordersVisibility.INSIDE_VERTICAL: 7>#
ALL_OUTSIDE = <TableBordersVisibility.ALL_OUTSIDE: 8>#
ALL_INSIDE = <TableBordersVisibility.ALL_INSIDE: 9>#

Text class#

class Text(name=None, **kwargs)#

Bases: CommonProperties

Text class creates a new text entity.

If ‘name’ value is None, creates new text with unique name.

If ‘name’ value is not None and session of ‘name’ does not exists, then new text gets created with given name

If ‘name’ value is not None and session of ‘name’ exists, then error thrown.

Parameters:
  • name (str) – Text entity name

  • session (ReportSession) – Session name. If not specified, uses currently active report session name.

  • text (str) – Text content

addParagraph()#

Method to add new paragraph.

Returns:

Paragraph entity

Return type:

Paragraph

getParagraph(index: int = 0)#

Method to return paragraph present at ‘index’.

Parameters:

index (int) – Index of paragraph in text runs

Returns:

Paragraph entity

Return type:

Paragraph

removeParagraph(index: int)#

Method to remove paragraph present at ‘index’.

Parameters:

index (int) – Index of paragraph in text runs

setAttributes(**kwargs)#

Method to set multiple attributes.

Parameters:

kwargs (dict) – Valid keywords are name, text, ensureFit, and alignment.

property alignment#

The text alignment.

Getter:

Gets the text alignment.

Setter:

Sets the text alignment.

Type:

int

property name#

The name of the entity.

Getter:

Gets the name of the entity.

Setter:

Sets the name of the entity.

Type:

str

property session#

Returns session to which this entity belongs.

Returns:

Report session

Return type:

ReportSession

property text#

The default run text content.

Getter:

Gets the default run text content.

Setter:

Sets the default run text content.

Type:

str