XlsWorksheet Methods |
The XlsWorksheet type exposes the following members.
Name | Description | |
---|---|---|
![]() |
AccessColumn |
Updates FirstColumn and LastColumn indexes.
|
![]() |
AccessRow |
Updates FirstRow and LastRow indexes.
|
![]() |
Activate |
Makes the current sheet the active sheet. Equivalent to clicking the
sheet's tab in MS Excel.
(Inherited from
XlsWorksheetBase
.)
|
![]() |
AddAllowEditRange(String, CellRange) |
AddAllowEditRange : add a range of cells that allow editing
|
![]() |
AddAllowEditRange(String, CellRange, String) |
AddAllowEditRange : add a range of cells that allow editing
|
![]() |
AddReference |
Increase the quantity of reference. User must use this method when
new wrapper on object is created or reference on object stored.
(Inherited from
XlsObject
.)
|
![]() |
AddTextEffectShape |
Adds a text effect shape to the worksheet.
(Inherited from
XlsWorksheetBase
.)
|
![]() |
ApplyStyle(CellStyle) |
Apply style to whole sheet.
|
![]() |
ApplyStyle(CellStyle, Boolean, Boolean) |
Apply style to whole sheet.
|
![]() ![]() |
AutoFitColumn(Int32) |
Autofit the column width.
![]()
The following code illustrates how to Auto-fit the column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["A1"].Text = "Sample text in cell";</para><para>//Set auto fit</para><para>worksheet.AutoFitColumn(1);</para><para>//Save to file</para><para>workbook.SaveToFile("AutoFitColumn.xlsx");</para>
|
![]() |
AutoFitColumn(Int32, AutoFitterOptions) |
Autofit the column width.
|
![]() |
AutoFitColumn(Int32, Int32, Int32) |
Autofit the column width.
|
![]() |
AutoFitColumn(Int32, Int32, Int32, AutoFitterOptions) |
Autofit the column width.
|
![]() ![]() |
AutoFitRow(Int32) |
Autofit the row height.
![]()
The following code illustrates how to Auto-fit the row:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["C2"].Value = "Sample text";</para><para>//Set Style</para><para>CellStyle style = workbook.Styles.Add("CustomStyle");</para><para>IFont font = style.Font;</para><para>font.Size = 18;</para><para>worksheet["C2"].Style = style;</para><para>//Set auto fit</para><para>worksheet.AutoFitRow(2);</para><para>//Save to file</para><para>workbook.SaveToFile("AutoFitRow.xlsx");</para>
|
![]() |
AutoFitRow(Int32, Int32, Int32, AutoFitterOptions) |
Autofit the row height.
|
![]() |
AutoFitRow(Int32, Int32, Int32, Boolean) |
Autofit the row height.
|
![]() |
AutoFitRow(Int32, Int32, Int32, Boolean, AutoFitterOptions) |
Autofit the row height.
|
![]() |
CalculateAllValue |
Caculate all formula for the specified worksheet
|
![]() |
CheckDisposed |
Checks whether object was disposed and throws exception if it was.
(Inherited from
XlsObject
.)
|
![]() ![]() |
CheckExistence |
Indicates whether cell has been initialized.
![]()
The following code illustrates if the cells was initialized or accessed by the user:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet.Range["A1"].Text = "Hello";</para><para>//Check the cell.Output will be true.</para><para>Console.Write(worksheet.CheckExistence(1, 1));</para><para>//Save to file</para><para>workbook.SaveToFile("CheckExistence.xlsx");</para>
|
![]() |
Clear |
Clears data the worksheet.
|
![]() |
ClearCellImageCache |
Clear Cell image array cache,not delete CellImage in cell.
(Inherited from
XlsWorksheetBase
.)
|
![]() |
ClearData |
Clears contents of a range.
|
![]() |
Clone |
Obsolete.
Creates copy of the current object.
(Inherited from
XlsWorksheetBase
.)
|
![]() |
ColumnWidthToPixels |
Converts column width into pixels.
|
![]() |
CopyFrom |
Obsolete.
Copies all data from another worksheet.
|
![]() |
CopyToClipboard |
Obsolete.
Copies worksheet into the clipboard.
|
![]() |
CreateNamedRanges |
Create Named Ranges
|
![]() |
CreateRanges |
Creates a collection of ranges from the specified array of CellRange objects.
|
![]() |
DeleteColumn(Int32) |
Deletes a column.
|
![]() |
DeleteColumn(Int32, Int32) |
Removes specified column.
|
![]() |
DeleteRange |
delete a range in worksheet
|
![]() |
DeleteRow(Int32) |
Delete a row.
|
![]() |
DeleteRow(Int32, Int32) |
Removes specified row.
|
![]() |
DeleteRows |
Removes specified rows.
|
![]() |
Dispose |
Dispose object and free resources.
(Inherited from
XlsObject
.)
|
![]() |
Equals |
Determines whether the specified object is equal to the current object.
(Inherited from
Object
.)
|
![]() |
ExportDataTable |
Exports worksheet data into a DataTable
|
![]() |
Finalize |
Destructor. Call dispose method of current object.
(Inherited from
XlsObject
.)
|
![]() |
FindParent(Type) |
This method is used to find parent with specific type.
(Inherited from
XlsObject
.)
|
![]() |
FindParent( Type ) |
Find parent of object.
(Inherited from
XlsObject
.)
|
![]() |
FindParent(Type, Boolean) |
This method is used to find parent with specific type.
(Inherited from
XlsObject
.)
|
![]() |
FindParents |
Finds parent objects.
(Inherited from
XlsObject
.)
|
![]() |
FreeRange |
Clears the specified range of cells in the worksheet.
|
![]() |
GetBoolean |
Gets bool value from cell.
|
![]() |
GetCaculateValue |
Obsolete.
Returns the formula string if the cell contains a formula, or the value if
the cell cantains anything other than a formula.
|
![]() |
GetCalculateValue |
Returns the formula string if the cell contains a formula, or the value if
the cell cantains anything other than a formula.
|
![]() |
GetCellType |
Gets cell type from current column.
|
![]() |
GetClonedObject |
Gets object that is clone of current worksheet in the specified workbook.
|
![]() |
GetColumnIsAutoFit |
Get ColumnIsAutofit By columnIndex
|
![]() |
GetColumnIsHide |
Indicates whether the column is hidden.
|
![]() |
GetColumnWidth |
Gets the width of the specified column
|
![]() ![]() |
GetColumnWidthPixels |
Gets the width of the specified column, in units of pixel.
![]()
The following code illustrates how to get the column width for a particular column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["A1"].Text = "Sample text in cell";</para><para>//Set auto fit</para><para>worksheet.AutoFitColumn(1);</para><para>//Get column width</para><para>Console.WriteLine(worksheet.GetColumnWidthPixels(1));</para><para>//Save to file</para><para>workbook.SaveToFile("UsedRange.xlsx");</para>
|
![]() |
GetDefaultColumnStyle |
Returns default column style.
|
![]() |
GetDefaultRowStyle |
Returns default row style.
|
![]() |
GetError |
Gets error value from cell.
|
![]() |
GetFormula(Int32, Int32, Boolean) |
Returns formula corresponding to the cell.
|
![]() |
GetFormula(Int32, Int32, Boolean, Boolean) |
Returns formula corresponding to the cell.
|
![]() |
GetFormulaBoolValue |
Gets formula bool value from cell.
|
![]() |
GetFormulaErrorValue |
Gets formula error value from cell.
|
![]() |
GetFormulaNumberValue |
Returns formula number value corresponding to the cell.
|
![]() |
GetFormulaStringValue |
Returns formula string value corresponding to the cell.
|
![]() |
GetHashCode |
Serves as the default hash function.
(Inherited from
Object
.)
|
![]() |
GetNumber |
Returns number value corresponding to the cell.
|
![]() |
GetRowHeight |
Gets the height of a specified row.
|
![]() ![]() |
GetRowHeightPixels |
Gets the height of a specified row in unit of pixel.
![]()
The following code illustrates how to get the row height for a particular row:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["C2"].Text = "Sample text";</para><para>worksheet["C2"].Style.Font.Size = 18;</para><para>//Set auto fit</para><para>worksheet.AutoFitRow(2);</para><para>//Get row height</para><para>Console.WriteLine(worksheet.GetRowHeightPixels(2));</para><para>//Save to file</para><para>workbook.SaveToFile("UsedRange.xlsx");</para>
|
![]() |
GetRowIsAutoFit |
Get GetRowIsAutoFit By rowIndex
|
![]() |
GetRowIsHide |
Indicates whether the row is hidden.
|
![]() |
GetStringValue(Int64) |
Obsolete.
Returns string value corresponding to the cell.
|
![]() |
GetStringValue(Int32, Int32) |
Returns string value corresponding to the cell.
|
![]() |
GetText |
Returns string value corresponding to the cell.
|
![]() |
GetTextObject(Int64) |
Obsolete.
Returns TextWithFormat object corresponding to the specified cell.
|
![]() |
GetTextObject(Int32, Int32) |
Returns TextWithFormat object corresponding to the specified cell.
|
![]() |
GetType |
Gets the
Type
of the current instance.
(Inherited from
Object
.)
|
![]() |
GroupByColumns |
Groups columns.
|
![]() |
GroupByRows |
Groups rows.
|
![]() |
HasArrayFormula |
Obsolete.
Indicates whether cell contains array-entered formula.
|
![]() |
HasArrayFormulaRecord |
Indicates is has array formula.
|
![]() |
HideColumn |
Hides a column.
|
![]() |
HideColumns |
Hides columns.
|
![]() |
HideRow |
Hides a row.
|
![]() |
HideRows |
Hides a row.
|
![]() |
ImportCustomObjects(ICollection, Int32, Int32, ImportObjectOptions) |
Imports custom objects into the worksheet.
|
![]() |
ImportCustomObjects(ICollection, String , Boolean, Int32, Int32, Int32, Boolean, String, Boolean) |
Imports custom objects into a worksheet.
|
![]() |
InitializeCollections |
Initializes various collections and objects used by the spreadsheet.
(Overrides
XlsWorksheetBase
InitializeCollections
.)
|
![]() ![]() |
InsertArray( Object , Int32, Int32) |
Imports an array of objects into a worksheet.
![]()
The following code illustrates how to Imports a two-dimensional array of Object into a worksheet with the specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Initialize the Object Array</para><para>object[,] arrayTwoDimen = new object[3, 2] { { "AND", "OR" }, { "NAND", "XOR" },{ "NOR", "NOT" } };</para><para>//Insert the Object Array to Sheet</para><para>worksheet.InsertArray(arrayTwoDimen, 1, 1);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertArray.xlsx");</para>
|
![]() ![]() |
InsertArray( DateTime , Int32, Int32, Boolean) |
Imports an array of datetimes into worksheet.
![]()
The following code illustrates how to Imports an array of DateTime values into a worksheet with the specified row and colum:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Initialize the DateTime Array</para><para>DateTime[] arrayDate = new DateTime[4] { DateTime.Parse("06:45"), DateTime.Parse("08:30"), DateTime.Parse("09:40"), DateTime.Parse("10:30") };</para><para>//Insert the DateTime Array to Sheet</para><para>worksheet.InsertArray(arrayDate, 1, 1, true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertArray.xlsx");</para>
|
![]() ![]() |
InsertArray( Double , Int32, Int32, Boolean) |
Imports an array of doubles into a worksheet.
![]()
The following code illustrates how to Imports an array of Double values into a worksheet with the specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Initialize the double Array</para><para>double[] arrayDouble = new double[4] { 344.0045, 345.0045, 346.0045, 347.0045 };</para><para>//Insert the double Array to Sheet</para><para>worksheet.InsertArray(arrayDouble, 1, 1, true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertArray.xlsx");</para>
|
![]() ![]() |
InsertArray( Int32 , Int32, Int32, Boolean) |
Imports an array of integer into a worksheet.
![]()
The following code illustrates how to Imports an array of integer values into a worksheet with the specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Initialize the integer Array</para><para>int[] arrayInt = new int[4] {1000, 2000, 3000, 4000};</para><para>//Insert the integer Array to Sheet</para><para>worksheet.InsertArray(arrayInt, 1, 1, true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertArray.xlsx");</para>
|
![]() |
InsertArray( Object , Int32, Int32, Boolean) |
Imports an array of objects into a worksheet.
|
![]() ![]() |
InsertArray( Object , Int32, Int32, Boolean) |
Imports an array of objects into a worksheet.
![]()
The following code illustrates how to Imports an array of Object into a worksheet with specified alignment:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Initialize the Object Array</para><para>object[] array = new object[4] { "Total Income", "Actual Expense", "Expected Expenses", "Profit" };</para><para>//Insert the Object Array to Sheet</para><para>worksheet.InsertArray(array, 1, 1, true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertArray.xlsx");</para>
|
![]() ![]() |
InsertArray( String , Int32, Int32, Boolean) |
Imports an array of strings into a worksheet.
![]()
The following code illustrates how to Imports an array of String into a worksheet with specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Initialize the string Array</para><para>string[] arrayString = new string[4] { "Total Income", "Actual Expense", "Expected Expenses", "Profit" };</para><para>//Insert the string Array to Sheet</para><para>worksheet.InsertArray(arrayString, 1, 1, true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertArray.xlsx");</para>
|
![]() |
InsertArray T ( T , Int32, Int32, Boolean, Boolean) |
Inserts an array of objects into a worksheet.
|
![]() |
InsertArrayList(ArrayList, Int32, Int32, Boolean) |
Imports an arraylist of data into a worksheet.
|
![]() |
InsertArrayList(ArrayList, Int32, Int32, Boolean, Boolean) |
Imports an arraylist of data into a worksheet.
|
![]() |
InsertColumn(Int32) |
Inserts a new column into the worksheet.
|
![]() |
InsertColumn(Int32, Int32) |
Inserts specified number column into the worksheet.
|
![]() |
InsertColumn(Int32, Int32, InsertOptionsType) |
Inserts an empty column with default formatting.
|
![]() |
InsertCutRange |
Insert cut range into worksheet at specified position.
|
![]() ![]() |
InsertDataColumn |
Imports data column.
![]()
The following code illustrates how to Imports data from a DataColumn into a worksheet with the specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int)); table.Columns.Add("Item", typeof(string)); table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David"); table.Rows.Add(2, "Paste", "Sam"); table.Rows.Add(3, "Cream", "Christoff");</para><para>//Insert the DataColumn to worksheet</para><para>System.Data.DataColumn column = table.Columns[2];</para><para>worksheet.InsertDataColumn(column, true, 1, 1);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataColumn.xlsx");</para> |
![]() |
InsertDataColumns |
Imports array of data columns.
|
![]() ![]() |
InsertDataTable(DataTable, Boolean, Int32, Int32) |
Imports data from a DataTable into worksheet.
![]()
The following code illustrates how to Imports data from a DataTable into a worksheet with the specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int)); table.Columns.Add("Item", typeof(string)); table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David"); table.Rows.Add(2, "Paste", "Sam"); table.Rows.Add(3, "Cream", "Christoff");</para><para>//Insert the DataTable to worksheet</para><para>worksheet.InsertDataTable(table, true, 1, 1);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataTable.xlsx");</para> |
![]() ![]() |
InsertDataTable(DataTable, Boolean, Int32, Int32, Boolean) |
Imports data from a DataTable into worksheet.
![]()
The following code illustrates how to Imports data from a DataTable into a worksheet with the specified row and column along with the preserve type:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int)); table.Columns.Add("Item", typeof(string)); table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David"); table.Rows.Add(2, "Paste", "Sam"); table.Rows.Add(3, "Cream", "Christoff");</para><para>//Insert the DataTable to worksheet</para><para>worksheet.InsertDataTable(table, true, 1, 1 , true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataTable.xlsx");</para> |
![]() ![]() |
InsertDataTable(DataTable, Boolean, Int32, Int32, Int32, Int32) |
Imports data from a DataTable into worksheet.
![]()
The following code illustrates how to Imports data from a DataTable into a worksheet with the specified range:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int)); table.Columns.Add("Item", typeof(string)); table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David"); table.Rows.Add(2, "Paste", "Sam"); table.Rows.Add(3, "Cream", "Christoff");</para><para>//Insert the DataTable to worksheet</para><para>worksheet.InsertDataTable(table, true, 1 , 1 , 2 , 2);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataTable.xlsx");</para> |
![]() ![]() |
InsertDataTable(DataTable, Boolean, Int32, Int32, Int32, Int32, Boolean) |
Imports data from a DataTable into worksheet.
![]()
The following code illustrates how to Imports data from a DataTable into a worksheet with specified range along with preserve type:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int)); table.Columns.Add("Item", typeof(string)); table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David"); table.Rows.Add(2, "Paste", "Sam"); table.Rows.Add(3, "Cream", "Christoff");</para><para>//Insert the DataTable to worksheet</para><para>worksheet.InsertDataTable(table, true, 1 , 1 , 2 , 2 , true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataTable.xlsx");</para> |
![]() |
InsertDataTable(DataTable, Boolean, Int32, Int32, Int32, Int32, DataColumn , Boolean) |
Imports data from a DataTable into worksheet
|
![]() ![]() |
InsertDataView(DataView, Boolean, Int32, Int32) |
Imports data from a DataView into worksheet.
![]()
The following code illustrates how to Imports data from a DataView into a worksheet with the specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int)); table.Columns.Add("Item", typeof(string)); table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David"); table.Rows.Add(2, "Paste", "Sam"); table.Rows.Add(3, "Cream", "Christoff");</para><para>//Initialize dataview of datatable</para><para>System.Data.DataView view = table.DefaultView;</para><para>//Import data from DataView</para><para>worksheet.InsertDataView(view, true, 1, 1);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataView.xlsx");</para> |
![]() ![]() |
InsertDataView(DataView, Boolean, Int32, Int32, Boolean) |
Imports data from a DataView into worksheet.
![]()
The following code illustrates how to Imports data from a DataView into a worksheet with the specified row and column along with preserve type:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int)); table.Columns.Add("Item", typeof(string)); table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David"); table.Rows.Add(2, "Paste", "Sam"); table.Rows.Add(3, "Cream", "Christoff");</para><para>//Initialize dataview of datatable</para><para>System.Data.DataView view = table.DefaultView;</para><para>//Import data from DataView</para><para>worksheet.InsertDataView(view, true, 1, 1 , true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataView.xlsx");</para> |
![]() ![]() |
InsertDataView(DataView, Boolean, Int32, Int32, Int32, Int32) |
Imports data from a DataView into worksheet.
![]()
The following code illustrates how to Imports data from a DataView into a worksheet with the specified range:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int)); table.Columns.Add("Item", typeof(string)); table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David"); table.Rows.Add(2, "Paste", "Sam"); table.Rows.Add(3, "Cream", "Christoff");</para><para>//Initialize dataview of datatable</para><para>System.Data.DataView view = table.DefaultView;</para><para>//Import data from DataView</para><para>worksheet.InsertDataView(view, true, 1, 1 , 2 , 2);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataView.xlsx");</para> |
![]() ![]() |
InsertDataView(DataView, Boolean, Int32, Int32, Int32, Int32, Boolean) |
Imports data from a DataView into worksheet.
![]()
The following code illustrates how to Imports data from a DataView into a worksheet with the specified range along with preserve type:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int)); table.Columns.Add("Item", typeof(string)); table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David"); table.Rows.Add(2, "Paste", "Sam"); table.Rows.Add(3, "Cream", "Christoff");</para><para>//Initialize dataview of datatable</para><para>System.Data.DataView view = table.DefaultView;</para><para>//Import data from DataView</para><para>worksheet.InsertDataView(view, true, 1, 1 , 2 , 2 , true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataView.xlsx");</para> |
![]() |
InsertRange |
Insert a cell range into worksheet
|
![]() |
InsertRow(Int32) |
Inserts a new row into the worksheet.
|
![]() |
InsertRow(Int32, Int32) |
Inserts multiple rows into the worksheet.
|
![]() |
InsertRow(Int32, Int32, InsertOptionsType) |
Inserts an empty row with default formatting.
|
![]() |
IntersectRanges |
Intersects two ranges and returns the resulting range.
|
![]() |
IsArrayFormula(Int64) |
Obsolete.
Indicates whether cell contains array-entered formula.
|
![]() |
IsArrayFormula(Int32, Int32) |
Indicates whether cell contains array-entered formula.
|
![]() |
IsColumnVisible |
Indicates whether column is visible.
|
![]() |
IsExternalFormula |
Indicates is formula in cell is formula to external workbook.
|
![]() |
IsRowVisible |
Indicates whether row is visible.
|
![]() |
MemberwiseClone |
Creates a shallow copy of the current
Object
.
(Inherited from
Object
.)
|
![]() |
MergeRanges |
Merges two ranges if they have the same dimensions and are adjacent.
|
![]() |
MoveSheet |
Moves sheet into new position, including chartsheet and worksheet.
(Inherited from
XlsWorksheetBase
.)
|
![]() |
MoveWorksheet |
Moves worksheet into new position.
|
![]() |
OnDispose |
Method which can be overriden by users to take any specific actions when
object is disposed.
(Inherited from
XlsObject
.)
|
![]() |
PixelsToColumnWidth |
Converts pixels count into column width value.
|
![]() ![]() |
Protect(String) |
Protects worksheet with password.protect the sheet except select lock/unlock cells.
(Inherited from
XlsWorksheetBase
.)
![]()
The following code illustrates how to protect the sheet except select lock/unlock cells:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Protects the first worksheet's content with password</para><para>worksheet.Protect("123456");</para><para>//Save to file</para><para>workbook.SaveToFile("Protect.xlsx");</para>
|
![]() |
Protect(String, SheetProtectionType) |
Protects worksheet with password.
(Inherited from
XlsWorksheetBase
.)
|
![]() |
ReleaseReference |
Decrease quantity of Reference. User must call this method
when freeing resources.
(Inherited from
XlsObject
.)
|
![]() |
Remove |
Removes worksheet from parernt worksheets collection.
|
![]() |
RemoveMergedCells |
Removes all merged cells within the specified range.
|
![]() |
RemovePanes |
Removes panes from a worksheet.
|
![]() |
ReparseFormula |
Reparses all formulas on this sheet.
|
![]() ![]() |
Replace(String, DateTime) |
Replaces cells' values with new data.
![]()
The following code illustrates how to replace the string value with datetime:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Replace the oldValue by dateTime</para><para>string oldValue = "Find";</para><para>DateTime dateTime = DateTime.Now;</para><para>worksheet.Replace(oldValue, dateTime);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, Double) |
Replaces cells' values with new data.
![]()
The following code snippet illustrates how to replace the string with double:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Replace the oldValue by double</para><para>string oldValue = "Ten";</para><para>worksheet.Replace(oldValue, 10.0);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, String) |
Replaces cells' values with new data.
![]()
The following code snippet illustrates how to replace the string with another string:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Replace the oldValue by newValue</para><para>string oldValue = "Find";</para><para>string newValue = "NewValue";</para><para>worksheet.Replace(oldValue, newValue);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, DataColumn, Boolean) |
Replaces cells' values with new data.
![]()
The following code snippet illustrates how to replace the string value with data column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Replace the oldValue by data column</para><para>string oldValue = "Find";</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("Dosage", typeof(int));</para><para>table.Rows.Add(1);</para><para>System.Data.DataColumn dataColumn = table.Columns[0];</para><para>worksheet.Replace(oldValue, dataColumn, true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, DataTable, Boolean) |
Replaces cells' values with new data.
![]()
The following code snippet illustrates how to replace the string value with data table:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Replace the oldValue by data table</para><para>string oldValue = "Find";</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("Dosage", typeof(int));</para><para>table.Rows.Add(1);</para><para>worksheet.Replace(oldValue, table, true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, Double , Boolean) |
Replaces cells' values with new data.
![]()
The following code snippet illustrates how to replace the string with array of double values:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Replace the oldValue by array of double values</para><para>string oldValue = "Find";</para><para>double[] newValues = { 1.0, 2.0 };</para><para>worksheet.Replace(oldValue, newValues, true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, Int32 , Boolean) |
Replaces cells' values with new data.
![]()
The following code snippet illustrates how to replace the string with array of int values:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Replace the oldValue by array of int values</para><para>string oldValue = "Find";</para><para>int[] newValues = { 1, 2 };</para><para>worksheet.Replace(oldValue, newValues, true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, String , Boolean) |
Replaces cells' values with new data.
![]()
The following code snippet illustrates how to replace the string with array of string values:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Replace the oldValue by array of string values</para><para>string oldValue = "Find";</para><para>string[] newValues = { "X values", "Y values" };</para><para>worksheet.Replace(oldValue, newValues , true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() |
ReplaceAll(String, String, Boolean) |
Replaces all occurrences of a specified value with a new value in the worksheet.
|
![]() |
ReplaceAll(String, CellStyle, String, CellStyle) |
Replaces cells' values with new data and style.
|
![]() |
SaveAndGetShapesToImage |
Save option specify shapes to image, and get option specify shapes together.
|
![]() |
SaveShapesToImage |
Save option specify shapes to image.
|
![]() |
SaveToEMFImage |
Obsolete.
Converts range into EMF format image.
|
![]() ![]() |
SaveToFile(String, String) |
Save worksheet to file.
![]()
The following code illustrates how to saves the worksheet in a different file with separator:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Save to file</para><para>worksheet.SaveToFile("SaveToFile.csv" , ",");</para>
|
![]() |
SaveToFile(String, String, Boolean) |
Save worksheet to file.
|
![]() |
SaveToFile(String, String, Encoding) |
Save worksheet to file..
|
![]() |
SaveToFile(String, String, Encoding, Boolean) |
Save worksheet to file..
|
![]() ![]() |
SaveToHtml(Stream) |
Save to HTML stream.
![]()
The following code snippets illustrates how to save as html as stream:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Creat stream</para><para>Stream stream = new MemoryStream();</para><para>//Save to HTML stream</para><para>worksheet.SaveToHtml(stream);</para>
|
![]() ![]() |
SaveToHtml(String) |
Save to HTML file.
![]()
The following code snippets illustrates how to save as html to the specified file name:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Save to HTML file</para><para>worksheet.SaveToHtml("Output.html");</para>
|
![]() ![]() |
SaveToHtml(Stream, HTMLOptions) |
Saves work sheet to HTML.
![]()
The following code snippets illustrates how to save as html as stream with Save option:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Creat stream</para><para>Stream stream = new MemoryStream();</para><para>//Save to HTML stream</para><para>worksheet.SaveToHtml(stream, Spire.Xls.Core.Spreadsheet.HTMLOptions.Default);</para>
|
![]() ![]() |
SaveToHtml(String, HTMLOptions) |
Saves as HTML.
![]()
The following code snippets illustrates how to save as html to the specified file name and save option:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Save to HTML file</para><para>worksheet.SaveToHtml("Sample.html" , Spire.Xls.Core.Spreadsheet.HTMLOptions.Default);</para>
|
![]() |
SaveToImage(String) |
Save worksheet to image.
|
![]() |
SaveToImage(String, ImageFormat) |
Save worksheet to image.
|
![]() |
SaveToImage(Int32, Int32, Int32, Int32) |
Obsolete.
Save worksheet to image.
|
![]() |
SaveToImage(String, Int32, Int32, Int32, Int32) |
Save worksheet to image.
|
![]() ![]() |
SaveToImage(Stream, Int32, Int32, Int32, Int32, ImageType) |
Save worksheet into image.
![]()
The following code illustrates how to convert the specified range into image with the specified type:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Creat stream</para><para>Stream stream = new MemoryStream();</para><para>//Save to image</para><para>System.Drawing.Image image = worksheet.SaveToImage(stream,1, 1, 10, 20, Spire.Xls.ImageType.Bitmap);</para><para>image.Save("Sample.png", System.Drawing.Imaging.ImageFormat.Png);</para>
|
![]() |
SaveToImage(Stream, Int32, Int32, Int32, Int32, EmfType) |
Obsolete.
Converts range into image.
|
![]() |
SaveToImage(Stream, Int32, Int32, Int32, Int32, ImageType, EmfType) |
Obsolete.
Converts range into image.
|
![]() |
SaveToPdf(String) |
Save worksheet to pdf.
|
![]() |
SaveToPdf(String, FileFormat) |
Obsolete.
Save worksheet to pdf.
|
![]() |
SaveToPdfStream(Stream) |
Save worksheet to pdf Stream.
|
![]() |
SaveToPdfStream(Stream, FileFormat) |
Obsolete.
Saves the document to a PDF stream with the specified file format.
|
![]() ![]() |
SaveToStream(Stream, String) |
Save worksheet to stream.
![]()
The following code illustrates how to saves the worksheet as stream with separator:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create stream</para><para>Stream stream = new MemoryStream();</para><para>//Save to stream</para><para>worksheet.SaveToStream(stream , ",");</para>
|
![]() |
SaveToStream(Stream, String, Boolean) |
Save worksheet to stream.
|
![]() |
SaveToStream(Stream, String, Encoding) |
Save worksheet to stream.
|
![]() |
SaveToStream(Stream, String, Encoding, Boolean) |
Save worksheet to stream.
|
![]() |
SaveToXps |
Saves specific worksheet to xps.
|
![]() |
Select |
Selects current tab sheet.
(Inherited from
XlsWorksheetBase
.)
|
![]() |
SelectTab |
Adds sheet tab to the selected tab.
(Inherited from
XlsWorksheetBase
.)
|
![]() |
SetActiveCell(IXLSRange) |
Sets active cell
|
![]() |
SetActiveCell(IXLSRange, Boolean) |
Sets active cell
|
![]() |
SetBlank |
Sets blank in specified cell.
|
![]() |
SetBoolean |
Sets value in the specified cell.
|
![]() |
SetCaculateValue |
Obsolete.
Sets the value of a cell.
|
![]() |
SetCalculateValue |
Sets the value of a cell.
|
![]() |
SetCellValue(Int32, Int32, Boolean) |
Sets value in the specified cell.
|
![]() |
SetCellValue(Int32, Int32, String) |
Sets value in the specified cell.
|
![]() |
SetChanged |
This method should be called after any changes in the worksheet.
Sets Saved property of the parent workbook to false.
(Inherited from
XlsWorksheetBase
.)
|
![]() |
SetColumnWidth |
Set solumn width
|
![]() ![]() |
SetColumnWidthInPixels(Int32, Int32) |
Sets column width in pixels.
![]()
The following code illustrates how to set width for a column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set column width</para><para>worksheet.SetColumnWidthInPixels(2, 160);</para><para>//Save to file</para><para>workbook.SaveToFile("SetColumnWidthInPixels.xlsx");</para>
|
![]() |
SetColumnWidthInPixels(Int32, Int32, Int32) |
Sets the width of the specified columns.
|
![]() |
SetDefaultColumnStyle(Int32, IStyle) |
Sets default style for column.
|
![]() |
SetDefaultColumnStyle(Int32, Int32, IStyle) |
Sets by column index default style for column.
|
![]() |
SetDefaultRowStyle(Int32, IStyle) |
Sets bdefault style for row.
|
![]() |
SetDefaultRowStyle(Int32, Int32, IStyle) |
Sets by column index default style for row.
|
![]() |
SetError(Int32, Int32, String) |
Sets error in the specified cell.
|
![]() |
SetError(Int32, Int32, String, Boolean) |
Sets error in the specified cell.
|
![]() |
SetFirstColumn |
Updates first column indexe.
|
![]() |
SetFirstRow |
Updates first row index.
|
![]() |
SetFormula(Int32, Int32, String) |
Sets formula in the specified cell.
|
![]() |
SetFormula(Int32, Int32, String, Boolean) |
Sets formula in the specified cell.
|
![]() |
SetFormulaBoolValue |
Sets formula bool value.
|
![]() |
SetFormulaErrorValue |
Sets formula error value.
|
![]() |
SetFormulaNumberValue |
Sets formula number value.
|
![]() |
SetFormulaStringValue |
Sets formula string value.
|
![]() |
SetLastColumn |
Updates last column index.
|
![]() |
SetLastRow |
Updates last row index.
|
![]() |
SetNumber |
Sets value in the specified cell.
|
![]() |
SetParent |
Sets parent of the object.
(Inherited from
XlsObject
.)
|
![]() |
SetRowHeight |
Sets the height of the specified row.
|
![]() |
SetRowHeightInPixels |
Set Row height from Start Row index
|
![]() ![]() |
SetRowHeightPixels |
Sets the height of the specified row.
![]()
The following code illustrates how to set height for a row:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set row height</para><para>worksheet.SetRowHeightPixels(3, 150);</para><para>//Save to file</para><para>workbook.SaveToFile("SetRowHeightPixels.xlsx");</para>
|
![]() |
SetText |
Sets text in the specified cell.
|
![]() |
SetValue |
Sets the value of a cell in the grid.
|
![]() |
ShowColumn |
Shows a column.
|
![]() |
ShowRow |
Shows a row.
|
![]() |
Subtotal(IXLSRange, Int32, Int32 , SubtotalTypes) |
Creates subtotals for the range.
|
![]() |
Subtotal(IXLSRange, Int32, Int32 , SubtotalTypes, Boolean, Boolean, Boolean) |
Creates subtotals for the range.
|
![]() |
ToEMFStream(Stream, Int32, Int32, Int32, Int32) |
Converts a range of cells in the worksheet to an EMF (Enhanced Metafile) stream.
|
![]() |
ToEMFStream(Stream, Int32, Int32, Int32, Int32, EmfType) |
Converts a range of cells in the worksheet to an EMF (Enhanced Metafile) stream.
|
![]() |
ToImage |
Convert worksheet to Image.
|
![]() |
ToString |
Returns a string that represents the current object.
(Inherited from
Object
.)
|
![]() |
ToSVGStream |
Convert CellRange to Svg stream
|
![]() |
UngroupByColumns |
Ungroups columns.
|
![]() |
UngroupByRows |
Ungroups rows.
|
![]() |
Unprotect |
Unprotects this wokrsheet.
(Inherited from
XlsWorksheetBase
.)
|
![]() |
Unprotect(String) |
Unprotects this worksheet using specified password.
(Inherited from
XlsWorksheetBase
.)
|
![]() |
Unselect |
Unselects current tab sheet if possible.
(Inherited from
XlsWorksheetBase
.)
|
![]() |
Unselect(Boolean) |
Unselects current tab sheet if possible.
(Inherited from
XlsWorksheetBase
.)
|