Changes

Jump to: navigation, search

Format an iReport Template

530 bytes added, 01:19, 22 September 2013
no edit summary
*change colors, fonts, and other properties
*perform conditional displays based on data in the report
 
 
==Adding Formatting Elements==
Additional formatting elements can be added to the iReport template. These include lines, boxes, circles, etc. To add these elements to iReport template:
# Ensure that '''Palette''' pane is available. If not, on the '''Window''' menu, select '''Palette'''.
# Select the desired element and drag it to the iReport template.
 
==Formatting iReport Elements==
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 value)
#: [[Image:IReport Display Properties.png|center|300px|''Display Properties'']]<div align="center">''Display Properties''</div>
 
===Position and Size Elements===
*Left
*Top
*Width
*Height
 
===Color===
*Forecolor
*BackColor
*Opaque
 
===Text Properties===
*:[[Image:IReport Text Properties.png|center|300px|''Text Properties'']]<div align="center">''Text Properties''</div>
*Font Name
*Size
*Bold/Italic
*Horizontal and Vertical Alignment
*: [[Image:IReport Formatting Bar.png|center|300px|''Text Formatting Bar'']]<div align="center">''Text Formatting Bar''</div>
 
===Number and Date Specific Patterns===
** 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 desired.
===Position Type===
Because iReport elements can expand beyond their expected or allocated vertical space on the report template, 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.
[[Image:IReport Display Properties.png|center|300px|''Formatting Tools'']]<div align="center">''Formatting Tools''</div>
 
The '''Position Type''' property has three options:
*"fix relative to top": This is the default value for 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": 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).
 
Using the '''float''' Position Type can help eliminate the overlapping that can occur when displaying multiple charts or cross tabs in a single report template.
 
==Formatting Tools==
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'''.
#: [[Image:IReport Formatting Tools.png|center|300px|''Formatting Tools'']]<div align="center">''Formatting Tools''</div>
# 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==
Example:
$F{blockWater} == null ? “No value" : $F{blockWater}
 
==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 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 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 desired.
 
==Adding Formatting Elements==
Additional formatting elements can be added to the iReport template. These include lines, boxes, circles, etc. To add these elements to iReport template:
# Ensure that '''Palette''' pane is available. If not, on the '''Window''' menu, select '''Palette'''.
# Select the desired element and drag it to the iReport template.
 
==Formatting Tools==
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'''.
#: [[Image:IReport Formatting Tools.png|center|300px|''Formatting Tools'']]<div align="center">''Formatting Tools''</div>
# Select the desired element or elements (multiple elements can be selected by using the '''Control-click''' key combination) and apply the desired formatting choice.
 
=="fix relative to" vs. "float"==
Because iReport elements can expand beyond their expected or allocated vertical space on the report template, 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.
[[Image:IReport Display Properties.png|center|300px|''Formatting Tools'']]<div align="center">''Formatting Tools''</div>
 
The '''Position Type''' property has three options:
*"fix relative to top": This is the default value for 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": 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).
 
Using the '''float''' Position Type can help eliminate the overlapping that can occur when displaying multiple charts or cross tabs in a single report template.
 
 
 
{{NavBox HowTo use iReport}}
319
edits

Navigation menu