Changes

Jump to: navigation, search

Format an iReport Template

1,145 bytes added, 21:29, 20 February 2020
no edit summary
__FORCETOC__
{{TOC right}}
{{HowTo's
|[[Start and Configure i-Report|Start and Configure i-Report]]
|[[Create a Basic i-Report Template|Create a Basic i-Report Template]]
|[[Modify an iReport Template|Modify an iReport Template]]
|[[Format an iReport Template|Format an iReport Template]]
|[[Create i-Report Templates with Subreports|Create i-Report Templates with Subreports]]
|[[Summarize i-Report Template Data|Summarize i-Report Template Data]]
}}
 
iReport Designer provides many ways to format the appearance of an iReport template. These include the ability to:
*add formatting elements to the iReport such as lines, rectangles, circles, etc
*perform conditional displays based on data in the report
==Conditional DisplayAdding Formatting Elements==__NOEDITSECTION__Sometimes it is important Additional formatting elements can be added to change the display of some data extracted from IMSMA for the resulting reportiReport template. For exampleThese include lines, boxes, circles, you want etc. To add these elements to changeiReport template:* # Ensure that '''Palette''' pane is available. If not, on the value “null” to “no”'''Window''' menu, select '''Palette'''.* # Select the value “Male” desired element and drag it to “Men”To do this, you use conditional statements in the element on the iReporttemplate.
==Formatting iReport Elements==__NOEDITSECTION__iReport Designer allows you to apply specific formatting to individual elements on an iReport template. Many of these elements can be edited graphically using [[#Formatting Tools|Formatting Tools]].# Select the desired field or variable displayed in the iReport template ('''note:''' this is '''NOT''' the field or variable value itself in the '''iReport Designer''', but rather the text element on the report displaying the field or variable value).
#: [[Image:IReport Display Properties.png|center|300px|''Display Properties'']]<div align="center">''Display Properties''</div>
# On the '''Properties''' pane select the '''Text Expression''' and open the '''Text Expression Editor''''.
#: [[Image:IReport Charts5.png|center|500px|''Text Expression Editor'']]<div align="center">''Text Expression Editor''</div>
# To change the way a particular field is displayed you can use basic "ïf-then-else" logic as in other [[Summarize i-Report Template Data#Variable Expressions|Variable Expressions]]. This follows the pattern:
$F{field} == null ? “Something" : $F{field}
Or nested===Position and Size Elements===__NOEDITSECTION__*Left*Top*Width*Height ===Colour===__NOEDITSECTION__*Forecolor*Backcolor*Opaque ===Text Properties===__NOEDITSECTION__iReport Designer allows you to set various properties for text elements displayed in the report template. These can be edited either with the text formatting bar (located on the same bar as the Designer, XML, and Preview buttons): $F{field} [[Image:IReport Formatting Bar.png|center|300px|''Text Formatting Bar'']]<div align="center">''Text Formatting Bar''</div> or with the '''Text properties''' portion of the '''Properties''' pane[[Image:IReport Text Properties.png|center|300px|''Text Properties'']]<div align= null ? “Something" center">''Text Properties''</div>Some examples of the properties you can edit are: $F{field} *Font Name*Size*Bold/Italic*Horizontal and Vertical Alignment ===Number and Date Specific Patterns=== “SomethingElse” ? “Something Else“ __NOEDITSECTION__* On the '''Properties''' pane select the '''Pattern''' element and open the '''Pattern Editor'''. *: [[Image: $F{IReport Pattern Properties.png|center|300px|''Pattern Window'']]<div align="center">''Pattern Window''</div>** Choose an appropriate '''Pattern''' to apply to the field}as desired.
{{note| The type of field is important (string===Position Type===__NOEDITSECTION__Because iReport elements can expand beyond their expected or allocated vertical space on the report template, float, double, int, date)elements can occasionally "collide" or overlap one another in the final report. To manage the potential conflict iReport provides the '''Position Type''' property on all elements. Stick with strings if you can[[Image:IReport Display Properties.}}png|center|300px|''Formatting Tools'']]<div align="center">''Formatting Tools''</div>
ExampleThe '''Position Type''' property has three options: $F{blockWater} == null ? “No *"Fix Relative to Top": This is the default valuefor all elements and means that the position will be kept relative to the top margin of the report regardless of what data is displayed before it.*"Fix Relative to Bottom" : $F{blockWater}This value means that the position will be kept relative to the bottom margin of the report regardless of what data is displayed after it.*"Float": This value allows the element to "float" and will display the element relative to elements that come before it (i.e. closer to the top or closer to the left margins).
==Formatting Dates and Numbers==iReport Designer allows you to apply specific date or number formats to fields of this type. As with other display properties:# Select Using the desired field or variable displayed in the iReport template ('''note:''' this is '''NOTFloat''' Position Type can help eliminate the field overlapping that can happen when displaying multiple charts or variable value itself cross tabs in the '''iReport Designer''', but rather the text element on the a single report displaying the field value)#: [[Image:IReport Display Properties.png|center|300px|''Display Properties'']]<div align="center">''Display Properties''</div># On the '''Properties''' pane select the '''Pattern''' element and open the '''Pattern Editor''''. #: [[Image:IReport Pattern Properties.png|center|300px|''Pattern Window'']]<div align="center">''Pattern Window''</div>#: Choose an appropriate '''Pattern''' to apply to the field as desiredtemplate.
==Adding Formatting Elements=Stretch with Overflow===__NOEDITSECTION__Additional Another useful formatting elements can be added option is '''Stretch with Overflow'''. Setting this property means that the height of the field will adapt to the iReport template. These include linesvalue, boxes, circles, etcinstead of the value being cut if it requires more space than available for the field. To add these elements to iReport template:# Ensure that * On the '''PaletteProperties''' pane is available. If not, on tick the '''WindowStretch with Overflow'''element. *: [[Image:iReport_Format_Stretch_with_overflow.png|center|300px|' menu, select 'Stretch with Overflow'']]<div align="center">'Palette'Stretch with Overflow''.# Select the desired element and drag it to the iReport template.</div>
==Formatting Tools==__NOEDITSECTION__
iReport Designer provides a variety of formatting tools for aligning, spacing, and sizing elements on the report template. These can be applied using the '''Formatting Tools''' pane.
# Ensure that '''Formatting Tools''' pane is available. If not, on the '''Window''' menu, select '''Formatting Tools'''.
# Select the desired element or elements (multiple elements can be selected by using the '''Control-click''' key combination) and apply the desired formatting choice.
==Conditional Display==__NOEDITSECTION__Sometimes it is important to change the display of some data extracted from IMSMA for the resulting report. For example, you want to change:* the value "null"fix relative to" vs. "floatno"==Because iReport elements can expand beyond their expected or allocated vertical space on * the report template, elements can occasionally value "Male" to "collideMen" or overlap one another To do this, you use conditional statements in the final report. To manage element on the potential conflict iReport provides the '''Position Type''' property on all elements. [[Image:IReport Display Properties.png|center|300px|''Formatting Tools'']]<div align="center">''Formatting Tools''</div>
The # Select the desired field or variable displayed in the iReport template ('''Position Typenote:''' property has three options:*"fix relative to top": This this is '''NOT''' the default field or variable value for all elements and means that itself in the position will be kept relative to '''iReport Designer''', but rather the top margin of text element on the report regardless of what data is displayed before itdisplaying the field or variable value).*#: [[Image:IReport Display Properties.png|center|300px|''Display Properties'']]<div align="fix relative to bottomcenter": This value means that >''Display Properties''</div># On the position will be kept relative to '''Properties''' pane select the bottom margin of '''Text Field Expression''' and open the report regardless of what data is displayed after it'''Text Field Expression Editor'''.*"float"#: [[Image: This value allows the element to "float" and will display the element relative to elements that come before it (iIReport Charts5.e. closer to the top or closer to the left margins).  Using the png|center|500px|''Text Field Expression Editor'']]<div align="center">'float'Text Field Expression Editor'' Position Type can help eliminate </div># To change the overlapping that way a particular field is displayed you can occur when displaying multiple charts or cross tabs use basic "if-then-else" logic as in a single report templateother [[Summarize iReport Template Data#Variable Expressions|Variable Expressions]].This follows the pattern: $F{field} == null ? "Something" : $F{field}
Or nested:
$F{field} == null ? "Something" : $F{field} == "SomethingElse" ? "Something Else" : $F{field}
{{note| The type of field is important (string, float, double, int, date). Stick with strings if you can.}}
Example:
$F{blockWater} == null ? "No value" : $F{blockWater}
{{NavBox HowTo use iReportStandardizing Data Analysis and Information Reporting}}[[Category:NAA]]
6,632
edits

Navigation menu