jxl.write
Interface WritableSheet

public interface WritableSheet
extends Sheet
Interface for a worksheet that may be modified. The most important modification for a sheet is to have cells added to it
SinceNot specified.
VersionNot specified.
AuthorNot specified.
Wiki javadoc Use textile entry format.

jhjk ok

Method Summary
void addCell( WritableCell cell )
Adds a cell to this sheet The RowsExceededException may be caught if client code wishes to explicitly trap the case where too many rows have been written to the current sheet.
void addHyperlink( WritableHyperlink h )
Adds the specified hyperlink.
void addImage( WritableImage image )
Adds an image to the sheet
void addRowPageBreak( int row )
Forces a page break at the specified row
WritableImage getImage( int i )
Accessor for the image
int getNumberOfImages()
Accessor for the number of images on the sheet
WritableCell getWritableCell( int column, int row )
Gets the writable cell from this sheet.
WritableCell getWritableCell( String loc )
Returns the cell for the specified location eg.
WritableHyperlink[] getWritableHyperlinks()
Gets the writable hyperlinks from this sheet.
void insertColumn( int col )
Inserts a blank column into this spreadsheet.
void insertRow( int row )
Inserts a blank row into this spreadsheet.
Range mergeCells( int col1, int row1, int col2, int row2 )
Merges the specified cells.
void removeColumn( int col )
Removes a column from this spreadsheet.
void removeHyperlink( WritableHyperlink h )
Removes the specified hyperlink.
void removeHyperlink( WritableHyperlink h, boolean preserveLabel )
Removes the specified hyperlink.
void removeImage( WritableImage wi )
Removes the specified image from the sheet.
void removeRow( int row )
Removes a row from this spreadsheet.
void setColumnView( int col, int width )
Sets the width of the column on this sheet, in characters.
void setColumnView( int col, int width, CellFormat format )
Sets the width and style of every cell in the specified column.
void setColumnView( int col, CellView view )
Sets the view for this column
void setFooter( String l, String c, String r )
Sets the footer for this page
void setHeader( String l, String c, String r )
Sets the header for this page
void setHidden( boolean hidden )
Indicates whether or not this sheet is hidden
void setName( String name )
Sets the name of this sheet
void setPageSetup( PageOrientation p )
Sets the page setup details
void setPageSetup( PageOrientation p, double hm, double fm )
Sets the page setup details
void setPageSetup( PageOrientation p, PaperSize ps, double hm, double fm )
Sets the page setup details
void setProtected( boolean prot )
Indicates whether or not this sheet is protected
void setRowView( int row, int height )
Sets the height of the specified row, as well as its collapse status
void setRowView( int row, boolean collapsed )
Sets the properties of the specified row
void setRowView( int row, int height, boolean collapsed )
Sets the height of the specified row, as well as its collapse status
void unmergeCells( Range r )
Unmerges the specified cells.
addCell
public void addCell ( WritableCell cell )
Adds a cell to this sheet The RowsExceededException may be caught if client code wishes to explicitly trap the case where too many rows have been written to the current sheet. If this behaviour is not desired, it is sufficient simply to handle the WriteException, since this is a base class of RowsExceededException
Parameters
TypeNameDescription
WritableCell cell the cell to add
Returns void No description provided.
Exceptions
WriteException No description provided.
RowsExceededException No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
addHyperlink
public void addHyperlink ( WritableHyperlink h )
Adds the specified hyperlink. Adding a hyperlink causes any populated cells in the range of the hyperlink to be set to empty If the cells which activate this hyperlink clash with any other cells, they are still added to the worksheet and it is left to Excel to handle this.
Parameters
TypeNameDescription
WritableHyperlink h the hyperlink
Returns void No description provided.
Exceptions
WriteException No description provided.
RowsExceededException No description provided.
Wiki javadoc Use textile entry format.

test comment

addImage
public void addImage ( WritableImage image )
Adds an image to the sheet
Parameters
TypeNameDescription
WritableImage image the image to add
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
addRowPageBreak
public void addRowPageBreak ( int row )
Forces a page break at the specified row
Parameters
TypeNameDescription
int row the row to break at
Returns void No description provided.
Wiki javadoc Use textile entry format.

Stupid

getImage
public WritableImage getImage ( int i )
Accessor for the image
Parameters
TypeNameDescription
int i the 0 based image number
Wiki javadoc Use textile entry format.
Add your comments here.
getNumberOfImages
public int getNumberOfImages ( )
Accessor for the number of images on the sheet
Implements method in Sheet
Wiki javadoc Use textile entry format.
Add your comments here.
getWritableCell
public WritableCell getWritableCell ( int column, int row )
Gets the writable cell from this sheet. Use of this method allows the returned cell to be modified by the users application
Parameters
TypeNameDescription
int column the column
int row the row
Wiki javadoc Use textile entry format.
Add your comments here.
getWritableCell
public WritableCell getWritableCell ( String loc )
Returns the cell for the specified location eg. "A4". Note that this method is identical to calling getCell(CellReferenceHelper.getColumn(loc), CellReferenceHelper.getRow(loc)) and its implicit performance overhead for string parsing. As such,this method should therefore be used sparingly
Parameters
TypeNameDescription
String loc the cell reference
Wiki javadoc Use textile entry format.
Add your comments here.
getWritableHyperlinks
public WritableHyperlink[] getWritableHyperlinks ( )
Gets the writable hyperlinks from this sheet. The hyperlinks that are returned may be modified by user applications
Wiki javadoc Use textile entry format.
Add your comments here.
insertColumn
public void insertColumn ( int col )
Inserts a blank column into this spreadsheet. If the column is out of range of the columns in the sheet, then no action is taken
Parameters
TypeNameDescription
int col the column to insert
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
insertRow
public void insertRow ( int row )
Inserts a blank row into this spreadsheet. If the row is out of range of the rows in the sheet, then no action is taken
Parameters
TypeNameDescription
int row the row to insert
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
mergeCells
public Range mergeCells ( int col1, int row1, int col2, int row2 )
Merges the specified cells. Any clashes or intersections between merged cells are resolved when the spreadsheet is written out
Parameters
TypeNameDescription
int col1 the column number of the top left cell
int row1 the row number of the top left cell
int col2 the column number of the bottom right cell
int row2 the row number of the bottom right cell
Exceptions
WriteException No description provided.
RowsExceededException No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
removeColumn
public void removeColumn ( int col )
Removes a column from this spreadsheet. If the column is out of range of the columns in the sheet, then no action is taken
Parameters
TypeNameDescription
int col the column to remove
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
removeHyperlink
public void removeHyperlink ( WritableHyperlink h )
Removes the specified hyperlink. Note that if you merely set the cell contents to be an Empty cell, then the cells containing the hyperlink will still be active. The contents of the cell which activate the hyperlink are removed. The hyperlink passed in must be a hyperlink retrieved using the getHyperlinks method
Parameters
TypeNameDescription
WritableHyperlink h the hyperlink to remove.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
removeHyperlink
public void removeHyperlink ( WritableHyperlink h, boolean preserveLabel )
Removes the specified hyperlink. Note that if you merely set the cell contents to be an Empty cell, then the cells containing the hyperlink will still be active. If the preserveLabel field is set, the cell contents of the hyperlink are preserved, although the hyperlink is deactivated. If this value is FALSE, the cell contents are removed The hyperlink passed in must be a hyperlink retrieved using the getHyperlinks method
Parameters
TypeNameDescription
WritableHyperlink h the hyperlink to remove.
boolean preserveLabel if TRUE preserves the label contents, if FALSE removes them
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
removeImage
public void removeImage ( WritableImage wi )
Removes the specified image from the sheet. The image passed in must be the same instance as that previously retrieved using the getImage() method
Parameters
TypeNameDescription
WritableImage wi the image to remove
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
removeRow
public void removeRow ( int row )
Removes a row from this spreadsheet. If the row is out of range of the columns in the sheet, then no action is taken
Parameters
TypeNameDescription
int row the row to remove
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setColumnView
public void setColumnView ( int col, int width )
Sets the width of the column on this sheet, in characters. This causes Excel to resize the entire column. If the columns specified already has view information associated with it, then it is replaced by the new data
Parameters
TypeNameDescription
int col the column to be formatted
int width the width of the column
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setColumnView
public void setColumnView ( int col, int width, CellFormat format )
Sets the width and style of every cell in the specified column. If the columns specified already has view information associated with it, then it is replaced by the new data
Parameters
TypeNameDescription
int col the column to be formatted
int width the width of the column, in characters
CellFormat format the format of every cell in the column
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setColumnView
public void setColumnView ( int col, CellView view )
Sets the view for this column
Parameters
TypeNameDescription
int col the column on which to set the view
CellView view the view to set
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setFooter
public void setFooter ( String l, String c, String r )
Sets the footer for this page
Parameters
TypeNameDescription
String l the print header to print on the left side
String c the print header to print in the centre
String r the print header to print on the right hand side
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setHeader
public void setHeader ( String l, String c, String r )
Sets the header for this page
Parameters
TypeNameDescription
String l the print header to print on the left side
String c the print header to print in the centre
String r the print header to print on the right hand side
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setHidden
public void setHidden ( boolean hidden )
Indicates whether or not this sheet is hidden
Parameters
TypeNameDescription
boolean hidden hidden flag
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setName
public void setName ( String name )
Sets the name of this sheet
Parameters
TypeNameDescription
String name the name of the sheet
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setPageSetup
public void setPageSetup ( PageOrientation p )
Sets the page setup details
Parameters
TypeNameDescription
PageOrientation p the page orientation
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setPageSetup
public void setPageSetup ( PageOrientation p, double hm, double fm )
Sets the page setup details
Parameters
TypeNameDescription
PageOrientation p the page orientation
double hm the header margin, in inches
double fm the footer margin, in inches
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setPageSetup
public void setPageSetup ( PageOrientation p, PaperSize ps, double hm, double fm )
Sets the page setup details
Parameters
TypeNameDescription
PageOrientation p the page orientation
PaperSize ps the paper size
double hm the header margin, in inches
double fm the footer margin, in inches
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setProtected
public void setProtected ( boolean prot )
Indicates whether or not this sheet is protected
Parameters
TypeNameDescription
boolean prot Protected flag
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setRowView
public void setRowView ( int row, int height )
Sets the height of the specified row, as well as its collapse status
Parameters
TypeNameDescription
int row the row to be formatted
int height the row height in characters
Returns void No description provided.
Exceptions
RowsExceededException No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setRowView
public void setRowView ( int row, boolean collapsed )
Sets the properties of the specified row
Parameters
TypeNameDescription
int row the row to be formatted
boolean collapsed indicates whether the row is collapsed
Returns void No description provided.
Exceptions
RowsExceededException No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setRowView
public void setRowView ( int row, int height, boolean collapsed )
Sets the height of the specified row, as well as its collapse status
Parameters
TypeNameDescription
int row the row to be formatted
int height the row height in 1/20th of a point
boolean collapsed indicates whether the row is collapsed
Returns void No description provided.
Exceptions
RowsExceededException No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
unmergeCells
public void unmergeCells ( Range r )
Unmerges the specified cells. The Range passed in should be one that has been previously returned as a result of the getMergedCells method
Parameters
TypeNameDescription
Range r the range of cells to unmerge
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.