iReport Ultimate Guide - Nimsoft Library
iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library
iReport Ultimate GuideFigure 8-11Adding a new style to the documentYou can define many properties for a style, which are then shown in the property sheet (Figure 8-12). The only property valueof a style that must be set is Name. All other properties are optional.Leave the default value as-is when you don’t want to set a specific value for a property. To restore a default value, right-clickthe property name and select Reset to default value. (This works with all the element properties that support a default value.)Figure 8-12All the properties of a style132
Fonts and StylesTo apply a style to an element, select the element and set the desired style in the property sheet (Figure 8-13).Figure 8-13Style property of an elementYou can choose a specific style to be the default style for your report. When setting a default style, all the element propertieshaving an unspecified value will implicitly inherit their value from the default style. The Parent style property defines the stylefrom which the current one inherits default properties.The remaining properties fall into the following four categories:• Common properties• Graphics properties• Border and padding properties• Text propertiesFor details about the properties, refer to Chapter 5.8.7 Creating Style ConditionsYou can design your report so that a style changes dynamically. For example, you can set the foreground color of a textfield toblack if a particular value is positive and red when it is negative. iReport creates conditional styles as deriving from an existingstyle, for which we set the condition and change some properties.To apply a condition to a style, right-click the style node and select Add Conditional Style (see Figure 8-14).Figure 8-14Setting a conditional styleYou can reconfigure all the values of the parent style. The new values will be used instead of the ones defined in the parentwhen the condition is true. The new conditional style will appear in the outline view. You need to set the condition (actually anexpression that returns a Boolean value) that will be evaluated during the rendering of elements that use the style.In the condition expression you can use all the properties of the report object. Please note that the conditions cannot be generic,for instance, you cannot set a condition like “if the number is positive” or “if the string is null.” You must be very specific,specifying, for example, that a particular value (field, parameter, variable or any expression involving them) must be positiveor null, and so on.133
- Page 81 and 82: Report ElementsCode Example 5-1Dyna
- Page 83 and 84: Report ElementsCode Example 5-2Prin
- Page 85 and 86: Report ElementsPDF font namePDF enc
- 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: Fonts and StylesFigure 8-10The new
- Page 135 and 136: Fonts and StylesFigure 8-17The outl
- Page 137 and 138: TemplatesCHAPTER 9TEMPLATESOne of t
- Page 139 and 140: TemplatesFigure 9-2Columnar reportA
- Page 141 and 142: TemplatesFigure 9-4Group by step in
- Page 143 and 144: TemplatesIf a static text element i
- Page 145 and 146: TemplatesFigure 9-8Your custom temp
- Page 147 and 148: TemplatesFigure 9-10New template in
- Page 149 and 150: TemplatesFigure 9-12Preview of repo
- Page 151 and 152: SubreportsCHAPTER 10 SUBREPORTSSubr
- Page 153 and 154: SubreportsFigure 10-3Subreport elem
- Page 155 and 156: SubreportsFigure 10-4Subreport Para
- Page 157 and 158: SubreportsFigure 10-7Just a list of
- Page 159 and 160: SubreportsFigure 10-11 Subreport Wi
- Page 161 and 162: SubreportsFigure 10-14 The final re
- Page 163 and 164: Subreports3. Click the Add button t
- Page 165 and 166: Subreports10.4 Using the Subreport
- Page 167 and 168: SubreportsFigure 10-21 Subreport co
- Page 169 and 170: SubreportsFigure 10-23 Setting Subr
- Page 171 and 172: Data Sources and Query ExecutersCHA
- Page 173 and 174: Data Sources and Query Executers•
- Page 175 and 176: Data Sources and Query ExecutersFig
- Page 177 and 178: Data Sources and Query ExecutersFig
- Page 179 and 180: Data Sources and Query ExecutersFig
- Page 181 and 182: Data Sources and Query ExecutersFig
Fonts and StylesTo apply a style to an element, select the element and set the desired style in the property sheet (Figure 8-13).Figure 8-13Style property of an elementYou can choose a specific style to be the default style for your report. When setting a default style, all the element propertieshaving an unspecified value will implicitly inherit their value from the default style. The Parent style property defines the stylefrom which the current one inherits default properties.The remaining properties fall into the following four categories:• Common properties• Graphics properties• Border and padding properties• Text propertiesFor details about the properties, refer to Chapter 5.8.7 Creating Style ConditionsYou can design your report so that a style changes dynamically. For example, you can set the foreground color of a textfield toblack if a particular value is positive and red when it is negative. <strong>iReport</strong> creates conditional styles as deriving from an existingstyle, for which we set the condition and change some properties.To apply a condition to a style, right-click the style node and select Add Conditional Style (see Figure 8-14).Figure 8-14Setting a conditional styleYou can reconfigure all the values of the parent style. The new values will be used instead of the ones defined in the parentwhen the condition is true. The new conditional style will appear in the outline view. You need to set the condition (actually anexpression that returns a Boolean value) that will be evaluated during the rendering of elements that use the style.In the condition expression you can use all the properties of the report object. Please note that the conditions cannot be generic,for instance, you cannot set a condition like “if the number is positive” or “if the string is null.” You must be very specific,specifying, for example, that a particular value (field, parameter, variable or any expression involving them) must be positiveor null, and so on.133