iReport Ultimate Guide - Nimsoft Library

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

13.07.2015 Views

iReport Ultimate GuideFigure 5-20A JTable printed inside an image elementA textfield acts in a way similar to a static text string, but the content (the text to print) is provided using an expression (thatactually could be a simple static text string itself). That expression can return several kinds of value types, not just String,allowing the user to specify a pattern to format that value (this can be applied in example on numeric values and dates). Sincethe text specified dynamically can have an arbitrary length, a textfield provides several options about how the text must betreated regarding alignment, position, line breaks and so on. Optionally, the textfield is able to grow vertically to fit the contentwhen required. By default text elements are transparent with no border and with a black foreground color. All these propertiescan be modified using the common portion of the element property sheet and using the pop-up menu Padding And Borders.Textfields support hyperlinks too, refer the section about how to define them later in this chapter for more information.Static texts and textfields share a set of common properties to define text alignment and fonts. Let’s take a look at theseoptions:Font nameFont sizeBoldItalicUnderlineStrikethroughThis is the name of the font, the list presents all the fonts found in the system.Like often happens with text documents, you may see fonts that are could notbe found on other machines, so choose your font name carefully to keep themaximum compatibility. When exporting in PDF, this property is ignored, sincePDF requires and the PDF font name is used instead. More information aboutthe correct use of the fonts are provided in the “Fonts” chapter.This is the size of the font. Only integer numbers are allowed, meaning that youcannot define that is, a size of 10.5.Set the text style to bold and italic. These two properties does not work whenthe report is exported in PDF. In that case you need to specify a proper PDFfont.Set the text style to underline and strikethrough.84

Report ElementsPDF font namePDF encodingPDF embeddedHorizontal alignVertical alignRotationNoneThese flags are explained in 8.3, “Using the Font Extensions,” on page 125.This is the horizontal alignment of the text according to the element.This is the vertical alignment of the text according to the element.This specifies how the text has to be printed. The possible values are asfollows:The text is printed normally fromleft to right and from top tobottom.LeftRightThe text is rotated of 90 degreescounterclockwise; it is printedfrom bottom to top, and thehorizontal and verticalalignments follow the textrotation (for example, the bottomvertical alignment will print thetext along the right side of therectangle that delimits theelement area)The text is rotated of 90 degreesclockwise from top to bottom,and the horizontal and verticalalignments are set according tothe text rotation.UpsideDownThe text is rotated 180 degreesclockwise.Line spacingSingleThis is the interline (spacing between lines) value. The possible values are asfollows:Single interline (pre-defined value)1.5 Interline of one line and a halfDoubleMarkupDouble interlineThis attribute allows you to format the text using a specific markup language.This is extremely useful when you have to print some text that is pre-formatted,that is, in HTML or RTF. Simple HTML style tags (like for bold and forItalic) can be used in example to highlight a particular chunk of the text. Thepossible values are as follows:85

Report ElementsPDF font namePDF encodingPDF embeddedHorizontal alignVertical alignRotationNoneThese flags are explained in 8.3, “Using the Font Extensions,” on page 125.This is the horizontal alignment of the text according to the element.This is the vertical alignment of the text according to the element.This specifies how the text has to be printed. The possible values are asfollows:The text is printed normally fromleft to right and from top tobottom.LeftRightThe text is rotated of 90 degreescounterclockwise; it is printedfrom bottom to top, and thehorizontal and verticalalignments follow the textrotation (for example, the bottomvertical alignment will print thetext along the right side of therectangle that delimits theelement area)The text is rotated of 90 degreesclockwise from top to bottom,and the horizontal and verticalalignments are set according tothe text rotation.UpsideDownThe text is rotated 180 degreesclockwise.Line spacingSingleThis is the interline (spacing between lines) value. The possible values are asfollows:Single interline (pre-defined value)1.5 Interline of one line and a halfDoubleMarkupDouble interlineThis attribute allows you to format the text using a specific markup language.This is extremely useful when you have to print some text that is pre-formatted,that is, in HTML or RTF. Simple HTML style tags (like for bold and forItalic) can be used in example to highlight a particular chunk of the text. Thepossible values are as follows:85

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

Saved successfully!

Ooh no, something went wrong!