iReport Ultimate Guide - Nimsoft Library
iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library
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
- Page 34 and 35: iReport Ultimate GuideCode Example
- Page 36: iReport Ultimate GuideCode Example
- Page 39 and 40: Basic Notions of iReportjava.util.D
- Page 41 and 42: Basic Notions of iReportof a date,
- Page 43 and 44: Basic Notions of iReport(new java.l
- Page 45 and 46: Report StructureCHAPTER 4REPORT STR
- Page 47 and 48: Report StructureGroup HeaderDetailG
- Page 49 and 50: Report StructureThe page margin dim
- Page 51 and 52: Report StructureFigure 4-6Result of
- Page 53 and 54: Report StructureMultiple columns ar
- Page 55 and 56: Report StructureFigure 4-11Properti
- Page 57 and 58: Report StructureAs you can see in F
- Page 59 and 60: Report Structure4.1.3.12 ImportsThe
- Page 61 and 62: Report Structureexample, in a repor
- Page 63 and 64: Report ElementsCHAPTER 5REPORT ELEM
- Page 65 and 66: Report ElementsFigure 5-3Guidelines
- Page 67 and 68: Report ElementsFigure 5-6Element no
- Page 69 and 70: Report ElementsTable 5-1Formatting
- Page 71 and 72: Report ElementsFigure 5-10Table 5-2
- Page 73 and 74: Report ElementsFigure 5-11Custom el
- Page 75 and 76: Report Elements5.1.5.2 RectangleThe
- Page 77 and 78: Report ElementsTable 5-4TypeImage E
- Page 79 and 80: Report ElementsTable 5-5OptionImage
- Page 81 and 82: Report ElementsCode Example 5-1Dyna
- Page 83: Report ElementsCode Example 5-2Prin
- Page 87 and 88: Report ElementsFor your convenience
- Page 89 and 90: Report ElementsHere there are some
- Page 91 and 92: Report ElementsThe following briefl
- Page 93 and 94: 5.5 Adding Custom Components and Ge
- Page 95 and 96: Fields, Parameters, and VariablesCH
- Page 97 and 98: Fields, Parameters, and VariablesIn
- Page 99 and 100: 6.1.2 Accessing the SQL Query Desig
- Page 101 and 102: Fields, Parameters, and Variables6.
- Page 103 and 104: 6.2.3 Built-in ParametersFields, Pa
- Page 105 and 106: Fields, Parameters, and VariablesRe
- Page 107 and 108: Fields, Parameters, and Variables6.
- Page 109 and 110: Fields, Parameters, and VariablesTa
- Page 111 and 112: Bands and GroupsCHAPTER 7BANDS AND
- Page 113 and 114: Bands and Groupsexpression may be r
- Page 115 and 116: Bands and GroupsFigure 7-6Dragging
- Page 117 and 118: Bands and GroupsFigure 7-10The firs
- Page 119 and 120: Bands and GroupsFigure 7-14 shows t
- Page 121 and 122: 7.3 Other Group OptionsBands and Gr
- Page 123 and 124: Fonts and StylesCHAPTER 8FONTS AND
- Page 125 and 126: Fonts and StylesThe list of availab
- Page 127 and 128: Fonts and StylesFigure 8-5Font Exte
- Page 129 and 130: Fonts and StylesFigure 8-7Font Exte
- Page 131 and 132: Fonts and StylesFigure 8-10The new
- Page 133 and 134: Fonts and StylesTo apply a style to
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