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 alignment#

Image alignment. Valid values are ‘none’, ‘left’, ‘right’, ‘center’, ‘justify’ and ‘distribute’.

Getter:

Gets image alignment.

Setter:

Sets image alignment.

Type:

str

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 captionposition#

Image caption position. Valid values are ‘bottom’ and ‘top’. Default is ‘bottom’.

Getter:

Gets caption position.

Setter:

Sets caption position.

Type:

str

property crop#

Flag to crop the image empty white-space around model while getting captured from GUI. Valid only when source is ‘graphic’.

Getter:

Gets status of crop.

Setter:

Sets status of crop.

Type:

bool

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 format#

Get or set the format of the image when image is captured from GUI. Valid only when source is ‘graphic’. Valid values are ‘png’, ‘jpg’, ‘gif’, ‘avi’, ‘mp4’, ‘glb’ and ‘h3d’.

Getter:

Gets the image format.

Setter:

Sets the image format.

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 page#

Get or set the page id to capture image. Valid only when the source of image is ‘graphic’.

Getter:

Gets page id.

Setter:

Sets page id.

Type:

int

property path#

The image file path.

Getter:

Gets the image file path.

Setter:

Sets the image file path.

Type:

str

property previewImage#

Enable/disable preview image for GLB or H3D model. Enabling this flag assumes preview image is present in the same directory as the model file. The preview image should be PNG image where its name is same as model name with the suffix ‘_pv’.

Getter:

Gets the status of the preview image.

Setter:

Sets the status of the preview image.

Type:

bool

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#

Get or set window id to capture image. This is applicable only when source is ‘graphic’.

Getter:

Gets window id.

Setter:

Sets window id.

Type:

int

Layout class#

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

Bases: object

Layout class creates a layout 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

MsBulletType class#

enum MsBulletType(value)#

Valid values are as follows:

BulletMixed = <MsBulletType.BulletMixed: -2>#
BulletNone = <MsBulletType.BulletNone: 0>#
BulletNumbered = <MsBulletType.BulletNumbered: 2>#
BulletPicture = <MsBulletType.BulletPicture: 3>#
BulletUnnumbered = <MsBulletType.BulletUnnumbered: 1>#

Paragraph class#

class Paragraph(parent=None, name: str = None, **kwargs)#

Bases: object

Class representing a Paragraph object. Each paragraph object represents text or a block of different texts formats inserted in a paragraph. Existing paragraph can be fetched using getParagraph method of a Text object. New paragraph can be created/added with Text object as parent.

Parameters:
  • parent (Text) – Parent of this paragraph.

  • name (str) – Name of this Paragraph. Optional

addRun(text: str | None = '', equation: str | None = None, font_name: str | None = '', font_size: int | None = 9, font_color: List[int] | None = [0, 0, 0], bold: bool | None = False, italic: bool | None = False, underline: bool | None = False, line_break: bool | None = False, tab_space: bool | None = False, image_path: str | None = '', hyperlink: str | None = '', image_stream: ndarray | None = None)#

Method to add a Run object (text) in the current Paragraph object.

Parameters:
  • text (str) – New run text.

  • equation (str) – New run equation.

  • font_name (str) – New run font name

  • font_size (int) – New run font size.

  • font_color (List[int]) – New run font color.

  • bold (bool) – New run bold status.

  • italic (bool) – New run italic status.

  • underline (bool) – New run underline status.

  • line_break (bool) – New run linebreak status.

  • tab_space (bool) – New run tabspace status.

  • image_path (str) – New run image path.

  • hyperlink (str) – New run hyperlink.

  • image_stream (numpy.ndarray) – New run image stream.

getRun(index: int = 0)#

Return run or equation object present at ‘index’ in the paragraph.

Parameters:

index (int) – Index of run in paragraph.

Returns:

Run or Equation object.

Return type:

Run or Equation

removeRun(index: int)#

Method to remove run or equation object present at ‘index’ in the paragraph.

Parameters:

index (int) – Index of run or equation in paragraph.

setAttributes(**kwargs)#

Method to set multiple attributes.

Parameters:

kwargs (dict) – Valid keywords are alignment, bulletLevel, bulletStyle, bulletType, lineBreak, lineSpacing, spaceAfter, spaceBefore, text

property alignment#

Paragraph alignment. Valid values are the enums of PARAGRAPH_ALIGN.

Getter:

Gets the Paragraph alignment.

Setter:

Sets the Paragraph alignment.

Type:

PARAGRAPH_ALIGN

property bulletLevel#

Paragraph object indentation when listed (bullet-list, number-list). Valid values are the integers 1-7. Default is 1.

Getter:

Gets the Paragraph bullet level.

Setter:

Sets the Paragraph bullet level.

Type:

int

property bulletStyle#

Paragraph bullet/number style. For pptx, valid enums are from PpBulletCharStyle and PpBulletNumberedStyle. For docx, valid enums are from WdBulletCharStyle and WdBulletNumberedStyle.

Getter:

Gets the Paragraph bullet style.

Setter:

Sets the Paragraph bullet style.

Type:

PpBulletCharStyle or PpBulletNumberedStyle or WdBulletCharStyle or WdBulletNumberedStyle

property bulletType#

Bullet type of Paragraph if it gets listed. If the Paragraph content listed with bullet then we set MsBulletType.BulletUnnumbered. If the paragraph content listed with the number then we set MsBulletType.BulletNumbered.

Getter:

Get paragraph bullet type.

Setter:

Set paragraph bullet type.

Type:

MsBulletType

property lineBreak#

Flag to activate/deactivate line break flag.

Getter:

Gets status of line-break.

Setter:

Sets status of line-break.

Type:

bool

property lineSpacing#

Flag to activate or deactivate the line spacing.

Getter:

Gets status of line spacing.

Setter:

Sets status of line spacing.

Type:

int

property spaceAfter#

Flag to set or not set space after Paragraph.

Getter:

Gets status of space-after.

Setter:

Sets status of space-after.

Type:

int

property spaceBefore#

Flag to set or not set space before Paragraph.

Getter:

Gets status of space-before.

Setter:

Sets status of space-before.

Type:

int

property text#

Flag to get or set text of first Run object.

Getter:

Gets text content of first Run object.

Setter:

Sets text content of first Run object.

Type:

str

PARAGRAPH_ALIGN class#

enum PARAGRAPH_ALIGN(value)#

Valid values are as follows:

NONE = <PARAGRAPH_ALIGN.NONE: 0>#
LEFT = <PARAGRAPH_ALIGN.LEFT: 1>#
RIGHT = <PARAGRAPH_ALIGN.RIGHT: 2>#
CENTER = <PARAGRAPH_ALIGN.CENTER: 3>#
JUSTIFY = <PARAGRAPH_ALIGN.JUSTIFY: 4>#
JUSTIFY_LOW = <PARAGRAPH_ALIGN.JUSTIFY_LOW: 5>#
DISTRIBUTE = <PARAGRAPH_ALIGN.DISTRIBUTE: 6>#

PpBulletCharStyle class#

enum PpBulletCharStyle(value)#

Valid values are as follows:

filledRoundCircle = <PpBulletCharStyle.filledRoundCircle: 8226>#
smallFilledRoundCircle = <PpBulletCharStyle.smallFilledRoundCircle: 8729>#
filledTriangle = <PpBulletCharStyle.filledTriangle: 8227>#
hyphen = <PpBulletCharStyle.hyphen: 8259>#
smallfilledSquare = <PpBulletCharStyle.smallfilledSquare: 9642>#
filledSquare = <PpBulletCharStyle.filledSquare: 9632>#
blackMediumSquare = <PpBulletCharStyle.blackMediumSquare: 9724>#
smallWhiteCircle = <PpBulletCharStyle.smallWhiteCircle: 9702>#
largeWhiteCircle = <PpBulletCharStyle.largeWhiteCircle: 9675>#
heavyCheckMark = <PpBulletCharStyle.heavyCheckMark: 10004>#
lightCheckMark = <PpBulletCharStyle.lightCheckMark: 128504>#
checkMark = <PpBulletCharStyle.checkMark: 10003>#
balletBoxWithCheckMark = <PpBulletCharStyle.balletBoxWithCheckMark: 9745>#
balletBoxWithBoldCheckMark = <PpBulletCharStyle.balletBoxWithBoldCheckMark: 128505>#
whiteSmallSquare = <PpBulletCharStyle.whiteSmallSquare: 9643>#
whiteSquare = <PpBulletCharStyle.whiteSquare: 9633>#
star = <PpBulletCharStyle.star: 9733>#
rightwardsArrow = <PpBulletCharStyle.rightwardsArrow: 8594>#
heavyWideHeadedRightwardsArrow = <PpBulletCharStyle.heavyWideHeadedRightwardsArrow: 10132>#
rightwardsDoubleArrow = <PpBulletCharStyle.rightwardsDoubleArrow: 8658>#
blackRightwardsArrowhead = <PpBulletCharStyle.blackRightwardsArrowhead: 10148>#

PpBulletNumberedStyle class#

enum PpBulletNumberedStyle(value)#

Valid values are as follows:

styleMixed = <PpBulletNumberedStyle.styleMixed: -2>#
alphaLcPeriod = <PpBulletNumberedStyle.alphaLcPeriod: 0>#
alphaUcPeriod = <PpBulletNumberedStyle.alphaUcPeriod: 1>#
arabicParenRight = <PpBulletNumberedStyle.arabicParenRight: 2>#
arabicPeriod = <PpBulletNumberedStyle.arabicPeriod: 3>#
romanLcParenBoth = <PpBulletNumberedStyle.romanLcParenBoth: 4>#
romanLcParenRight = <PpBulletNumberedStyle.romanLcParenRight: 5>#
romanLcPeriod = <PpBulletNumberedStyle.romanLcPeriod: 6>#
romanUcPeriod = <PpBulletNumberedStyle.romanUcPeriod: 7>#
alphaLcParenBoth = <PpBulletNumberedStyle.alphaLcParenBoth: 8>#
alphaLcParenRight = <PpBulletNumberedStyle.alphaLcParenRight: 9>#
alphaUcParenBoth = <PpBulletNumberedStyle.alphaUcParenBoth: 10>#
alphaUcParenRight = <PpBulletNumberedStyle.alphaUcParenRight: 11>#
arabicParenBoth = <PpBulletNumberedStyle.arabicParenBoth: 12>#
arabicPlain = <PpBulletNumberedStyle.arabicPlain: 13>#
romanUcParenBoth = <PpBulletNumberedStyle.romanUcParenBoth: 14>#
romanUcParenRight = <PpBulletNumberedStyle.romanUcParenRight: 15>#
simpChinPlain = <PpBulletNumberedStyle.simpChinPlain: 16>#
simpChinPeriod = <PpBulletNumberedStyle.simpChinPeriod: 17>#
circleNumDbPlain = <PpBulletNumberedStyle.circleNumDbPlain: 18>#
circleNumWdWhitePlain = <PpBulletNumberedStyle.circleNumWdWhitePlain: 19>#
circleNumWDblackPlain = <PpBulletNumberedStyle.circleNumWDblackPlain: 20>#
tradChinPlain = <PpBulletNumberedStyle.tradChinPlain: 21>#
tradChinPeriod = <PpBulletNumberedStyle.tradChinPeriod: 22>#
arabicAlphaDash = <PpBulletNumberedStyle.arabicAlphaDash: 23>#
arabicAbjadDash = <PpBulletNumberedStyle.arabicAbjadDash: 24>#
hebrewAlphaDash = <PpBulletNumberedStyle.hebrewAlphaDash: 25>#
kanjiKoreanPlain = <PpBulletNumberedStyle.kanjiKoreanPlain: 26>#
kanjiKoreanPeriod = <PpBulletNumberedStyle.kanjiKoreanPeriod: 27>#
arabicDbPlain = <PpBulletNumberedStyle.arabicDbPlain: 28>#
arabicDbPeriod = <PpBulletNumberedStyle.arabicDbPeriod: 29>#
thaiAlphaPeriod = <PpBulletNumberedStyle.thaiAlphaPeriod: 30>#
thaiAlphaParenRight = <PpBulletNumberedStyle.thaiAlphaParenRight: 31>#
thaiAlphaParenBoth = <PpBulletNumberedStyle.thaiAlphaParenBoth: 32>#
ppBulletThaiNumPeriod = <PpBulletNumberedStyle.ppBulletThaiNumPeriod: 33>#
thaiNumPeriod = <PpBulletNumberedStyle.thaiNumPeriod: 34>#
thaiNumParenBoth = <PpBulletNumberedStyle.thaiNumParenBoth: 35>#
hindiAlphaPeriod = <PpBulletNumberedStyle.hindiAlphaPeriod: 36>#
hindiNumPeriod = <PpBulletNumberedStyle.hindiNumPeriod: 37>#
kanjiSimpChinDbPeriod = <PpBulletNumberedStyle.kanjiSimpChinDbPeriod: 38>#
hindiNumParenRight = <PpBulletNumberedStyle.hindiNumParenRight: 39>#
hindiAlpha1Period = <PpBulletNumberedStyle.hindiAlpha1Period: 40>#

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.

saveAsHTML(path=None, outputtemplate='', open=False, **kwargs) None#

Method to export presentation report as HTML.

Parameters:
  • path – Path of the exported presentation

  • outputtemplate (str) – Path of output html template (layout).

  • open (bool) – Flag to open or not the exported HTML.

Returns:

Export result and exported filepath

Return type:

HwxReportResult and str

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, open and newname.

Returns:

Export result and exported filepath

Return type:

HwxReportResult, str

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

update(val=None)#

Method to capture specific images/models based on their page and window id from GUI. By default, it captures all the Image/SlideImage objects inside the presentation, in which the source is equal to ‘graphic’.

Parameters:

val (list of Image | SlideImage | Slide) – None or List of objects to be processed in GUI capturing. If none, all children gets processed.

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’, ‘Low’, ‘Desktop’, ‘Medium’ and custom values as list [width, height].

Getter:

Gets the presentation resolution type.

Setter:

Sets the presentation resolution type.

Type:

str or list

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

property templateHTML#

The template file used for the HTML presentation. Only for HTML export.

Getter:

Gets the template file path.

Type:

str

Note

The HwxReportResult object returned by savePPTX(), saveAsHTML() in an object containing two attributes message, status. If status=0 then report is exported successfully.

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()#

Method to close the report session. This method will delete the report session and destroy the model.

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#

Returns session.

Returns:

Report session

Return type:

ReportSession

property tempdir#

Returns temporary path of the report session.

Returns:

Temporary path

Return type:

str

Run class#

class Run(parent, **kwargs)#

Bases: object

Class representing a Run object. Existing Run can be fetched using getRun method of a Paragraph object. New Run can be created/added with Paragraph object as parent.

Parameters:

parent (Paragraph) – Parent of this run.

property boldFont#

Flag to activate or deactivate bold font of run text.

Getter:

Gets bold font status.

Setter:

Sets bold font status.

Type:

bool

property fontColor#

Get or set run font color.

Getter:

Gets font color.

Setter:

Sets font color.

Type:

list[int]

property fontName#

Get or set run font name.

Getter:

Gets font name.

Setter:

Sets font name.

Type:

str

property fontSize#

Get or set run font size.

Getter:

Gets font size.

Setter:

Sets font size.

Type:

int

Get or set the run hyperlink path.

Getter:

Gets path of hyperlink.

Setter:

Sets path of hyperlink.

Type:

str

property italicFont#

Flag to activate or deactivate the run italics.

Getter:

Gets status of run italics.

Setter:

Sets status of run italics.

Type:

bool

property lineBreak#

Flag to activate or deactivate run line break.

Getter:

Gets line-break status.

Setter:

Sets line-break status.

Type:

bool

property runImagePath#

Adds image as run content using image file path.

Getter:

Gets file path of image added as run content.

Setter:

Sets image as run content.

Type:

str

property runImageStream#

Adds image as run content using image binary data.

Getter:

Gets binary data of image added as run content.

Setter:

Sets image as run content.

Type:

numpy.ndarray

property runText#

Text content of this run.

Getter:

Gets run text.

Setter:

Sets run text.

Type:

str

property tabSpace#

Flag to activate or deactivate the run tab space.

Getter:

Gets tab space status.

Setter:

Sets tab space status.

Type:

bool

property underline#

Flag to activate or deactivate the run underline status.

Getter:

Gets status of underline.

Setter:

Sets status of underline.

Type:

bool

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 cssclassidHTML#

The CSS class or ID of the slide. Only for HTML export.

Getter:

Gets the CSS class or ID of the slide.

Setter:

Sets the CSS class or ID of the slide.

Type:

str

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 (existing image is an Image object). This means any property value changes made in 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 crop#

Flag to crop the image empty white-space around model while getting captured from GUI. Valid only when source is ‘graphic’.

Getter:

Gets status of crop.

Setter:

Sets status of crop.

Type:

bool

property format#

Get or set the format of the image when image is captured from GUI. Valid only when source is ‘graphic’. Valid values are ‘png’, ‘jpg’, ‘gif’, ‘avi’, ‘mp4’, ‘glb’ and ‘h3d’.

Getter:

Gets the image format.

Setter:

Sets the image format.

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 page#

Get or set the page id to capture image. Valid only when the source of image is ‘graphic’.

Getter:

Gets page id.

Setter:

Sets page id.

Type:

int

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 window#

Get or set window id to capture image. This is applicable only when source is ‘graphic’.

Getter:

Gets window id.

Setter:

Sets window id.

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 (existing table is a Table object). This means, any property value changes made in 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, splitAuto, splitMaxRows, splitMaxColumns, position, x, y, width, and height.

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

Method to set the color of a column in the table. Only for HTML export.

Parameters:
  • index (int) – The index of the column.

  • color (list) – The color of the column in RGB format.

setExportRange(row_start: int, col_start: int, row_end: int, col_end: int)#

Method to select cell range of table to export.

Parameters:
  • row_start (int) – Start row index. Starts from 0.

  • col_start (int) – Start column index. Starts from 0.

  • row_end (int) – End row index.

  • col_end (int) – End column index.

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

Method to set the color of a row in the table. Only for HTML export.

Parameters:
  • index (int) – The index of the row.

  • color (list) – The color of the row in RGB format.

property autoSortHTML#

The flag to activate or deactivate the table auto sort. Only for HTML export.

Getter:

Gets the status of the table auto sort.

Setter:

Sets the status of the table auto sort.

Type:

bool

property autoToolTipHTML#

The flag to activate or deactivate the table auto tool tip. Only for HTML export.

Getter:

Gets the status of the table auto tool tip.

Setter:

Sets the status of the table auto tool tip.

Type:

bool

property caption#

The table caption.

Getter:

Gets the table caption.

Setter:

Sets the table caption.

Type:

str

property captionposition#

The caption position.

Getter:

Gets the caption position.

Setter:

Sets the caption position.

Type:

str

property columnColorGradient#

The column color gradient. Only for HTML export.

Getter:

Gets the column color gradient.

Setter:

Sets the column color gradient.

Type:

list

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 filterTypeHTML#

The filter type for the table. Only for HTML export.

Getter:

Gets the filter type for the table.

Setter:

Sets the filter type for the table.

Type:

str

property fontsize#

The font size of the table.

Getter:

Gets the font size of the table.

Setter:

Sets the font size of 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 rowColorGradient#

The row color gradient. Only for HTML export.

Getter:

Gets the row color gradient.

Setter:

Sets the row color gradient.

Type:

list

property session#

Returns session to which this slide table belongs.

Returns:

Report session

Return type:

ReportSession

property splitAuto#

The flag to activate or deactivate the table auto split.

Getter:

Gets the status of the table auto split.

Setter:

Sets the status of the table auto split.

Type:

bool

property splitMaxColumns#

The maximum number of columns in the table, used in splitting.

Getter:

Gets the maximum number of columns.

Setter:

Sets the maximum number of columns.

Type:

int

property splitMaxRows#

The maximum number of rows in the table, used in splitting.

Getter:

Gets the maximum number of rows.

Setter:

Sets the maximum number of rows.

Type:

int

SlideText class#

class SlideText(**kwargs)#

Bases: SlideLocation

SlideText creates reference of already existing text (existing text is a Text object). This means, any property value changes made in 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.

cell(row_idx, col_idx)#

Method to get access to a specific cell.

Parameters:
  • row_idx (int) – Row index

  • col_idx (int) – Column index

Returns:

Table cell object

Return type:

TableCell

exportCsv(file: str) int#

Method to export the table content to a CSV file.

Parameters:

file (str) – CSV file path

getCellValue(row: int, col: int)#

Method to get cell value for at particular index.

Parameters:
  • row (int) – Row index

  • col (int) – Column index

Returns:

Cell value

Return type:

hwVariant

loadCsv(file: str) int#

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

Parameters:

file (str) – CSV file path

mergeCells(cell1, cell2)#

Method to merge table cells.

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

  • value (str|int|float) – Cell value

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

Method to set column color. Only for HTML export.

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

setExportRange(row_start: int, col_start: int, row_end: int, col_end: int)#

Method to select cell range of table to export.

Parameters:
  • row_start (int) – Start row index. Starts from 0.

  • col_start (int) – Start column index. Starts from 0.

  • row_end (int) – End row index.

  • col_end (int) – End column index.

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

Method to set row color. Only for HTML export.

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 alignment#

Table alignment. Valid values are ‘none’, ‘left’, ‘right’, ‘center’, ‘justify’ and ‘distribute’.

Getter:

Gets table alignment.

Setter:

Sets table alignment.

Type:

str

property autoSortHTML#

The flag to activate or deactivate autosort. Only for HTML export.

Getter:

Gets the status of the autosort.

Setter:

Sets the status of the autosort.

Type:

bool

property autoToolTipHTML#

The flag to activate or deactivate autotooltip. Only for HTML export.

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 captionposition#

Table caption position. Valid values are ‘bottom’ and ‘top’. Default is ‘bottom’.

Getter:

Gets caption position.

Setter:

Sets caption position.

Type:

str

property columnColorGradient#

The flag to activate or deactivate column color gradient. Only for HTML export.

Getter:

Gets the status of the column color gradient.

Setter:

Sets the status of the column color gradient.

Type:

list

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 filterTypeHTML#

Filter type for table. Valid values are ‘none’, ‘combo’, ‘text’. Only for HTML export.

Getter:

Gets filter type for table

Setter:

Sets filter type for table.

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 rowColorGradient#

The flag to activate or deactivate row color gradient. Only for HTML export.

Getter:

Gets the status of the row color gradient.

Setter:

Sets the status of the row color gradient.

Type:

list

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 splitAuto#

The flag to activate or deactivate the table auto split.

Getter:

Gets the status of the table auto split.

Setter:

Sets the status of the table auto split.

Type:

bool

property splitMaxColumns#

The maximum number of columns in the table, used in splitting.

Getter:

Gets the maximum number of columns.

Setter:

Sets the maximum number of columns.

Type:

int

property splitMaxRows#

The maximum number of rows in the table, used in splitting.

Getter:

Gets the maximum number of rows.

Setter:

Sets the maximum number of rows.

Type:

int

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>#

TableCell class#

class TableCell(cellmdi, dttable, **kwargs)#

Bases: object

Class to represent a table cell. Users cannot create this object directly. Use the cell() method in Table/DocTable to get a cell object.

getColumnIndex()#

Method to get column index of the cell.

Returns:

Column index

Return type:

int

getRowIndex()#

Method to get row index of the cell.

Returns:

Row index

Return type:

int

getValue()#

Method to get text content of the cell.

Returns:

Cell text content

Return type:

str|int|float

setAttributes(**kwargs)#

Method to set multiple attributes.

Parameters:

kwargs (dict) – Valid keywords are backgroundColor, horizontalAlignment, verticalAlign, fontName, textColor, fontSize, boldFont, italicFont, underline, backgroundColor.

setValue(text=None, imagepath=None, hyperlink=None)#

Method to set cell value which can be either text or image. Hyperlink can be set for both text and image. If text is an equation, then hyperlink is not supported.

Parameters:
  • text (str) – Cell text content

  • imagepath (str) – Image path

  • hyperlink (str) – Hyperlink path

property backgroundColor#

Flag to set the cell background color.

Getter:

Gets the RGB list of background

Setter:

Sets the RGB list of background

Type:

List[int]

property boldFont#

Flag to activate or deactivate the cell text bold status.

Getter:

Gets the bold status of cell text

Setter:

Sets the bold status of cell text

Type:

bool

property fontName#

Flag to get/set font name of cell text content.

Getter:

Gets the font name

Setter:

Sets the font name

Type:

str

property fontSize#

Flag to get/set the font size of cell text.

Getter:

Gets the font size

Setter:

Sets the font size

Type:

int

property horizontalAlignment#

Flag to get/set the horizontal alignment of cell content. Valid values are ‘none’, ‘left’, ‘center’, ‘right’.

Getter:

Gets horizontal alignment of cell.

Setter:

Sets horizontal alignment of cell

Type:

str

property italicFont#

Flag to activate or deactivate the cell text italics status.

Getter:

Gets italics status of cell text

Setter:

Sets italics status of cell text

Type:

bool

property textColor#

Flag to set/get text color of cell text.

Getter:

Gets the RGB list of text color

Setter:

Sets the RGB list of text color

Type:

List[int]

property underline#

Flag to activate or deactivate the cell text undeline status.

Getter:

Gets underline status of cell text

Setter:

Sets underline status of cell text

Type:

bool

property verticalAlignment#

Flag to get/set the vertical alignment of cell content. Valid values are ‘none’, ‘bottom’, ‘center’, ‘top’, ‘mixed’.

Getter:

Gets the cell vertical alignment

Setter:

Sets the cell vertical alignment

Type:

str

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