public class WorkbookDesigner
extends java.lang.Object
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");
| Constructor and Description |
|---|
WorkbookDesigner()
Initializes a new instance of the
WorkbookDesigner class. |
WorkbookDesigner(Workbook workbook)
Initializes a new instance of the
WorkbookDesigner class. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearDataSource()
Clears all data sources.
|
boolean |
getCalculateFormula()
Indicates whether formulas should be calculated.
|
ISmartMarkerCallBack |
getCallBack()
Gets callback interface of processing smartmarker.
|
boolean |
getLineByLine()
Indicates whether processing the smart marker line by line.
|
boolean |
getRepeatFormulasWithSubtotal()
Indicates whether repeating formulas with subtotal row.
|
java.lang.String[] |
getSmartMarkers()
Returns a collection of smart markers in a spreadsheet.
|
boolean |
getUpdateEmptyStringAsNull()
If TRUE, Null will be inserted if the value is "";
|
boolean |
getUpdateReference()
Indicates if references in other worksheets will be updated.
|
Workbook |
getWorkbook()
Gets the
Workbook object. |
void |
process()
Processes the smart markers and populates the data source values.
|
void |
process(boolean isPreserved)
Processes the smart markers and populates the data source values.
|
void |
process(int sheetIndex,
boolean isPreserved)
Processes the smart markers and populates the data source values.
|
void |
setCalculateFormula(boolean value)
Indicates whether formulas should be calculated.
|
void |
setCallBack(ISmartMarkerCallBack value)
Sets callback interface of processing smartmarker.
|
void |
setDataSource(java.sql.ResultSet rs)
Set the data source.
|
void |
setDataSource(java.lang.String dataSource,
ICellsDataTable cellsDataTable)
Sets data source of a
ICellsDataTable object. |
void |
setDataSource(java.lang.String variable,
java.lang.Object data)
Sets data binding to a variable.
|
void |
setDataSource(java.lang.String dataSource,
java.sql.ResultSet rs)
Set the data source.
|
void |
setDataSource(java.lang.String dataSource,
java.sql.ResultSet rs,
int rowCount)
Set the data source.
|
void |
setJsonDataSource(java.lang.String variable,
java.lang.String data) |
void |
setLineByLine(boolean value)
Indicates whether processing the smart marker line by line.
|
void |
setRepeatFormulasWithSubtotal(boolean value)
Indicates whether repeating formulas with subtotal row.
|
void |
setUpdateEmptyStringAsNull(boolean value)
If TRUE, Null will be inserted if the value is "";
|
void |
setUpdateReference(boolean value)
Indicates if references in other worksheets will be updated.
|
void |
setWorkbook(Workbook value)
Sets the
Workbook object. |
public WorkbookDesigner()
WorkbookDesigner class.public WorkbookDesigner(Workbook workbook)
WorkbookDesigner class.workbook - The template workbook file.public boolean getRepeatFormulasWithSubtotal()
public void setRepeatFormulasWithSubtotal(boolean value)
public void clearDataSource()
public void setDataSource(java.lang.String dataSource,
ICellsDataTable cellsDataTable)
ICellsDataTable object.dataSource - The name of the data source.cellsDataTable - data table.public void setJsonDataSource(java.lang.String variable,
java.lang.String data)
variable - data - public void setDataSource(java.lang.String variable,
java.lang.Object data)
variable - Variable name created using smart marker.data - Source data.public boolean getUpdateEmptyStringAsNull()
public void setUpdateEmptyStringAsNull(boolean value)
public boolean getUpdateReference()
public void setUpdateReference(boolean value)
public boolean getCalculateFormula()
public void setCalculateFormula(boolean value)
public ISmartMarkerCallBack getCallBack()
public void setCallBack(ISmartMarkerCallBack value)
public boolean getLineByLine()
Remarks
The default value is true. If False, the template file must contain a range which is named as "_CellsSmartMarkers".public void setLineByLine(boolean value)
Remarks
The default value is true. If False, the template file must contain a range which is named as "_CellsSmartMarkers".public void process()
public void process(boolean isPreserved)
isPreserved - True if the unrecognized smart marker is preserved.public void process(int sheetIndex,
boolean isPreserved)
Remarks
This method works on worksheet level.sheetIndex - Worksheet index.isPreserved - True if the unrecognized smart marker is preserved.public java.lang.String[] getSmartMarkers()
Remarks
A string array is created on every call. The array is sorted and duplicated values are removed.public void setDataSource(java.lang.String dataSource,
java.sql.ResultSet rs,
int rowCount)
dataSource - The name of the data source.rs - The result set.rowCount - 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.public void setDataSource(java.lang.String dataSource,
java.sql.ResultSet rs)
dataSource - The name of the data source.rs - The result set.public void setDataSource(java.sql.ResultSet rs)
rs - The result set.See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2001-2023. All Rights Reserved.