Exporting iReports to set Excel freeze frame property

advertisement
Exporting iReports to set Excel freeze frame property
1. From: http://jasperreports.sourceforge.net/sample.reference/xlsfeatures/
Freeze Pane Properties
Freeze panes represent an Excel-specific feature with considerable visual impact, so they have their well deserved
place among special features supported by JR. There are multiple ways to define freeze panes in JR and they can
also be combined, in order to cover a large variety of situations.

The first category of properties contain settings for the entire document. There are separate properties for
rows and column in order to allow possible combinations with properties at element level. The 2 documentlevel properties are
o net.sf.jasperreports.export.xls.freeze.row and
o net.sf.jasperreports.export.xls.freeze.column
Their values should represent valid row indexes and column names in Excel. The freeze row (or column)
property defined at report level can be combined with a freeze column (or row) property defined at element
level to delimit the freeze pane edges. As usual, element-level settings will override document-level settings.

The element-level properties define the freeze pane edges for the current sheet only. If multiple elements in
the same sheet provide freeze pane properties, the maximum values for these properties are taken into
account. Element-level properties are
o net.sf.jasperreports.export.xls.freeze.row.edge and
o net.sf.jasperreports.export.xls.freeze.column.edge
The element-level properties can take a predefined set of values: Left and Right for
the net.sf.jasperreports.export.xls.freeze.column.edge, Top and Bottom for
thenet.sf.jasperreports.export.xls.freeze.row.edge.
The last 2 freeze pane properties are illustrated in the XlsFeaturesReport.jrxml sample report: the column
edge is set for the State element and the row edge is set for the Street element, both in the page header
<property name="net.sf.jasperreports.export.xls.freeze.column.edge"
value="Left"/>
<property name="net.sf.jasperreports.export.xls.freeze.row.edge"
value="Bottom"/>
These settings instruct the engine that the left columns to the State element and all rows above, including the
current row, are "frozen".
2. From:
asperreports.sourceforge.net/api/net/sf/jasperreports/engine/export/JRXlsAbstractExporter.html#PROPERT
Y_FREEZE_ROW
PROPERTY_FREEZE_ROW
public static final java.lang.String PROPERTY_FREEZE_ROW
Specifies the index of the first unlocked row in document's sheets. All rows above this will be 'frozen'. Allowed values
are represented by positive integers in the 1..65536 range. Negative values are not considered. The property should
be used when all sheets in the document have the same freeze row index.
See Also:
Constant Field Values
3. From: http://community.jaspersoft.com/jasperreports-library/issues/4525
A set of 4 new exporter hint properties were added in JR, with the following meanings:
1. net.sf.jasperreports.export.xls.freeze.row - specifies the index of the first unlocked row in the
sheet. All rows above this will be 'frozen'. Possible values for this property are positive integers in the
0..65536 range. Negative values are not considered. This property may be defined at report or
global level.
2. net.sf.jasperreports.export.xls.freeze.column - indicates the name of the first unlocked column in
the sheet. All columns to the left of this one will be 'frozen'. Possible values for this property are
letters or letter combinations representing valid column names in Excel, like A, B, AB, AC, etc. This
property may be defined at report or global level.
3. net.sf.jasperreports.export.xls.freeze.row.edge - indicates the horizontal edge of the freeze pane,
relative to the current cell. Possible values are:
- Top - the current row is the first unlocked row in the sheet. All rows above are 'frozen'.
- Bottom - the current row is the last 'frozen' row in the sheet. All rows below are unlocked.
This property may be defined at element level.
4. net.sf.jasperreports.export.xls.freeze.column.edge - indicates the vertical edge of the freeze pane,
relative to the current cell. Possible values are:
- Left - the current column is the first unlocked column in the sheet. All columns to the left are
'frozen'.
- Right - the current column is the last 'frozen' column in the sheet. All columns to the right are
unlocked.
This property may be defined at element level.
Properties defined at element level take precedence over those defined at report level.
Sources were committed on svn rev.4450.
Download