Skip to main content

Rectangle


The Rectangle layout element allows adding rectangles to your report.

The Rectangle element is used for adding rectangles anywhere to a page or any report section (header, footer, detail). Use the Rectangle element to provide rich formatting to your pages and reports.

info

Refer to designer-usersguide-examples for a GitHub example.

Add a Rectangle by selecting it from the context menu and placing it at the desired location.

Figure 1. Select Add Rectangle from the context menu to add a Rectangle layout element.

Figure 2. Setting a Rectangle layout element's fillColor and cornerRadius.

Alternate Colors

One really cool thing you can do with the Rectangle layout element is create a report where every other line is a different color. To make the rows in the report display alternate colors in the background, add a Rectangle in the background and set the showAlternateRow property to either odd or even depending on where to start the behavior.

info

The showAlternatingColors property only applies to the Detail report section

For example, you might create a report where you place a light blue rectangle in a report's details section.

warning

Be certain to place the Rectangle behind the other fields. You can accomplish this by clicking the Rectangle and selecting Move To Bottom.

Generating the PDF would produce a report where the background color of the data rows alternated.

tip

If you place a Line or Rectangle below a expandable RecordBox, RecordArea, or FormattedRecordArea, then the line will appear below the expanded field in the correct position. The Line or Rectangle bottom must be at or below the expandable element. A rectangle will resize with the row's height.

Properties

The Rectangle element has the following properties.

PropertyValueDescription
borderColorSee Colors Users Guide topic.A value indicating the border color of the Rectangle.
borderStyleA value indicating the border style of the Rectangle.
borderWidthnumericA value indicating the border width of the Rectangle.
cornerRadiusnumericA value indicating the corner radius of the Rectangle.
fillColorSee Colors Users Guide topic.A value indicating the color used to fill the Rectangle.
showAlternateRowOdd, EvenA value indicating whether to alternatively display the Rectangle for each record (when the Rectangle is in a Detail section).
idtextA value indicating the programmatic identifier of the Rectangle.
anglenumericA value indicating the number of degrees to rotate the Rectangle.
heightnumericA value indicating the height of the Rectangle.
widthnumericA value indicating the width of the Rectangle.
xnumericA value indicating the X coordinate of the Rectangle.
ynumericA value indicating the Y coordinate of the Rectangle.