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");
Constructor Summary
WorkbookDesigner()
Initializes a new instance of the WorkbookDesigner class.
Gets and sets callback interface of processing smartmarker.
getLineByLine/setLineByLine
public boolean getLineByLine() / public void setLineByLine(boolean value)
Indicates whether processing the smart marker line by line.
The default value is false.
If False, the template file must contain a range which is named as "_CellsSmartMarkers".
Method Detail
clearDataSource
public void clearDataSource()
Clears all data sources.
setDataSource
public void setDataSource(java.lang.String dataSource, ICellsDataTable cellsDataTable)
public void setDataSource(java.lang.String variable, java.lang.Object data)
Sets data binding to a variable.
Parameters:
variable - Variable name created using smart marker.
data - Source data.
process
public void process()
throws java.lang.Exception
Processes the smart markers and populates the data source values.
process
public void process(boolean isPreserved)
throws java.lang.Exception
Processes the smart markers and populates the data source values.
Parameters:
isPreserved - True if the unrecognized smart marker is preserved.
process
public void process(int sheetIndex, boolean isPreserved)
throws java.lang.Exception
Processes the smart markers and populates the data source values.
This method works on worksheet level.
Parameters:
sheetIndex - Worksheet index.
isPreserved - True if the unrecognized smart marker is preserved.
getSmartMarkers
public java.lang.String[] getSmartMarkers()
Returns a collection of smart markers in a spreadsheet.
A string array is created on every call. The array is sorted and duplicated values are removed.