com.f1j.data
Interface DataRange


public interface DataRange
extends DataRangeFormatIterator

This interface provides the API for interacting with a data range on a sheet.


Field Summary
static short eCellFormatting_Clear
          Clear all cell formatting.
static short eCellFormatting_DRML
          Use DRML formatting.
static short eCellFormatting_Manual
          Use Manual formatting.
static short eCellFormatting_Preserve
          Preserve all cell formatting.
static short eCellFormatting_ReplicateFirstRow
          Copy formatting from worksheet first row.
static short eCellFormatting_XML
          Deprecated. As of e.Spreadsheet 10, use eCellFormatting_DRML instead.
static short eCellFormatting_XSLT
          Deprecated. As of e.Spreadsheet 10, use eCellFormatting_DRML instead.
static short eInsertClearRows
          Refresh by replacing worksheet rows in data range.
static short eInsertDeleteCells
          Refresh by replacing worksheet cells in data range.
static short eOverwriteClearCells
          Refresh by pasting data in existing data range cells.
 
Method Summary
 short getCellFormattingMode()
          Returns this data range's cell formatting mode.
 int getColumnNumber()
          Returns the column number of the upper left corner of the range.
 short getInsertMode()
          Returns this data range's current insert mode.
 java.lang.String getName()
          Returns the name of this data range.
 DataQuery getQuery()
          Returns the query that this data range is listening to.
 RangeRef getRangeRef()
          Returns the size of the data range
 int getRowNumber()
          Returns the row number of the upper left corner of the range.
 Sheet getSheet()
          Returns the sheet that this data range belongs to.
 XSLTDocument getXSLTDocument()
          Returns the XSLT Document associated with this data range.
 boolean intersects(int row, int column)
          Indicates whether the specified location on the sheet is contained within this data range.
 boolean isAdjustColWidth()
          Returns whether this range has adjust column width turned on.
 boolean isFillDownFormulasAdjacentToRange()
          Returns whether this data range has formula fill down turned on.
 boolean isIncludeFieldNames()
          Returns whether this data range includes field names.
 boolean isIncludeRowNumbers()
          Returns whether this data range has row numbers as its first column.
 boolean isUseDrmlFormatting()
          Returns whether this data range is set to use DRML formatting information.
 void setAdjustColWidth(boolean adjust)
          Sets this range's adjust column width mode.
 void setCellFormattingMode(short mode)
          Sets this data range's cell formatting mode.
 void setFillDownFormulasAdjacentToRange(boolean fillDown)
          Sets this data range's formula fill down mode.
 void setIncludeFieldNames(boolean include)
          Sets this data range to include field names.
 void setIncludeRowNumbers(boolean include)
          Sets this data range to have the number of each row as it's first column.
 void setInsertMode(short mode)
          Sets this data range's current insert mode.
 void setName(java.lang.String name)
          Sets the name of the DataRange object along with setting the defined name.
 
Methods inherited from interface com.f1j.data.DataRangeFormatIterator
getCellConditionalFormats, getCellFormat, getRangeConditionalFormats, getRangeFormat, getRowConditionalFormats, getRowFormat, insertRowPageBreak, setCellConditionalFormatUsed, setColumnOutlineCollapsed, setColumnOutlineLevel, setColumnSummaryBeforeDetail, setColumnWidth, setDefaultColumnWidth, setDefaultRowHeight, setFormula, setRangeConditionalFormatUsed, setRowConditionalFormatUsed, setRowHeight, setRowHidden, setRowOutlineCollapsed, setRowOutlineLevel, setRowSummaryBeforeDetail, startCell, updateCellName, updateRowName
 
Methods inherited from interface com.f1j.data.DataRangeIterator
endCell, endColumnName, endFieldInfo, endMetaData, endRange, endRow, setCell, setCell, setCell, setCellAsText, setCellHyperlink, setColumnName, setFieldLabel, setFieldName, setTableName, startCell, startColumnName, startFieldInfo, startMetaData, startRange, startRow
 

Field Detail

eCellFormatting_Clear

public static final short eCellFormatting_Clear
Clear all cell formatting.

eCellFormatting_Preserve

public static final short eCellFormatting_Preserve
Preserve all cell formatting.

eCellFormatting_ReplicateFirstRow

public static final short eCellFormatting_ReplicateFirstRow
Copy formatting from worksheet first row.

eCellFormatting_DRML

public static final short eCellFormatting_DRML
Use DRML formatting.

eCellFormatting_XSLT

public static final short eCellFormatting_XSLT
Deprecated. As of e.Spreadsheet 10, use eCellFormatting_DRML instead.
Use XSLT formatting.

eCellFormatting_XML

public static final short eCellFormatting_XML
Deprecated. As of e.Spreadsheet 10, use eCellFormatting_DRML instead.
Use XML formatting.

eCellFormatting_Manual

public static final short eCellFormatting_Manual
Use Manual formatting.

eInsertDeleteCells

public static final short eInsertDeleteCells
Refresh by replacing worksheet cells in data range.

eInsertClearRows

public static final short eInsertClearRows
Refresh by replacing worksheet rows in data range.

eOverwriteClearCells

public static final short eOverwriteClearCells
Refresh by pasting data in existing data range cells.
Method Detail

getCellFormattingMode

public short getCellFormattingMode()
Returns this data range's cell formatting mode.
Returns:
a short indicating the current formatting mode:

Cell Formatting Mode Constants
Mode Description Integer
eCellFormatting_Clear clear existing database formatting
1
eCellFormatting_Preserve keep existing database formatting 2
eCellFormatting_ReplicateFirstRow   use formatting from first row of datarange 3
eCellFormatting_XSLT use formatting from XSL applied to range 4
eCellFormatting_XML use formatting from XML being imported into F1 5
eCellFormatting_Manual formatting info will be provided through the DataRangeFormatIterator API 6

See Also:
setCellFormattingMode(short)

getColumnNumber

public int getColumnNumber()
Returns the column number of the upper left corner of the range.
Returns:
an integer indicating the column. Rows and columns are indexed beginning with 0.
See Also:
getRowNumber()

getName

public java.lang.String getName()
Returns the name of this data range.
Returns:
a String representing the defined name.
See Also:
setName(java.lang.String)

getInsertMode

public short getInsertMode()
Returns this data range's current insert mode. The insert mode effects how data is placed onto the sheet.
Returns:
a short indicating the insert mode:

Insert Mode Constants
eInsertDeleteCells Deletes all cells from existing range (even if larger than new range). Replaces with new, unformattted cells with data source data.
eInsertClearRows Replaces existing rows with new, unformatted rows with data source data.
eOverwriteClearCells   Replaces existing data with data source data, leaving worksheet cell formatting as previously set by the setCellFormattingMode method.

See Also:
setInsertMode(short)

getSheet

public Sheet getSheet()
Returns the sheet that this data range belongs to.
Returns:
a Sheet object.
See Also:
BookModel.getSheet(), BookModel.setSheet(int)

getQuery

public DataQuery getQuery()
Returns the query that this data range is listening to.
Returns:
a DataQuery object.
See Also:
DataQuery

getRowNumber

public int getRowNumber()
Returns the row number of the upper left corner of the range.
Returns:
an integer indicating the row. Rows and columns are indexed beginning with 0.
See Also:
getColumnNumber()

getXSLTDocument

public XSLTDocument getXSLTDocument()
Returns the XSLT Document associated with this data range. Note that this is an e.Spreadsheet class that represents the document.
Returns:
an XSLTDocument object.
See Also:
XSLTDocument.getDocument()

intersects

public boolean intersects(int row,
                          int column)
Indicates whether the specified location on the sheet is contained within this data range.
Parameters:
row - an integer specifying the row. Rows and columns are indexed beginning with 0.
column - an integer specifying the column. Rows and columns are indexed beginning with 0.
Returns:
boolean: true or false. true = location is within the data range

isAdjustColWidth

public boolean isAdjustColWidth()
Returns whether this range has adjust column width turned on. The adjust column width feature causes the column width to be recalculated on each refresh based on the largest item in the column.
Returns:
boolean: true or false. true = adjust column width is turned on.
See Also:
setAdjustColWidth(boolean)

isFillDownFormulasAdjacentToRange

public boolean isFillDownFormulasAdjacentToRange()
Returns whether this data range has formula fill down turned on. The formula fill down feature takes a formula in the topmost row of the column to the right of the data range and copies it down into all the cells in that column for the length of the range. This process continues for every succesive column contiguous with the data range that contains a formula until a column with no formula to copy down is encountered.
Returns:
boolean: true or false. true = formula fill down is turned on.
See Also:
getXSLTDocument(), setFillDownFormulasAdjacentToRange(boolean)

isIncludeFieldNames

public boolean isIncludeFieldNames()
Returns whether this data range includes field names. Field names are derived from the data source content. This flag is ignored when importing data source data without field names.

Note that you can also do this by assigning an XSLT document to the data range. XSLT provides much richer formatting options.

This method is only valid when the data source is created from a database (not a file).

Returns:
boolean: true or false. true = data range includes field names.
See Also:
getXSLTDocument(), setIncludeFieldNames(boolean)

isIncludeRowNumbers

public boolean isIncludeRowNumbers()
Returns whether this data range has row numbers as its first column.
Returns:
boolean: true or false. true = data range first column is row numbers.
See Also:
setIncludeRowNumbers(boolean)

isUseDrmlFormatting

public boolean isUseDrmlFormatting()
Returns whether this data range is set to use DRML formatting information.
Returns:
boolean: true or false. true = data range is set to use DRML formatting information.

setAdjustColWidth

public void setAdjustColWidth(boolean adjust)
Sets this range's adjust column width mode. The adjust column width feature recalculates column width on each refresh. Column width is based on the largest item in the column.
Parameters:
adjust - boolean: true or false. true = recalculate column width on refresh.
See Also:
isAdjustColWidth()

setCellFormattingMode

public void setCellFormattingMode(short mode)
                           throws F1Exception
Sets this data range's cell formatting mode.
Parameters:
mode - a short describing the cell formatting mode:

Cell Formatting Mode Constants
Mode Description Integer
eCellFormatting_Clear clear existing database formatting
1
eCellFormatting_Preserve keep existing database formatting 2
eCellFormatting_ReplicateFirstRow   use formatting from first row of datarange 3
eCellFormatting_XSLT use XSLT formatting 4

Throws:
F1Exception - if parameter is invalid
See Also:
getCellFormattingMode()

setFillDownFormulasAdjacentToRange

public void setFillDownFormulasAdjacentToRange(boolean fillDown)
Sets this data range's formula fill down mode. The formula fill down feature takes a formula in the topmost row of the column to the right of the data range and copies it down into all the cells in that column for the length of the range. This process continues for every succesive column contiguous with the data range that contains a formula until a column with no formula to copy down is encountered.

Note that you can also do this by assigning an XSLT document to the data range. XSLT provides much richer formatting options.

Parameters:
fillDown - boolean: true or false. true = turn on fill down feature.
See Also:
isFillDownFormulasAdjacentToRange()

setIncludeFieldNames

public void setIncludeFieldNames(boolean include)
Sets this data range to include field names. Field names are derived from the data source content. This flag is ignored when importing data source data without field names.

This method is only valid when the data source is created from a database (not a file).

Note that you can also do this by assigning an XSLT document to the data range. XSLT provides much richer formatting options.

Parameters:
include - boolean: true or false. true = include field names.
See Also:
isIncludeFieldNames()

setInsertMode

public void setInsertMode(short mode)
Sets this data range's current insert mode. The insert mode effects how data is placed onto the sheet.
Parameters:
mode - an insert mode constant:
Insert Mode Constants
eInsertDeleteCells Deletes all cells from existing range (even if larger than new range). Replaces with new, unformattted cells with data source data.
eInsertClearRows Replaces existing rows with new, unformatted rows with data source data.
eOverwriteClearCells   Replaces existing data with data source data, leaving worksheet cell formatting as previously set by the setCellFormattingMode method.

See Also:
getInsertMode()

setIncludeRowNumbers

public void setIncludeRowNumbers(boolean include)
Sets this data range to have the number of each row as it's first column.
Parameters:
include - boolean: true or false. true = row numbers are first column.
See Also:
isIncludeRowNumbers()

setName

public void setName(java.lang.String name)
             throws F1Exception
Sets the name of the DataRange object along with setting the defined name. Note: Naming multiple ranges with the same name and attempting to associate them with a single query will silently fail.
Parameters:
name - defined name for the DataRange object.
Throws:
F1Exception - if parameter is invalid
See Also:
getName()

getRangeRef

public RangeRef getRangeRef()
Returns the size of the data range