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. |
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. |
getUpdateEmptyStringAsNull() | If TRUE, Null will be inserted if the value is “”; |
getUpdateReference() | Indicates if references in other worksheets will be updated. |
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(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. |
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 variable, String data) | |
setLineByLine(boolean value) | Indicates whether processing the smart marker line by line. |
setRepeatFormulasWithSubtotal(boolean value) | Indicates whether repeating formulas with subtotal row. |
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. |
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.
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
The default value is true. If False, the template file must contain a range which is named as “_CellsSmartMarkers”.
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
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
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(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 |
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 variable, String data)
public void setJsonDataSource(String variable, String data)
Parameters:
Parameter | Type | Description |
---|---|---|
variable | java.lang.String | |
data | java.lang.String |
setLineByLine(boolean value)
public void setLineByLine(boolean value)
Indicates whether processing the smart marker line by line.
Remarks
The default value is true. If False, the template file must contain a range which is named as “_CellsSmartMarkers”.
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 |
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 |
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 |