WorkbookDesigner Class
Encapsulates the object that represents a designer spreadsheet.
Inheritance Hierarchy
SystemObject
  Aspose.CellsWorkbookDesigner

Namespace: Aspose.Cells
Assembly: Aspose.Cells (in Aspose.Cells.dll) Version: 19.10.0.0 (19.10)
Syntax
public class WorkbookDesigner

The WorkbookDesigner type exposes the following members.

Constructors
  NameDescription
Public methodWorkbookDesigner
Initializes a new instance of the WorkbookDesigner class.
Public methodWorkbookDesigner(Workbook)
Initializes a new instance of the WorkbookDesigner class.
Properties
  NameDescription
Public propertyCalculateFormula
Indicates whether formulas should be calculated.
Public propertyCallBack
Gets and sets callback interface of processing smartmarker.
Public propertyUpdateEmptyStringAsNull
If TRUE, Null will be inserted if the value is "";
Public propertyUpdateReference
Indicates if references in other worksheets will be updated.
Public propertyWorkbook
Gets and sets the Workbook object.
Methods
  NameDescription
Public methodClearDataSource
Clears all data sources.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetSmartMarkers
Returns a collection of smart markers in a spreadsheet.
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodProcess
Processes the smart markers and populates the data source values.
Public methodProcess(Boolean)
Processes the smart markers and populates the data source values.
Public methodProcess(Int32, Boolean)
Processes the smart markers and populates the data source values.
Public methodSetDataSource(DataSet)
Sets data source of a DataSet object.
Public methodSetDataSource(DataTable)
Sets data source of a DataTable object.
Public methodSetDataSource(DataView)
Sets data source of a DataView object.
Public methodSetDataSource(OleDbConnection)
Sets data source of a OleDbConnection object.
Public methodSetDataSource(SqlConnection)
Sets data source of a SqlConnection object.
Public methodSetDataSource(String, ICellsDataTable)
Sets data source of a ICellsDataTable object.
Public methodSetDataSource(String, DataView)
Sets data source of a DataView object and binds it to a data source name.
Public methodSetDataSource(String, Object)
Sets data binding to a variable.
Public methodSetDataSource(String, Object)
Sets data array binding to a variable.
Public methodSetDataSource(String, IDataReader, Int32)
Sets data source of a IDataReader object.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Examples
[C#]

//Create a connection object, specify the provider info and set the data source.
OleDbConnection con = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=d:\\test\\Northwind.mdb");
//Open the connection object.
con.Open();
//Create a command object and specify the SQL query.
OleDbCommand cmd = new OleDbCommand("Select * from [Order Details]", con);
//Create a data adapter object.
OleDbDataAdapter da = new OleDbDataAdapter();
//Specify the command.
da.SelectCommand = cmd;
//Create a dataset object.
DataSet ds = new DataSet();
//Fill the dataset with the table records.
da.Fill(ds, "Order Details");
//Create a datatable with respect to dataset table.
DataTable dt = ds.Tables["Order Details"];
//Create WorkbookDesigner object.
WorkbookDesigner wd = new WorkbookDesigner();
//Open the template file (which contains smart markers).
wd.Open("D:\\test\\SmartMarker_Designer.xls");
//Set the datatable as the data source.
wd.SetDataSource(dt);
//Process the smart markers to fill the data into the worksheets.
wd.Process(true);
//Save the excel file.
wd.Workbook.Save("D:\\test\\outSmartMarker_Designer.xls");

[Visual Basic]

'Create a connection object, specify the provider info and set the data source.
Dim con As OleDbConnection = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=d:\test\Northwind.mdb")
'Open the connection object.
con.Open()
'Create a command object and specify the SQL query.
Dim cmd As OleDbCommand = New OleDbCommand("Select * from [Order Details]", con)
'Create a data adapter object.
Dim da As OleDbDataAdapter = New OleDbDataAdapter()
'Specify the command.
da.SelectCommand = cmd
'Create a dataset object.
Dim ds As DataSet = New DataSet()
'Fill the dataset with the table records.
da.Fill(ds, "Order Details")
'Create a datatable with respect to dataset table.
Dim dt As DataTable = ds.Tables("Order Details")
'Create WorkbookDesigner object.
Dim wd As WorkbookDesigner = New WorkbookDesigner()
'Open the template file (which contains smart markers).
wd.Open("D:\test\SmartMarker_Designer.xls")
'Set the datatable as the data source.
wd.SetDataSource(dt)
'Process the smart markers to fill the data into the worksheets.
wd.Process(True)
'Save the excel file.
wd.Workbook.Save("D:\test\outSmartMarker_Designer.xls")
See Also