Class

ImageComponent

ImageComponent

Object representing image in the report.

Since:
  • 5.0

Extends

Methods

copy() → {Component}

Create a mutable copy of the component.

This will copy only the component, not the actual shape in the template.

Inherited From:

Mutable copy of the component

Component

hide() → {Component}

Hides the component. Short for #withHidden(true)

Available in ppt and word reporting only!

Inherited From:

The component itself.

Component

moveX(xPosition) → {Component}

Moves the component on the x axis relative to its current position where a positive number will move to the right and a negative to the left.

The used unit may depend on the report type. PowerPoint eg. uses "pt" as the default unit (where 1 pt usually ≈1 in).

Available in ppt reporting only!

Parameters:
Name Type Description
xPosition number

The amount to move the component on the x axis. Set to null to unset and use presentation settings.

Inherited From:

The component itself.

Component

moveY(yPosition) → {Component}

Moves the component on the y axis relative to its current position where a positive number will move to the bottom and a negative to the top.

The used unit may depend on the report type. PowerPoint eg. uses "pt" as the default unit (where 1 pt usually ≈1 in).

Available in ppt reporting only!

Parameters:
Name Type Description
yPosition number

The amount to move the component on the y axis. Set to null to unset and use presentation settings.

Inherited From:

The component itself.

Component

withBackgroundColor(color) → {Component}

Sets the background color of the component.

Parameters:
Name Type Description
color string

A string that represents a 24-bit opaque color.

Inherited From:

The component itself.

Component

withBorder(thickness, r, g, b) → {Component}

Sets the border of a component.

Parameters:
Name Type Description
thickness number

Thickness of the border in pt

r number

The red value of the border color.

g number

The green value of the border color.

b number

The blue value of the border color.

Inherited From:

The component itself.

Component

withBorder(thickness, color) → {Component}

Sets the border of a component.

Parameters:
Name Type Description
thickness number

Thickness of the border in pt

color string

A string that represents a 24-bit opaque color.

Inherited From:

The component itself.

Component

withEnumIcon(page, attributeName) → {ImageComponent}

Attaches the the image of an enumeration icon to the component. Only single multiplicity TextEnumeration or NumberEnumeration attributes are supported.

Parameters:
Name Type Description
page Page

Page which contains the attribute

attributeName string

Name of the attribute

The ImageComponent itself.

Example
component
  .withEnumIcon(page, "cf.cplace.statusEnum");

withHidden(hidden) → {Component}

Set the visibility of the component.

Available in ppt and word reporting only!

Parameters:
Name Type Description
hidden boolean

Whether the component shall be visible or not.

Inherited From:

The component itself.

Component

withImage(document) → {ImageComponent}

Set the given document as the image of the component.

Parameters:
Name Type Description
document Document

The cplace document, must be an image.

The ImageComponent itself.

withProfilePicture(user) → {ImageComponent}

Set the given user's profile image as the image of the component. If the user hasn't set a custom image the default initials image is used instead.

Parameters:
Name Type Description
user Person

The user to get the profile picture from.

The ImageComponent itself.

Example
var currentUser = cplace.utils().getCurrentUser();
component
  .withProfilePicture(currentUser);

withX(xPosition) → {Component}

Sets the x coordinate of the component on the slide where 0 represents the leftmost border of the visible area. Values may exceed the boundaries (negative & positive) which will result in the component being placed outside the viewport.

The used unit may depend on the report type. PowerPoint eg. uses "pt" as the default unit (where 1 pt usually ≈1 in).

Available in ppt reporting only!

Parameters:
Name Type Description
xPosition number

The x coordinate of the component. Set to null to unset and use presentation settings.

Inherited From:

The component itself.

Component

withY(yPosition) → {Component}

Sets the x coordinate of the component on the slide where 0 represents the topmost border of the visible area. Values may exceed the boundaries (negative & positive) which will result in the component being placed outside the viewport.

The used unit may depend on the report type. PowerPoint eg. uses "pt" as the default unit (where 1 pt usually ≈1 in).

Available in ppt reporting only!

Parameters:
Name Type Description
yPosition number

The y coordinate of the component. Set to null to unset and use presentation settings.

Inherited From:

The component itself.

Component