iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library

13.07.2015 Views

iReport Ultimate Guidepen is used to draw a shape (or just the borders of the element in case of images). This property is edited with the Pen dialog(see Figure 5-13).Figure 5-13Pen DefinitionIt is possible to set a particular line width (a zero line width means that no lines will be painted) and choose between 4 differentstyles: normal, dashed, dotted and double.By default, the color used to paint the lines is the element foreground color, but it is possible to override that value byspecifying a different value. To reset the color the default value you need to reset the whole pen right clicking the Pen item inthe property sheet and selecting Restore Default Value.The default values for the pen (like for many other common element properties) depend on the specific element. Lines,rectangles and ellipses have a default width of 1 pixel, while for images the default line width is zero.The Fill property has a single possible value: Solid.5.1.5.1 LineIn UR, a line is defined by a rectangle for which the line represents the diagonal (see Figure 5-14).Figure 5-14Line element of type top-downThe line is drawn using the pen settings. If they are not set, the foreground color is used as the default color and a normal 1-pixel-width line is used as the line style.The only specific property of a line is the Line direction, used to indicate which of the two rectangle diagonals representsthe line; the possible values are Top Down and Bottom Up.74

Report Elements5.1.5.2 RectangleThe rectangle element is usually used to draw frames around other elements (even if it is preferable to use a frame element forthis specific purpose in order to avoid overlapping elements). Similarly to the line element, the rectangle border is drawn usingthe pen settings. If they are not set, the Foreground setting is used as color (which is black by default) and a normal 1-pixelwidthline is used as line style. The background is filled with the color specified with the Background setting if the element hasnot been defined as transparent.Figure 5-15 Rectangle element with radius set to 20In iReport, it is possible to have a rectangle with rounded corners (see Figure 5-15). The rounded corners are defined bymeans of the Radius attribute, which represents the curvature radius of the corners, expressed in pixels.5.1.5.3 EllipseFigure 5-16Ellipse element and its rectangular boundaryThe ellipse is the only element that has no attributes specific to it. The ellipse is drawn in a rectangle that defines the maximumheight and width (see Figure 5-16). The border is drawn using the pen settings. If they are not set, the Foreground is used ascolor (which is black by default) and a normal 1-pixel-width line is used as line style. The background is filled with theBackground color setting if the element has not been defined as transparent.75

Report Elements5.1.5.2 RectangleThe rectangle element is usually used to draw frames around other elements (even if it is preferable to use a frame element forthis specific purpose in order to avoid overlapping elements). Similarly to the line element, the rectangle border is drawn usingthe pen settings. If they are not set, the Foreground setting is used as color (which is black by default) and a normal 1-pixelwidthline is used as line style. The background is filled with the color specified with the Background setting if the element hasnot been defined as transparent.Figure 5-15 Rectangle element with radius set to 20In <strong>iReport</strong>, it is possible to have a rectangle with rounded corners (see Figure 5-15). The rounded corners are defined bymeans of the Radius attribute, which represents the curvature radius of the corners, expressed in pixels.5.1.5.3 EllipseFigure 5-16Ellipse element and its rectangular boundaryThe ellipse is the only element that has no attributes specific to it. The ellipse is drawn in a rectangle that defines the maximumheight and width (see Figure 5-16). The border is drawn using the pen settings. If they are not set, the Foreground is used ascolor (which is black by default) and a normal 1-pixel-width line is used as line style. The background is filled with theBackground color setting if the element has not been defined as transparent.75

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!