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 |
containsVariables()
Deprecated.
Use WorkbookDesigner.VariablesWorksheetName property, instead.
|
boolean |
getCalculateFormula()
Indicates whether formulas should be calculated.
|
ISmartMarkerCallBack |
getCallBack()
Gets callback interface of processing smartmarker.
|
boolean |
getLineByLine()
Deprecated.
Use range smart markers instead.
|
boolean |
getRepeatFormulasWithSubtotal()
Indicates whether repeating formulas with subtotal row.
|
java.lang.String[] |
getSmartMarkers()
Returns a collection of smart markers in a spreadsheet.
|
boolean |
getSortDataSource()
Indicates whether sorting data source.
|
boolean |
getUpdateEmptyStringAsNull()
If TRUE, Null will be inserted if the value is "";
|
boolean |
getUpdateReference()
Indicates if references in other worksheets will be updated.
|
java.lang.String |
getVariablesWorksheetName()
Gets the name of the worksheet which contains variables smart marker.
|
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 |
process(Range range,
boolean isPreserved)
Deprecated.
Use Range smart markers instead.
|
void |
setCalculateFormula(boolean value)
Indicates whether formulas should be calculated.
|
void |
setCallBack(ISmartMarkerCallBack value)
Sets callback interface of processing smartmarker.
|
void |
setContainsVariables(boolean value)
Deprecated.
Use WorkbookDesigner.VariablesWorksheetName property, instead.
|
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 name,
java.lang.String json)
Set json string value as data source of smart markers.
|
void |
setLineByLine(boolean value)
Deprecated.
Use range smart markers instead.
|
void |
setRepeatFormulasWithSubtotal(boolean value)
Indicates whether repeating formulas with subtotal row.
|
void |
setSortDataSource(boolean value)
Indicates whether sorting data source.
|
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 |
setVariablesWorksheetName(java.lang.String value)
Sets the name of the worksheet which contains variables smart marker.
|
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 name,
java.lang.String json)
name - The name of the table.
If the value of JSON represents an object,it coult be null.json - The value of Json string.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
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.public void setLineByLine(boolean value)
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.public void process(Range range, boolean isPreserved)
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.range - The range to be processedisPreserved - True if the unrecognized smart marker is preserved.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.public boolean containsVariables()
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.public void setContainsVariables(boolean value)
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.public java.lang.String getVariablesWorksheetName()
public void setVariablesWorksheetName(java.lang.String value)
public boolean getSortDataSource()
Remarks
Only for JSON data source.public void setSortDataSource(boolean value)
Remarks
Only for JSON data source.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 2003-2025. All Rights Reserved.