Skip to content

Image width in percent is rendered incorrectly #2396

Description

@hvbtup

Description

We want to use an image inside a grid (or table) cell as a horizontal bar, with its length according to a percent value from the data set.
E.g if the cell width is 50mm and the value is 0.6, the bar should have a length of 0.6 * 50mm = 30.0mm.

This works well with absolute units like "mm" if we set the image's width in its onCreate event.
But it doesn't work if we set the image width in percent like this:

 this.width = (nvl(row["GEHALTSKLASSE_A_ANTEIL"], 0) + "%").replace(/,/g, ".");

Neither does it work when we set the width, without using an onCreate event, to 100% in the property editor.

Image

Environment

  • OS: Windows
  • Browser: (PDF emitter used)
  • BIRT Version: 4.23.0

Screenshots

Image

Additional Context

This used to work with BIRT 4.15.

One possible workaround is to use absolute units for the width.
However, this is quite difficult in my report, because currently, the columns do not a width set, and the column widths are even dynamic because some of the columns may be hidden at runtime using a data-dependent visibility expression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugFixChange to correct issues

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions