com.spire.xls.core
Interface IWorksheet

All Known Implementing Classes:
Worksheet, XlsWorksheet

public interface IWorksheet

Represents a worksheet. The Worksheet object is a member of the Worksheets collection. The Worksheets collection contains all the Worksheet objects in a workbook.


Method Summary
 void autoFitColumn(int columnIndex)
          Autofits specified column.
 void autoFitRow(int rowIndex)
          Autofits specified row.
 boolean checkExistence(int iRow, int iColumn)
          Indicates whether a cell was initialized or accessed by the user.
 void clear()
          Clears worksheet data.
 void clearData()
          Clears worksheet.
 int columnWidthToPixels(double widthInChars)
          Converts column width into pixels.
 void copyToClipboard()
          Copies worksheet into the clipboard.
 void createNamedRanges(java.lang.String namedRange, java.lang.String referRange, boolean vertical)
          Creates object that can be used for template markers processing.
 void deleteColumn(int index)
          Removes specified column (with formulas update).
 void deleteRow(int index)
          Removes specified row (with formulas update).
 IXLSRange get(int row, int column)
          Gets / sets cell by row and index.
 IXLSRange get(int row, int column, int lastRow, int lastColumn)
          Get cells range.
 IXLSRange get(java.lang.String name)
          Get cell range.
 int getActivePane()
          Identifier of pane with active cell cursor.
 IXLSRange getAllocatedRange()
          Returns a Range object that represents a cell or a range of cells.
 IAutoFilters getAutoFilters()
          Returns collection of worksheet's autofilters.
 boolean getBoolean(int row, int column)
          Gets bool value from cell.
 IXLSRange[] getCells()
          Returns all used cells in the worksheet.
 java.lang.String getCodeName()
          Name that is used by macros to access the workbook items.
 IXLSRange[] getColumns()
          For a Worksheet object, returns an array of Range objects that represents all the columns on the specified worksheet.
 int getColumnWidthPixels(int Column)
          Returns width in pixels from ColumnInfoRecord if there is corresponding ColumnInfoRecord or StandardWidth if not.
 IComments getComments()
           
 IStyle getDefaultColumnStyle(int iColumnIndex)
          Returns default column style.
 double getDefaultColumnWidth()
          Returns the standard (default) width of all the columns in the worksheet.
 double getDefaultRowHeight()
          Returns the standard (default) height of all the rows in the worksheet, in points.
 IStyle getDefaultRowStyle(int rowIndex)
          Returns default row style.
 boolean getDisplayPageBreaks()
          True if page breaks (both automatic and manual) on the specified worksheet are displayed.
 java.lang.String getError(int row, int column)
          Gets error value from cell.
 int getFirstVisibleColumn()
          Index to first visible column in right pane(s).
 int getFirstVisibleRow()
          Index to first visible row in bottom pane(s).
 java.lang.String getFormula(int row, int column, boolean bR1C1)
          Returns formula value corresponding to the cell.
 boolean getFormulaBoolValue(int row, int column)
          Gets formula bool value from cell.
 java.lang.String getFormulaErrorValue(int row, int column)
          Gets formula error value from cell.
 double getFormulaNumberValue(int row, int column)
          Returns formula number value corresponding to the cell.
 java.lang.String getFormulaStringValue(int row, int column)
          Returns formula string value corresponding to the cell.
 ExcelColors getGridLineColor()
          Gets Grid line color.
 boolean getGridLinesVisible()
          True if gridlines are visible; False otherwise.
 int getHorizontalSplit()
          Position of the horizontal split (py, 0 = No horizontal split): Unfrozen pane: Height of the top pane(s) (in twips = 1/20 of a point) Frozen pane: Number of visible rows in top pane(s)
 IHPageBreaks getHPageBreaks()
          Returns an HPageBreaks collection that represents the horizontal page breaks on the sheet.
 IHyperLinks getHyperLinks()
          Collection of all worksheet's hyperlinks.
 int getIndex()
          Returns the index number of the object within the collection of similar objects.
 int getLeftVisibleColumn()
          Gets left visible column of the worksheet.
 IListObjects getListObjects()
          Gets collection of all list objects in the worksheet.
 IXLSRange[] getMergedCells()
          Returns all merged ranges.
 INameRanges getNames()
          For a Worksheet object, returns a Names collection that represents all the worksheet-specific names (names defined with the "WorksheetName!" prefix).
 double getNumber(int row, int column)
          Returns number value corresponding to the cell.
 IOleObjects getOleObjects()
          Gets the OLE objects.
 IPageSetup getPageSetup()
          Returns a PageSetup object that contains all the page setup settings for the specified object.
 PivotTablesCollection getPivotTables()
          Returns pivot table collection containing all pivot tables in the worksheet.
 XlsRange getRange()
          Returns a Range object that represents the used range on the specified worksheet.
 boolean getRowColumnHeadersVisible()
          True if row and column headers are visible; False otherwise.
 int getRowHeightPixels(int Row)
          Returns height from RowRecord if there is a corresponding RowRecord.
 IXLSRange[] getRows()
          For a Worksheet object, returns an array of Range objects that represents all the rows on the specified worksheet.
 java.lang.String getText(int row, int column)
          Returns string value corresponding to the cell.
 int getTopVisibleRow()
          Gets top visible row of the worksheet.
 ExcelSheetType getType()
          Returns or sets the worksheet type.
 boolean getUseRangesCache()
          Indicates whether all created range objects should be cached.
 int getVerticalSplit()
          Position of the vertical split (px, 0 = No vertical split): Unfrozen pane: Width of the left pane(s) (in twips = 1/20 of a point) Frozen pane: Number of visible columns in left pane(s)
 IVPageBreaks getVPageBreaks()
          Returns a VPageBreaks collection that represents the vertical page breaks on the sheet.
 int getZoom()
          Zoom factor of document.
 boolean hasOleObjects()
          Gets or sets a value indicating whether this instance is OLE object.
 int insertArray(java.util.Date[] arrDate, int firstRow, int firstColumn, boolean isVertical)
          Imports an array of DateTimes into worksheet.
 int insertArray(java.lang.Double[] arrDouble, int firstRow, int firstColumn, boolean isVertical)
          Imports an array of doubles into a worksheet.
 int insertArray(int[] arrInt, int firstRow, int firstColumn, boolean isVertical)
          Imports an array of integers into a worksheet.
 int insertArray(java.lang.Object[][] arrObject, int firstRow, int firstColumn)
          Imports an array of objects into a worksheet.
 int insertArray(java.lang.Object[] arrObject, int firstRow, int firstColumn, boolean isVertical)
          Imports an array of objects into a worksheet.
 int insertArray(java.lang.String[] arrString, int firstRow, int firstColumn, boolean isVertical)
          Imports an array of strings into a worksheet.
 int insertDataColumn(com.spire.data.table.DataColumn dataColumn, boolean isFieldNameShown, int firstRow, int firstColumn)
          Imports data from a DataColumn into worksheet.
 int insertDataTable(com.spire.data.table.DataTable dataTable, boolean isFieldNameShown, int firstRow, int firstColumn)
          Imports data from a DataTable into worksheet.
 int insertDataTable(com.spire.data.table.DataTable dataTable, boolean isFieldNameShown, int firstRow, int firstColumn, boolean preserveTypes)
          Imports data from a DataTable into worksheet.
 int insertDataTable(com.spire.data.table.DataTable dataTable, boolean isFieldNameShown, int firstRow, int firstColumn, int maxRows, int maxColumns)
          Imports data from a DataTable into worksheet.
 int insertDataTable(com.spire.data.table.DataTable dataTable, boolean isFieldNameShown, int firstRow, int firstColumn, int maxRows, int maxColumns, boolean preserveTypes)
          Imports data from a DataTable into worksheet.
 int insertDataView(com.spire.data.table.DataView dataView, boolean isFieldNameShown, int firstRow, int firstColumn)
          Imports data from a DataView into worksheet.
 int insertDataView(com.spire.data.table.DataView dataView, boolean isFieldNameShown, int firstRow, int firstColumn, boolean bPreserveTypes)
          Imports data from a DataView into worksheet.
 int insertDataView(com.spire.data.table.DataView dataView, boolean isFieldNameShown, int firstRow, int firstColumn, int maxRows, int maxColumns)
          Imports data from a DataView into worksheet.
 int insertDataView(com.spire.data.table.DataView dataView, boolean isFieldNameShown, int firstRow, int firstColumn, int maxRows, int maxColumns, boolean bPreserveTypes)
          Imports data from a DataView into worksheet.
 boolean isColumnVisible(int columnIndex)
          Method check is Column with specifed index visible to end user or not.
 boolean isDisplayZeros()
          True if zero values to be displayed False otherwise.
 void isDisplayZeros(boolean value)
          True if zero values to be displayed False otherwise.
 boolean isRowVisible(int rowIndex)
          Method check is Row with specifed index visible to user or not.
 boolean isStringsPreserved()
          Indicates if all values in the workbook are preserved as strings.
 void isStringsPreserved(boolean value)
          Indicates if all values in the workbook are preserved as strings.
 void moveWorksheet(int iNewIndex)
          Moves worksheet.
 double pixelsToColumnWidth(double pixels)
          Converts pixels into column width (in characters).
 void protect(java.lang.String password)
          Protects worksheet's content with password.
 void remove()
          Removes worksheet from parent worksheets collection.
 void removePanes()
          Removes panes from a worksheet.
 void replace(java.lang.String oldValue, com.spire.data.table.DataColumn newValues, boolean isFieldNamesShown)
          Replaces specified string by data column values.
 void replace(java.lang.String oldValue, com.spire.data.table.DataTable newValues, boolean isFieldNamesShown)
          Replaces specified string by data table values.
 void replace(java.lang.String oldValue, java.util.Date newValue)
          Replaces specified string by specified value.
 void replace(java.lang.String oldValue, double newValue)
          Replaces specified string by specified value.
 void replace(java.lang.String oldValue, double[] newValues, boolean isVertical)
          Replaces specified string by data from array.
 void replace(java.lang.String oldValue, int[] newValues, boolean isVertical)
          Replaces specified string by data from array.
 void replace(java.lang.String oldValue, java.lang.String newValue)
          Replaces specified string by specified value.
 void replace(java.lang.String oldValue, java.lang.String[] newValues, boolean isVertical)
          Replaces specified string by data from array.
 void saveToFile(java.lang.String fileName, java.lang.String separator)
          Save tabsheet using separator.
 com.spire.ms.System.Drawing.Image saveToImage(int firstRow, int firstColumn, int lastRow, int lastColumn)
          Converts range into image (Bitmap).
 com.spire.ms.System.Drawing.Image saveToImage(com.spire.ms.System.IO.Stream outputStream, int firstRow, int firstColumn, int lastRow, int lastColumn, ImageType imageType, int emfType)
          Converts range into image.
 com.spire.ms.System.Drawing.Image saveToImage(com.spire.ms.System.IO.Stream stream, int firstRow, int firstColumn, int lastRow, int lastColumn, int imageType)
          Converts range into image.
 void saveToStream(com.spire.ms.System.IO.Stream stream, java.lang.String separator)
          Save tabsheet using separator.
 void setActivePane(int value)
          Identifier of pane with active cell cursor.
 void setBlank(int iRow, int iColumn)
          Sets blank in specified cell.
 void setBoolean(int iRow, int iColumn, boolean value)
          Sets value in the specified cell.
 void setColumnWidthInPixels(int columnIndex, int value)
          Sets column width.
 void setDefaultColumnStyle(int iStartColumnIndex, int iEndColumnIndex, IStyle defaultStyle)
          Sets by column index default style for column.
 void setDefaultColumnStyle(int iColumnIndex, IStyle defaultStyle)
          Sets by column index default style for column.
 void setDefaultColumnWidth(double value)
          Sets the standard (default) width of all the columns in the worksheet.
 void setDefaultRowHeight(double value)
          Sets the standard (default) height of all the rows in the worksheet, in points.
 void setDefaultRowStyle(int iStartRowIndex, int iEndRowIndex, IStyle defaultStyle)
          Sets by column index default style for row.
 void setDefaultRowStyle(int rowIndex, IStyle defaultStyle)
          Sets by column index default style for row.
 void setError(int iRow, int iColumn, java.lang.String value)
          Sets error in the specified cell.
 void setFirstVisibleColumn(int value)
          Index to first visible column in right pane(s).
 void setFirstVisibleRow(int value)
          Index to first visible row in bottom pane(s).
 void setFormula(int iRow, int iColumn, java.lang.String value)
          Sets formula in the specified cell.
 void setFormulaBoolValue(int iRow, int iColumn, boolean value)
          Sets formula bool value.
 void setFormulaErrorValue(int iRow, int iColumn, java.lang.String value)
          Sets formula error value.
 void setFormulaNumberValue(int iRow, int iColumn, double value)
          Sets formula number value.
 void setFormulaStringValue(int iRow, int iColumn, java.lang.String value)
          Sets formula string value.
 void setGridLineColor(ExcelColors value)
          Sets Grid line color.
 void setGridLinesVisible(boolean value)
          True if gridlines are visible; False otherwise.
 void setHorizontalSplit(int value)
          Position of the horizontal split (py, 0 = No horizontal split): Unfrozen pane: Height of the top pane(s) (in twips = 1/20 of a point) Frozen pane: Number of visible rows in top pane(s)
 void setLeftVisibleColumn(int value)
          Sets left visible column of the worksheet.
 void setNumber(int iRow, int iColumn, double value)
          Sets value in the specified cell.
 void setRowColumnHeadersVisible(boolean value)
          True if row and column headers are visible; False otherwise.
 void setRowHeightPixels(int Row, double value)
          Sets row height in pixels.
 void setText(int iRow, int iColumn, java.lang.String value)
          Sets text in the specified cell.
 void setTopVisibleRow(int value)
          Sets top visible row of the worksheet.
 void setValue(int iRow, int iColumn, java.lang.String value)
          Sets value in the specified cell.
 void setVerticalSplit(int value)
          Position of the vertical split (px, 0 = No vertical split): Unfrozen pane: Width of the left pane(s) (in twips = 1/20 of a point) Frozen pane: Number of visible columns in left pane(s)
 void setZoom(int value)
          Zoom factor of document.
 void unprotect(java.lang.String password)
          Unprotects worksheet's content with password.
 

Method Detail

getAutoFilters

IAutoFilters getAutoFilters()
Returns collection of worksheet's autofilters. Read-only.


getCells

IXLSRange[] getCells()
Returns all used cells in the worksheet. Read-only.


getDisplayPageBreaks

boolean getDisplayPageBreaks()
True if page breaks (both automatic and manual) on the specified worksheet are displayed. Read / write Boolean.


getIndex

int getIndex()
Returns the index number of the object within the collection of similar objects. Read-only.


getMergedCells

IXLSRange[] getMergedCells()
Returns all merged ranges. Read-only.


getNames

INameRanges getNames()
For a Worksheet object, returns a Names collection that represents all the worksheet-specific names (names defined with the "WorksheetName!" prefix). Read-only Names object.


getCodeName

java.lang.String getCodeName()
Name that is used by macros to access the workbook items.


getPageSetup

IPageSetup getPageSetup()
Returns a PageSetup object that contains all the page setup settings for the specified object. Read-only.


getAllocatedRange

IXLSRange getAllocatedRange()
Returns a Range object that represents a cell or a range of cells.


getRows

IXLSRange[] getRows()
For a Worksheet object, returns an array of Range objects that represents all the rows on the specified worksheet. Read-only Range object.


getColumns

IXLSRange[] getColumns()
For a Worksheet object, returns an array of Range objects that represents all the columns on the specified worksheet. Read-only Range object.


getDefaultRowHeight

double getDefaultRowHeight()
Returns the standard (default) height of all the rows in the worksheet, in points. Read-only Double.


setDefaultRowHeight

void setDefaultRowHeight(double value)
Sets the standard (default) height of all the rows in the worksheet, in points. Read-only Double.


getDefaultColumnWidth

double getDefaultColumnWidth()
Returns the standard (default) width of all the columns in the worksheet. Read Double.


setDefaultColumnWidth

void setDefaultColumnWidth(double value)
Sets the standard (default) width of all the columns in the worksheet. Write Double.


getType

ExcelSheetType getType()
Returns or sets the worksheet type. Read-only ExcelSheetType.


getRange

XlsRange getRange()
Returns a Range object that represents the used range on the specified worksheet. Read-only.


getZoom

int getZoom()
Zoom factor of document. Value must be in range from 10 till 400.


setZoom

void setZoom(int value)
Zoom factor of document. Value must be in range from 10 till 400.


getVerticalSplit

int getVerticalSplit()
Position of the vertical split (px, 0 = No vertical split): Unfrozen pane: Width of the left pane(s) (in twips = 1/20 of a point) Frozen pane: Number of visible columns in left pane(s)


setVerticalSplit

void setVerticalSplit(int value)
Position of the vertical split (px, 0 = No vertical split): Unfrozen pane: Width of the left pane(s) (in twips = 1/20 of a point) Frozen pane: Number of visible columns in left pane(s)


getHorizontalSplit

int getHorizontalSplit()
Position of the horizontal split (py, 0 = No horizontal split): Unfrozen pane: Height of the top pane(s) (in twips = 1/20 of a point) Frozen pane: Number of visible rows in top pane(s)


setHorizontalSplit

void setHorizontalSplit(int value)
Position of the horizontal split (py, 0 = No horizontal split): Unfrozen pane: Height of the top pane(s) (in twips = 1/20 of a point) Frozen pane: Number of visible rows in top pane(s)


getFirstVisibleRow

int getFirstVisibleRow()
Index to first visible row in bottom pane(s).


setFirstVisibleRow

void setFirstVisibleRow(int value)
Index to first visible row in bottom pane(s).


getFirstVisibleColumn

int getFirstVisibleColumn()
Index to first visible column in right pane(s).


setFirstVisibleColumn

void setFirstVisibleColumn(int value)
Index to first visible column in right pane(s).


getActivePane

int getActivePane()
Identifier of pane with active cell cursor.


setActivePane

void setActivePane(int value)
Identifier of pane with active cell cursor.


isDisplayZeros

boolean isDisplayZeros()
True if zero values to be displayed False otherwise.


isDisplayZeros

void isDisplayZeros(boolean value)
True if zero values to be displayed False otherwise.


getGridLinesVisible

boolean getGridLinesVisible()
True if gridlines are visible; False otherwise.


setGridLinesVisible

void setGridLinesVisible(boolean value)
True if gridlines are visible; False otherwise.


getGridLineColor

ExcelColors getGridLineColor()
Gets Grid line color.


setGridLineColor

void setGridLineColor(ExcelColors value)
Sets Grid line color.


getRowColumnHeadersVisible

boolean getRowColumnHeadersVisible()
True if row and column headers are visible; False otherwise.


setRowColumnHeadersVisible

void setRowColumnHeadersVisible(boolean value)
True if row and column headers are visible; False otherwise.


getVPageBreaks

IVPageBreaks getVPageBreaks()
Returns a VPageBreaks collection that represents the vertical page breaks on the sheet. Read-only.


getHPageBreaks

IHPageBreaks getHPageBreaks()
Returns an HPageBreaks collection that represents the horizontal page breaks on the sheet. Read-only.


isStringsPreserved

boolean isStringsPreserved()
Indicates if all values in the workbook are preserved as strings.


isStringsPreserved

void isStringsPreserved(boolean value)
Indicates if all values in the workbook are preserved as strings.


getComments

IComments getComments()

get

IXLSRange get(int row,
              int column)
Gets / sets cell by row and index.


get

IXLSRange get(int row,
              int column,
              int lastRow,
              int lastColumn)
Get cells range.


get

IXLSRange get(java.lang.String name)
Get cell range.


getHyperLinks

IHyperLinks getHyperLinks()
Collection of all worksheet's hyperlinks.


getUseRangesCache

boolean getUseRangesCache()
Indicates whether all created range objects should be cached. Default value is false.


getTopVisibleRow

int getTopVisibleRow()
Gets top visible row of the worksheet.


setTopVisibleRow

void setTopVisibleRow(int value)
Sets top visible row of the worksheet.


getLeftVisibleColumn

int getLeftVisibleColumn()
Gets left visible column of the worksheet.


setLeftVisibleColumn

void setLeftVisibleColumn(int value)
Sets left visible column of the worksheet.


getPivotTables

PivotTablesCollection getPivotTables()
Returns pivot table collection containing all pivot tables in the worksheet. Read-only.


getListObjects

IListObjects getListObjects()
Gets collection of all list objects in the worksheet.


getOleObjects

IOleObjects getOleObjects()
Gets the OLE objects.


hasOleObjects

boolean hasOleObjects()
Gets or sets a value indicating whether this instance is OLE object.


copyToClipboard

void copyToClipboard()
Copies worksheet into the clipboard.


clear

void clear()
Clears worksheet data. Removes all formatting and merges.


clearData

void clearData()
Clears worksheet. Only the data is removed from each cell.


checkExistence

boolean checkExistence(int iRow,
                       int iColumn)
Indicates whether a cell was initialized or accessed by the user.

Parameters:
iRow - One-based row index of the cell.
iColumn - One-based column index of the cell.
Returns:
Value indicating whether the cell was initialized or accessed by the user.

createNamedRanges

void createNamedRanges(java.lang.String namedRange,
                       java.lang.String referRange,
                       boolean vertical)
Creates object that can be used for template markers processing.

Parameters:
namedRange - Names to create
referRange - Refers to range
vertical - True if the named range values are vertically placed in the sheet.

isColumnVisible

boolean isColumnVisible(int columnIndex)
Method check is Column with specifed index visible to end user or not.

Parameters:
columnIndex - Index of column.
Returns:
True - column is visible; otherwise False.

isRowVisible

boolean isRowVisible(int rowIndex)
Method check is Row with specifed index visible to user or not.

Parameters:
rowIndex - Index of row visibility of each must be checked.
Returns:
True - row is visible to user, otherwise False.

deleteRow

void deleteRow(int index)
Removes specified row (with formulas update).

Parameters:
index - One-based row index to remove.

deleteColumn

void deleteColumn(int index)
Removes specified column (with formulas update).

Parameters:
index - One-based column index to remove.

insertArray

int insertArray(java.lang.Object[] arrObject,
                int firstRow,
                int firstColumn,
                boolean isVertical)
Imports an array of objects into a worksheet.

Parameters:
arrObject - Array to import.
firstRow - Row of the first cell where array should be imported.
firstColumn - Column of the first cell where array should be imported.
isVertical - True if array should be imported vertically; False - horizontally.
Returns:
Number of imported elements.

insertArray

int insertArray(java.lang.String[] arrString,
                int firstRow,
                int firstColumn,
                boolean isVertical)
Imports an array of strings into a worksheet.

Parameters:
arrString - Array to import.
firstRow - Row of the first cell where array should be imported.
firstColumn - Column of the first cell where array should be imported.
isVertical - True if array should be imported vertically; False - horizontally.
Returns:
Number of imported elements.

insertArray

int insertArray(int[] arrInt,
                int firstRow,
                int firstColumn,
                boolean isVertical)
Imports an array of integers into a worksheet.

Parameters:
arrInt - Array to import.
firstRow - Row of the first cell where array should be imported.
firstColumn - Column of the first cell where array should be imported.
isVertical - True if array should be imported vertically; False - horizontally.
Returns:
Number of imported elements.

insertArray

int insertArray(java.lang.Double[] arrDouble,
                int firstRow,
                int firstColumn,
                boolean isVertical)
Imports an array of doubles into a worksheet.

Parameters:
arrDouble - Array to import.
firstRow - Row of the first cell where array should be imported.
firstColumn - Column of the first cell where array should be imported.
isVertical - True if array should be imported vertically; False - horizontally.
Returns:
Number of imported elements.

insertArray

int insertArray(java.util.Date[] arrDate,
                int firstRow,
                int firstColumn,
                boolean isVertical)
Imports an array of DateTimes into worksheet.

Parameters:
arrDate - Array to import.
firstRow - Row of the first cell where array should be imported.
firstColumn - Column of the first cell where array should be imported.
isVertical - True if array should be imported vertically; False - horizontally.
Returns:
Number of imported elements.

insertArray

int insertArray(java.lang.Object[][] arrObject,
                int firstRow,
                int firstColumn)
Imports an array of objects into a worksheet.

Parameters:
arrObject - Array to import.
firstRow - Row of the first cell where array should be imported.
firstColumn - Column of the first cell where array should be imported.
Returns:
Number of imported rows.

insertDataColumn

int insertDataColumn(com.spire.data.table.DataColumn dataColumn,
                     boolean isFieldNameShown,
                     int firstRow,
                     int firstColumn)
Imports data from a DataColumn into worksheet.

Parameters:
dataColumn - DataColumn with desired data.
isFieldNameShown - True if column name must also be imported.
firstRow - Row of the first cell where DataTable should be imported.
firstColumn - Column of the first cell where DataTable should be imported.
Returns:
Number of imported rows.

insertDataTable

int insertDataTable(com.spire.data.table.DataTable dataTable,
                    boolean isFieldNameShown,
                    int firstRow,
                    int firstColumn)
Imports data from a DataTable into worksheet.

Parameters:
dataTable - DataTable with desired data.
isFieldNameShown - True if column names must also be imported.
firstRow - Row of the first cell where DataTable should be imported.
firstColumn - Column of the first cell where DataTable should be imported.
Returns:
Number of imported rows.

insertDataTable

int insertDataTable(com.spire.data.table.DataTable dataTable,
                    boolean isFieldNameShown,
                    int firstRow,
                    int firstColumn,
                    boolean preserveTypes)
Imports data from a DataTable into worksheet.

Parameters:
dataTable - DataTable with desired data.
isFieldNameShown - True if column names must also be imported.
firstRow - Row of the first cell where DataTable should be imported.
firstColumn - Column of the first cell where DataTable should be imported.
preserveTypes - Indicates whether XlsIO should try to preserve types in DataTable, i.e. if it is set to False (default) and in DataTable we have in string column value that contains only numbers, it would be converted to number.
Returns:
Number of imported rows.

insertDataTable

int insertDataTable(com.spire.data.table.DataTable dataTable,
                    boolean isFieldNameShown,
                    int firstRow,
                    int firstColumn,
                    int maxRows,
                    int maxColumns)
Imports data from a DataTable into worksheet.

Parameters:
dataTable - DataTable with desired data.
isFieldNameShown - True if column names must also be imported.
firstRow - Row of the first cell where DataTable should be imported.
firstColumn - Column of the first cell where DataTable should be imported.
maxRows - Maximum number of rows to import.
maxColumns - Maximum number of columns to import.
Returns:
Number of imported rows.

insertDataTable

int insertDataTable(com.spire.data.table.DataTable dataTable,
                    boolean isFieldNameShown,
                    int firstRow,
                    int firstColumn,
                    int maxRows,
                    int maxColumns,
                    boolean preserveTypes)
Imports data from a DataTable into worksheet.

Parameters:
dataTable - DataTable with desired data.
isFieldNameShown - True if column names must also be imported.
firstRow - Row of the first cell where DataTable should be imported.
firstColumn - Column of the first cell where DataTable should be imported.
maxRows - Maximum number of rows to import.
maxColumns - Maximum number of columns to import.
preserveTypes - Indicates whether XlsIO should try to preserve types in DataTable, i.e. if it is set to False (default) and in DataTable we have in string column value that contains only numbers, it would be converted to number.
Returns:
Number of imported rows.

insertDataView

int insertDataView(com.spire.data.table.DataView dataView,
                   boolean isFieldNameShown,
                   int firstRow,
                   int firstColumn)
Imports data from a DataView into worksheet.

Parameters:
dataView - DataView with desired data.
isFieldNameShown - TRUE if column names must also be imported.
firstRow - Row of the first cell where DataView should be imported.
firstColumn - Column of the first cell where DataView should be imported.
Returns:
Number of imported rows.

insertDataView

int insertDataView(com.spire.data.table.DataView dataView,
                   boolean isFieldNameShown,
                   int firstRow,
                   int firstColumn,
                   boolean bPreserveTypes)
Imports data from a DataView into worksheet.

Parameters:
dataView - DataView with desired data.
isFieldNameShown - TRUE if column names must also be imported.
firstRow - Row of the first cell where DataView should be imported.
firstColumn - Column of the first cell where DataView should be imported.
bPreserveTypes - Indicates whether to preserve column types.
Returns:
Number of imported rows.

insertDataView

int insertDataView(com.spire.data.table.DataView dataView,
                   boolean isFieldNameShown,
                   int firstRow,
                   int firstColumn,
                   int maxRows,
                   int maxColumns)
Imports data from a DataView into worksheet.

Parameters:
dataView - DataView with desired data.
isFieldNameShown - TRUE if column names must also be imported.
firstRow - Row of the first cell where DataView should be imported.
firstColumn - Column of the first cell where DataView should be imported.
maxRows - Maximum number of rows to import.
maxColumns - Maximum number of columns to import.
Returns:
Number of imported rows.

insertDataView

int insertDataView(com.spire.data.table.DataView dataView,
                   boolean isFieldNameShown,
                   int firstRow,
                   int firstColumn,
                   int maxRows,
                   int maxColumns,
                   boolean bPreserveTypes)
Imports data from a DataView into worksheet.

Parameters:
dataView - DataView with desired data.
isFieldNameShown - TRUE if column names must also be imported.
firstRow - Row of the first cell where DataView should be imported.
firstColumn - Column of the first cell where DataView should be imported.
maxRows - Maximum number of rows to import.
maxColumns - Maximum number of columns to import.
bPreserveTypes - Indicates whether to preserve column types.
Returns:
Number of imported rows

removePanes

void removePanes()
Removes panes from a worksheet.


protect

void protect(java.lang.String password)
Protects worksheet's content with password.

Parameters:
password - Password to protect with.

unprotect

void unprotect(java.lang.String password)
Unprotects worksheet's content with password.

Parameters:
password - Password to unprotect.

autoFitRow

void autoFitRow(int rowIndex)
Autofits specified row.

Parameters:
rowIndex - One-based row index.

autoFitColumn

void autoFitColumn(int columnIndex)
Autofits specified column.

Parameters:
columnIndex - One-based column index.

replace

void replace(java.lang.String oldValue,
             java.lang.String newValue)
Replaces specified string by specified value.

Parameters:
oldValue - String value to replace.
newValue - New value for the range with specified string.

replace

void replace(java.lang.String oldValue,
             double newValue)
Replaces specified string by specified value.

Parameters:
oldValue - String value to replace.
newValue - New value for the range with specified string.

replace

void replace(java.lang.String oldValue,
             java.util.Date newValue)
Replaces specified string by specified value.

Parameters:
oldValue - String value to replace.
newValue - New value for the range with specified string.

replace

void replace(java.lang.String oldValue,
             java.lang.String[] newValues,
             boolean isVertical)
Replaces specified string by data from array.

Parameters:
oldValue - String value to replace.
newValues - Array of new values.
isVertical - Indicates whether array should be inserted vertically.

replace

void replace(java.lang.String oldValue,
             int[] newValues,
             boolean isVertical)
Replaces specified string by data from array.

Parameters:
oldValue - String value to replace.
newValues - Array of new values.
isVertical - Indicates whether array should be inserted vertically.

replace

void replace(java.lang.String oldValue,
             double[] newValues,
             boolean isVertical)
Replaces specified string by data from array.

Parameters:
oldValue - String value to replace.
newValues - Array of new values.
isVertical - Indicates whether array should be inserted vertically.

replace

void replace(java.lang.String oldValue,
             com.spire.data.table.DataTable newValues,
             boolean isFieldNamesShown)
Replaces specified string by data table values.

Parameters:
oldValue - String value to replace.
newValues - Data table with new data.
isFieldNamesShown - Indicates wheter field name must be shown.

replace

void replace(java.lang.String oldValue,
             com.spire.data.table.DataColumn newValues,
             boolean isFieldNamesShown)
Replaces specified string by data column values.

Parameters:
oldValue - String value to replace.
newValues - Data table with new data.
isFieldNamesShown - Indicates whether field name must be shown.

remove

void remove()
Removes worksheet from parent worksheets collection.


moveWorksheet

void moveWorksheet(int iNewIndex)
Moves worksheet.

Parameters:
iNewIndex - New index of the worksheet.

columnWidthToPixels

int columnWidthToPixels(double widthInChars)
Converts column width into pixels.

Parameters:
widthInChars - Width in characters.
Returns:
Width in pixels

pixelsToColumnWidth

double pixelsToColumnWidth(double pixels)
Converts pixels into column width (in characters).

Parameters:
pixels - Width in pixels
Returns:
Widht in characters.

setColumnWidthInPixels

void setColumnWidthInPixels(int columnIndex,
                            int value)
Sets column width.

Parameters:
columnIndex - One-based column index.
value - Width to set.

setRowHeightPixels

void setRowHeightPixels(int Row,
                        double value)
Sets row height in pixels.

Parameters:
Row - One-based row index to set height.
value - Value in pixels to set.

getColumnWidthPixels

int getColumnWidthPixels(int Column)
Returns width in pixels from ColumnInfoRecord if there is corresponding ColumnInfoRecord or StandardWidth if not.

Parameters:
Column - One-based index of the column.
Returns:
Width in pixels of the specified column.

getRowHeightPixels

int getRowHeightPixels(int Row)
Returns height from RowRecord if there is a corresponding RowRecord. Otherwise returns StandardHeight.

Parameters:
Row - One-bazed index of the row.
Returns:
Height in pixels from RowRecord if there is corresponding RowRecord. Otherwise returns StandardHeight.

saveToFile

void saveToFile(java.lang.String fileName,
                java.lang.String separator)
Save tabsheet using separator.

Parameters:
fileName - File to save.
separator - Current seperator.

saveToStream

void saveToStream(com.spire.ms.System.IO.Stream stream,
                  java.lang.String separator)
Save tabsheet using separator.

Parameters:
stream - Stream to save.
separator - Current seperator.

setDefaultColumnStyle

void setDefaultColumnStyle(int iColumnIndex,
                           IStyle defaultStyle)
Sets by column index default style for column.

Parameters:
iColumnIndex - Column index.
defaultStyle - Default style.

setDefaultColumnStyle

void setDefaultColumnStyle(int iStartColumnIndex,
                           int iEndColumnIndex,
                           IStyle defaultStyle)
Sets by column index default style for column.

Parameters:
iStartColumnIndex - Start column index.
iEndColumnIndex - End column index.
defaultStyle - Default style.

setDefaultRowStyle

void setDefaultRowStyle(int rowIndex,
                        IStyle defaultStyle)
Sets by column index default style for row.

Parameters:
rowIndex - Row index.
defaultStyle - Default style.

setDefaultRowStyle

void setDefaultRowStyle(int iStartRowIndex,
                        int iEndRowIndex,
                        IStyle defaultStyle)
Sets by column index default style for row.

Parameters:
iStartRowIndex - Start row index.
iEndRowIndex - End row index.
defaultStyle - Default style.

getDefaultColumnStyle

IStyle getDefaultColumnStyle(int iColumnIndex)
Returns default column style.

Parameters:
iColumnIndex - Column index.
Returns:
Default column style or null if style wasn't set.

getDefaultRowStyle

IStyle getDefaultRowStyle(int rowIndex)
Returns default row style.

Parameters:
rowIndex - Row index.
Returns:
Default row style or null if style wasn't set.

setValue

void setValue(int iRow,
              int iColumn,
              java.lang.String value)
Sets value in the specified cell.

Parameters:
iRow - One-based row index of the cell to set value.
iColumn - One-based column index of the cell to set value.
value - Value to set.

setNumber

void setNumber(int iRow,
               int iColumn,
               double value)
Sets value in the specified cell.

Parameters:
iRow - One-based row index of the cell to set value.
iColumn - One-based column index of the cell to set value.
value - Value to set.

setBoolean

void setBoolean(int iRow,
                int iColumn,
                boolean value)
Sets value in the specified cell.

Parameters:
iRow - One-based row index of the cell to set value.
iColumn - One-based column index of the cell to set value.
value - Value to set.

setText

void setText(int iRow,
             int iColumn,
             java.lang.String value)
Sets text in the specified cell.

Parameters:
iRow - One-based row index of the cell to set value.
iColumn - One-based column index of the cell to set value.
value - Text to set.

setFormula

void setFormula(int iRow,
                int iColumn,
                java.lang.String value)
Sets formula in the specified cell.

Parameters:
iRow - One-based row index of the cell to set value.
iColumn - One-based column index of the cell to set value.
value - Formula to set.

setError

void setError(int iRow,
              int iColumn,
              java.lang.String value)
Sets error in the specified cell.

Parameters:
iRow - One-based row index of the cell to set value.
iColumn - One-based column index of the cell to set value.
value - Error to set.

setBlank

void setBlank(int iRow,
              int iColumn)
Sets blank in specified cell.

Parameters:
iRow - One-based row index of the cell to set value.
iColumn - One-based column index of the cell to set value.

setFormulaNumberValue

void setFormulaNumberValue(int iRow,
                           int iColumn,
                           double value)
Sets formula number value.

Parameters:
iRow - One based row index.
iColumn - One based column index.
value - Represents formula number value for set.

setFormulaErrorValue

void setFormulaErrorValue(int iRow,
                          int iColumn,
                          java.lang.String value)
Sets formula error value.

Parameters:
iRow - One based row index.
iColumn - One based column index.
value - Represents formula error value for set.

setFormulaBoolValue

void setFormulaBoolValue(int iRow,
                         int iColumn,
                         boolean value)
Sets formula bool value.

Parameters:
iRow - One based row index.
iColumn - One based column index.
value - Represents formula bool value for set.

setFormulaStringValue

void setFormulaStringValue(int iRow,
                           int iColumn,
                           java.lang.String value)
Sets formula string value.

Parameters:
iRow - One based row index.
iColumn - One based column index.
value - Represents formula string value for set.

getText

java.lang.String getText(int row,
                         int column)
Returns string value corresponding to the cell.

Parameters:
row - One-based row index of the cell to get value from.
column - One-based column index of the cell to get value from.
Returns:
String contained by the cell.

getNumber

double getNumber(int row,
                 int column)
Returns number value corresponding to the cell.

Parameters:
row - One-based row index of the cell to get value from.
column - One-based column index of the cell to get value from.
Returns:
Number contained by the cell.

getFormula

java.lang.String getFormula(int row,
                            int column,
                            boolean bR1C1)
Returns formula value corresponding to the cell.

Parameters:
row - One-based row index of the cell to get value from.
column - One-based column index of the cell to get value from.
bR1C1 - Indicates whether R1C1 notation should be used.
Returns:
Formula contained by the cell.

getError

java.lang.String getError(int row,
                          int column)
Gets error value from cell.

Parameters:
row - Row index.
column - Column index.
Returns:
Returns error value or null.

getBoolean

boolean getBoolean(int row,
                   int column)
Gets bool value from cell.

Parameters:
row - Represents row index.
column - Represents column index.
Returns:
Returns found bool value. If cannot found returns false.

getFormulaBoolValue

boolean getFormulaBoolValue(int row,
                            int column)
Gets formula bool value from cell.

Parameters:
row - Represents row index.
column - Represents column index.
Returns:
Returns found bool value. If cannot found returns false.

getFormulaErrorValue

java.lang.String getFormulaErrorValue(int row,
                                      int column)
Gets formula error value from cell.

Parameters:
row - Row index.
column - Column index.
Returns:
Returns error value or null.

getFormulaNumberValue

double getFormulaNumberValue(int row,
                             int column)
Returns formula number value corresponding to the cell.

Parameters:
row - One-based row index of the cell to get value from.
column - One-based column index of the cell to get value from.
Returns:
Number contained by the cell.

getFormulaStringValue

java.lang.String getFormulaStringValue(int row,
                                       int column)
Returns formula string value corresponding to the cell.

Parameters:
row - One-based row index of the cell to get value from.
column - One-based column index of the cell to get value from.
Returns:
String contained by the cell.

saveToImage

com.spire.ms.System.Drawing.Image saveToImage(int firstRow,
                                              int firstColumn,
                                              int lastRow,
                                              int lastColumn)
Converts range into image (Bitmap).

Parameters:
firstRow - One-based index of the first row to convert.
firstColumn - One-based index of the first column to convert.
lastRow - One-based index of the last row to convert.
lastColumn - One-based index of the last column to convert.
Returns:

saveToImage

com.spire.ms.System.Drawing.Image saveToImage(com.spire.ms.System.IO.Stream stream,
                                              int firstRow,
                                              int firstColumn,
                                              int lastRow,
                                              int lastColumn,
                                              int imageType)
Converts range into image.

Parameters:
firstRow - One-based index of the first row to convert.
firstColumn - One-based index of the first column to convert.
lastRow - One-based index of the last row to convert.
lastColumn - One-based index of the last column to convert.
imageType - Type of the image to create.
stream - Output stream. It is ignored if null.
Returns:
Created image.

saveToImage

com.spire.ms.System.Drawing.Image saveToImage(com.spire.ms.System.IO.Stream outputStream,
                                              int firstRow,
                                              int firstColumn,
                                              int lastRow,
                                              int lastColumn,
                                              ImageType imageType,
                                              int emfType)
Converts range into image.

Parameters:
firstRow - One-based index of the first row to convert.
firstColumn - One-based index of the first column to convert.
lastRow - One-based index of the last row to convert.
lastColumn - One-based index of the last column to convert.
imageType - Type of the image to create.
outputStream - Output stream. It is ignored if null.
emfType - Metafile EmfType.
Returns:
Created image.