|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.actuate.util.Debug
|
+--com.f1j.util.Debug
|
+--com.f1j.util.ObjConst
|
+--com.f1j.util.Obj
|
+--com.f1j.ss.XMLWriter
This class writes data from workbook ranges to XML. The resulting XML data can be formatted using an XSLT document.
XMLWriter outputs the following XML tags:| Tag | Attribute | Description | |
<book> |
|||
<sheet> |
name |
string (e.g. "Sheet1") |
|
<range> |
name |
string (e.g. "A1:G30" or "MergedRange" if
ranges have been merged) |
|
<row> |
index |
number (the row number) | |
skip |
number (of rows skipped prior to the last <row> element.
Rows with formatting are not skipped) |
||
height-twips |
number (row height in twips, e.g. 240 = 12pt) | ||
<cell> |
width-twips |
number (cell height in twips, e.g. 240 = 12pt) | |
hidden |
boolean (true = cell is hidden) |
||
locked |
boolean (true = cell is locked) |
||
keys |
string (a list of all defined names referring to this cell) | ||
alignment-horizontal |
string ("left," "center," "right") | ||
alignment-vertical |
string ("top," "center," "bottom") | ||
font-bold |
boolean (true = bold) |
||
font-italic |
boolean (true = italic) |
||
font-color |
RGB value (e.g. 0XFF0000 = red) |
||
font-size-twips |
number (e.g. 240 = 12pt) | ||
merge-horizontal |
number (of cells merged to the right) | ||
merge-vertical |
number (of cells merged down) | ||
pattern-fg |
RGB value (e.g. 0XFF0000 = red) |
||
skip |
number (of cells skipped. Rows with formatting are not skipped) | ||
wrap |
boolean (true = wrap cell text) |
HTMLWriter| Field Summary | |
static short |
eMergeRangeNone
Ranges treated as separate ranges. |
static short |
eMergeRangeRows
Ranges merged into one range. |
| Constructor Summary | |
XMLWriter(Book book)
Constructs an XML file based on data from the designated Book. |
|
| Method Summary | |
short |
getMergeRangeType()
Returns how ranges will be merged (if applicable) when calling the write method. |
boolean |
isSkipEmptyCells()
Returns whether empty cells are skipped. |
boolean |
isWriteFormatAttributes()
Returns whether cell formatting information is written out in the cell tag. |
boolean |
isWriteKeyAttributes()
Returns whether the keys parameter is included in the cell tag. |
void |
setMergeRangeType(short type)
Specifies how ranges are output. |
void |
setSkipEmptyCells(boolean b)
Sets whether empty cells are skipped. |
void |
setWriteFormatAttributes(boolean b)
Sets whether cell formatting information is included within the cell tag in the XML ouput. |
void |
setWriteKeyAttributes(boolean b)
Sets whether the keys parameter is included in the cell tag. |
void |
write(java.lang.String[] formulas,
java.io.InputStream styleSheet,
java.io.OutputStream output)
Writes the given ranges from a worksheet to an output stream and processes the XML output with a user-supplied XSLT document. |
void |
write(java.lang.String[] formulas,
java.io.OutputStream output)
Writes the given ranges from a worksheet to an output stream as XML data. |
void |
write(java.lang.String formula,
java.io.InputStream styleSheet,
java.io.OutputStream output)
Writes the given range from a worksheet to an output stream and processes the XML output with a user-supplied XSLT document. |
void |
write(java.lang.String formula,
java.io.OutputStream output)
Writes the given range from a worksheet to an output stream as XML data. |
| Field Detail |
public static final short eMergeRangeNone
write method wil be placed within a
<range></range> tag.public static final short eMergeRangeRows
formula[] array will be merged within one <range>
</range> tag by outputting <cell>
delimited values for each range before starting a new row. For example, if
you specified the following ranges:
A1:B5, D5:F10, I1:I4
A1 B1 D5 E5 F5 I1
A2 B2 D6 E6 F6 I2
A3 B3 D7 E7 F7 I3
A4 B4 D8 E8 F8 I4
A5 B5 D9 E9 F9 -
- - D10 F10 F10 -
| Constructor Detail |
public XMLWriter(Book book)
Book.book - a Book object.| Method Detail |
public short getMergeRangeType()
write method.eMergeRangeNone = ranges treated separately;
eMergeRangeRows = ranges merged into one.eMergeRangeNone,
eMergeRangeRows,
setMergeRangeType(short)public boolean isSkipEmptyCells()
true is returned,
the skip attribute is included in <row>
and <cell> tags. The skip attribute indicates
how many empty cells occurred in the original range before the cell with the
skip attribute. This optimizes the output stream if the range
contains many empty cells.true/false.setSkipEmptyCells(boolean)public boolean isWriteFormatAttributes()
true/false.setWriteFormatAttributes(boolean),
write(String[] formulas, java.io.InputStream styleSheet, java.io.OutputStream output)public boolean isWriteKeyAttributes()
keys parameter is included in the cell tag.
The keys parameter contains a list of all of the defined names
in the workbook that refer to this cell.true/false.setWriteKeyAttributes(boolean)
public void setMergeRangeType(short type)
throws F1Exception
type - a short indicating how to treat multiple ranges:
eMergeRangeNone = ranges treated separately;
eMergeRangeRows = ranges merged into one.eMergeRangeNone,
eMergeRangeRows,
getMergeRangeType()public void setSkipEmptyCells(boolean b)
true,
the skip attribute is included in <row>
and <cell> tags. The skip attribute indicates
how many empty cells occurred in the original range before the cell with the
skip attribute. This optimizes the output stream if the range
contains many empty cells.b - boolean. true/false.isSkipEmptyCells()public void setWriteFormatAttributes(boolean b)
b - boolean. true/false.isWriteFormatAttributes(),
write(String[] formulas, java.io.InputStream styleSheet, java.io.OutputStream output)public void setWriteKeyAttributes(boolean b)
keys parameter is included in the cell tag.
The keys parameter contains a list of all of the defined names
in the workbook that refer to this cell.true/false.isWriteKeyAttributes()
public void write(java.lang.String formula,
java.io.OutputStream output)
throws F1Exception
formula - the formula describing the range (e.g.
A1:F12) or a defined name.output - the target output stream to which to write the formatted file.formula parameter or if any parameter is invalid.write(String formula, java.io.InputStream styleSheet, java.io.OutputStream output)
public void write(java.lang.String[] formulas,
java.io.OutputStream output)
throws F1Exception
formulas - a formula describing any number of source ranges
(e.g. A1:F12;H1:M12;A14:M25).output - the target output stream to which to write the formatted file.formula parameter or if any parameter is invalid.write(String[] formulas, java.io.InputStream styleSheet, java.io.OutputStream output)
public void write(java.lang.String formula,
java.io.InputStream styleSheet,
java.io.OutputStream output)
throws F1Exception
formula - the formula describing the range (e.g. A1:F12).styleSheet - the XSLT stylesheet used to format the XML data.output - the target output stream to which to write the formatted file.formula parameter or if any parameter is invalid.write(String[] formulas, java.io.InputStream styleSheet, java.io.OutputStream output)
public void write(java.lang.String[] formulas,
java.io.InputStream styleSheet,
java.io.OutputStream output)
throws F1Exception
formulas - a formula describing any number of source ranges
(e.g. A1:F12;H1:M12;A14:M25).styleSheet - the XSLT stylesheet used to format the XML data.output - the target output stream to which to write the formatted file.formula parameter or another parameter is invalid.write(String formula, java.io.InputStream styleSheet, java.io.OutputStream output)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||