WorkbookDesigner
Inheritance: java.lang.Object
public class WorkbookDesigner
Encapsulates the object that represents a designer spreadsheet.
Example
//Create WorkbookDesigner object.
WorkbookDesigner wd = new WorkbookDesigner();
//Open the template file (which contains smart markers).
wd.setWorkbook(new Workbook("SmartMarker_Designer.xls"));
//Initialize your data from data source
//DataSet ds = new DataSet();
//...
//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.getWorkbook().save("outSmartMarker_Designer.xls");
Constructors
Constructor | Description |
---|---|
WorkbookDesigner() | Initializes a new instance of the WorkbookDesigner class. |
WorkbookDesigner(Workbook workbook) | Initializes a new instance of the WorkbookDesigner class. |
Methods
Method | Description |
---|---|
clearDataSource() | Clears all data sources. |
containsVariables() | Indicates whether the first worksheet contains custom variables. |
equals(Object arg0) | |
getCalculateFormula() | Indicates whether formulas should be calculated. |
getCallBack() | Gets callback interface of processing smartmarker. |
getClass() | |
getLineByLine() | Indicates whether processing the smart marker line by line. |
getRepeatFormulasWithSubtotal() | Indicates whether repeating formulas with subtotal row. |
getSmartMarkers() | Returns a collection of smart markers in a spreadsheet. |
getSortDataSource() | Indicates whether sorting data source. |
getUpdateEmptyStringAsNull() | If TRUE, Null will be inserted if the value is “”; |
getUpdateReference() | Indicates if references in other worksheets will be updated. |
getVariablesWorksheetName() | Gets the name of the worksheet which contains variables smart marker. |
getWorkbook() | Gets the Workbook object. |
hashCode() | |
notify() | |
notifyAll() | |
process() | Processes the smart markers and populates the data source values. |
process(boolean isPreserved) | Processes the smart markers and populates the data source values. |
process(Range range, boolean isPreserved) | Processes the smart markers and populates the data source values. |
process(int sheetIndex, boolean isPreserved) | Processes the smart markers and populates the data source values. |
setCalculateFormula(boolean value) | Indicates whether formulas should be calculated. |
setCallBack(ISmartMarkerCallBack value) | Sets callback interface of processing smartmarker. |
setContainsVariables(boolean value) | Indicates whether the first worksheet contains custom variables. |
setDataSource(String dataSource, ICellsDataTable cellsDataTable) | Sets data source of a ICellsDataTable object. |
setDataSource(String variable, Object data) | Sets data binding to a variable. |
setDataSource(String dataSource, ResultSet rs) | Set the data source. |
setDataSource(String dataSource, ResultSet rs, int rowCount) | Set the data source. |
setDataSource(ResultSet rs) | Set the data source. |
setJsonDataSource(String name, String json) | Set json string value as data source of smart markers. |
setLineByLine(boolean value) | Indicates whether processing the smart marker line by line. |
setRepeatFormulasWithSubtotal(boolean value) | Indicates whether repeating formulas with subtotal row. |
setSortDataSource(boolean value) | Indicates whether sorting data source. |
setUpdateEmptyStringAsNull(boolean value) | If TRUE, Null will be inserted if the value is “”; |
setUpdateReference(boolean value) | Indicates if references in other worksheets will be updated. |
setVariablesWorksheetName(String value) | Sets the name of the worksheet which contains variables smart marker. |
setWorkbook(Workbook value) | Sets the Workbook object. |
toString() | |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
WorkbookDesigner()
public WorkbookDesigner()
Initializes a new instance of the WorkbookDesigner class.
WorkbookDesigner(Workbook workbook)
public WorkbookDesigner(Workbook workbook)
Initializes a new instance of the WorkbookDesigner class.
Parameters:
Parameter | Type | Description |
---|---|---|
workbook | Workbook | The template workbook file. |
clearDataSource()
public void clearDataSource()
Clears all data sources.
containsVariables()
public boolean containsVariables()
Indicates whether the first worksheet contains custom variables.
Remarks
NOTE: This member is now obsolete. Instead, please use WorkbookDesigner.VariablesWorksheetName property, instead. This property will be removed 3 months later since September 2025. Aspose apologizes for any inconvenience you may have experienced.
Returns: boolean
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
getCalculateFormula()
public boolean getCalculateFormula()
Indicates whether formulas should be calculated.
Returns: boolean
getCallBack()
public ISmartMarkerCallBack getCallBack()
Gets callback interface of processing smartmarker.
Returns: ISmartMarkerCallBack
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getLineByLine()
public boolean getLineByLine()
Indicates whether processing the smart marker line by line.
Remarks
NOTE: This class is now obsolete. Instead, please use range smart markers. This property will be removed 12 months later since July 2025. Aspose apologizes for any inconvenience you may have experienced.
Returns: boolean
getRepeatFormulasWithSubtotal()
public boolean getRepeatFormulasWithSubtotal()
Indicates whether repeating formulas with subtotal row.
Returns: boolean
getSmartMarkers()
public String[] getSmartMarkers()
Returns a collection of smart markers in a spreadsheet.
Remarks
A string array is created on every call. The array is sorted and duplicated values are removed.
Returns: java.lang.String[] - A collection of smart markers
getSortDataSource()
public boolean getSortDataSource()
Indicates whether sorting data source.
Remarks
Only for JSON data source.
Returns: boolean
getUpdateEmptyStringAsNull()
public boolean getUpdateEmptyStringAsNull()
If TRUE, Null will be inserted if the value is “”;
Returns: boolean
getUpdateReference()
public boolean getUpdateReference()
Indicates if references in other worksheets will be updated.
Returns: boolean
getVariablesWorksheetName()
public String getVariablesWorksheetName()
Gets the name of the worksheet which contains variables smart marker.
Returns: java.lang.String
getWorkbook()
public Workbook getWorkbook()
Gets the Workbook object.
Returns: Workbook
hashCode()
public native int hashCode()
Returns: int
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
process()
public void process()
Processes the smart markers and populates the data source values.
process(boolean isPreserved)
public void process(boolean isPreserved)
Processes the smart markers and populates the data source values.
Parameters:
Parameter | Type | Description |
---|---|---|
isPreserved | boolean | True if the unrecognized smart marker is preserved. |
process(Range range, boolean isPreserved)
public void process(Range range, boolean isPreserved)
Processes the smart markers and populates the data source values.
Remarks
NOTE: This class is now obsolete. Instead, please use Range smart markers. This property will be removed 12 months later since July 2025. Aspose apologizes for any inconvenience you may have experienced.
Parameters:
Parameter | Type | Description |
---|---|---|
range | Range | The range to be processed |
isPreserved | boolean | True if the unrecognized smart marker is preserved. |
process(int sheetIndex, boolean isPreserved)
public void process(int sheetIndex, boolean isPreserved)
Processes the smart markers and populates the data source values.
Remarks
This method works on worksheet level.
Parameters:
Parameter | Type | Description |
---|---|---|
sheetIndex | int | Worksheet index. |
isPreserved | boolean | True if the unrecognized smart marker is preserved. |
setCalculateFormula(boolean value)
public void setCalculateFormula(boolean value)
Indicates whether formulas should be calculated.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setCallBack(ISmartMarkerCallBack value)
public void setCallBack(ISmartMarkerCallBack value)
Sets callback interface of processing smartmarker.
Parameters:
Parameter | Type | Description |
---|---|---|
value | ISmartMarkerCallBack |
setContainsVariables(boolean value)
public void setContainsVariables(boolean value)
Indicates whether the first worksheet contains custom variables.
Remarks
NOTE: This member is now obsolete. Instead, please use WorkbookDesigner.VariablesWorksheetName property, instead. This property will be removed 3 months later since September 2025. Aspose apologizes for any inconvenience you may have experienced.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setDataSource(String dataSource, ICellsDataTable cellsDataTable)
public void setDataSource(String dataSource, ICellsDataTable cellsDataTable)
Sets data source of a ICellsDataTable object.
Parameters:
Parameter | Type | Description |
---|---|---|
dataSource | java.lang.String | The name of the data source. |
cellsDataTable | ICellsDataTable | data table. |
setDataSource(String variable, Object data)
public void setDataSource(String variable, Object data)
Sets data binding to a variable.
Parameters:
Parameter | Type | Description |
---|---|---|
variable | java.lang.String | Variable name created using smart marker. |
data | java.lang.Object | Source data. |
setDataSource(String dataSource, ResultSet rs)
public void setDataSource(String dataSource, ResultSet rs)
Set the data source.
Parameters:
Parameter | Type | Description |
---|---|---|
dataSource | java.lang.String | The name of the data source. |
rs | java.sql.ResultSet | The result set. |
setDataSource(String dataSource, ResultSet rs, int rowCount)
public void setDataSource(String dataSource, ResultSet rs, int rowCount)
Set the data source.
Parameters:
Parameter | Type | Description |
---|---|---|
dataSource | java.lang.String | The name of the data source. |
rs | java.sql.ResultSet | The result set. |
rowCount | int | The data count of given resultset. It should be the exact row count or -1; If the resultset is forward only, user should give the exact row count here, otherwise the smart may not be processed correctly when the smart marker’s “noadd” is not set. |
setDataSource(ResultSet rs)
public void setDataSource(ResultSet rs)
Set the data source.
Parameters:
Parameter | Type | Description |
---|---|---|
rs | java.sql.ResultSet | The result set. |
setJsonDataSource(String name, String json)
public void setJsonDataSource(String name, String json)
Set json string value as data source of smart markers.
Parameters:
Parameter | Type | Description |
---|---|---|
name | java.lang.String | The name of the table. If the value of JSON represents an object,it coult be null. |
json | java.lang.String | The value of Json string. |
setLineByLine(boolean value)
public void setLineByLine(boolean value)
Indicates whether processing the smart marker line by line.
Remarks
NOTE: This class is now obsolete. Instead, please use range smart markers. This property will be removed 12 months later since July 2025. Aspose apologizes for any inconvenience you may have experienced.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setRepeatFormulasWithSubtotal(boolean value)
public void setRepeatFormulasWithSubtotal(boolean value)
Indicates whether repeating formulas with subtotal row.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setSortDataSource(boolean value)
public void setSortDataSource(boolean value)
Indicates whether sorting data source.
Remarks
Only for JSON data source.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setUpdateEmptyStringAsNull(boolean value)
public void setUpdateEmptyStringAsNull(boolean value)
If TRUE, Null will be inserted if the value is “”;
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setUpdateReference(boolean value)
public void setUpdateReference(boolean value)
Indicates if references in other worksheets will be updated.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setVariablesWorksheetName(String value)
public void setVariablesWorksheetName(String value)
Sets the name of the worksheet which contains variables smart marker.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setWorkbook(Workbook value)
public void setWorkbook(Workbook value)
Sets the Workbook object.
Parameters:
Parameter | Type | Description |
---|---|---|
value | Workbook |
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |