com.aspose.cells
Class WorkbookDesigner

java.lang.Object
    extended by com.aspose.cells.WorkbookDesigner

public class WorkbookDesigner 
extends java.lang.Object

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.
WorkbookDesigner(Workbook workbook)
           Initializes a new instance of the WorkbookDesigner class.
 
Property Getters/Setters Summary
booleangetCalculateFormula()
voidsetCalculateFormula(boolean)
           Indicates whether formulas should be calculated.
ISmartMarkerCallBackgetCallBack()
voidsetCallBack(ISmartMarkerCallBack)
           Gets and sets callback interface of processing smartmarker.
booleangetLineByLine()
voidsetLineByLine(boolean)
           Indicates whether processing the smart marker line by line.
booleangetRepeatFormulasWithSubtotal()
voidsetRepeatFormulasWithSubtotal(boolean)
           Indicates whether repeating formulas with subtotal row.
booleangetUpdateEmptyStringAsNull()
voidsetUpdateEmptyStringAsNull(boolean)
           If TRUE, Null will be inserted if the value is "";
booleangetUpdateReference()
voidsetUpdateReference(boolean)
           Indicates if references in other worksheets will be updated.
WorkbookgetWorkbook()
voidsetWorkbook(Workbook)
           Gets and sets the Workbook object.
 
Method Summary
voidclearDataSource()
           Clears all data sources.
java.lang.String[]getSmartMarkers()
           Returns a collection of smart markers in a spreadsheet.
voidprocess()
           Processes the smart markers and populates the data source values.
voidprocess(boolean isPreserved)
           Processes the smart markers and populates the data source values.
voidprocess(int sheetIndex, boolean isPreserved)
           Processes the smart markers and populates the data source values.
voidsetDataSource(java.lang.String dataSource, ICellsDataTable cellsDataTable)
           Sets data source of a ICellsDataTable object.
voidsetDataSource(java.lang.String variable, java.lang.Object data)
           Sets data binding to a variable.
 

Constructor Detail

WorkbookDesigner

public WorkbookDesigner()
Initializes a new instance of the WorkbookDesigner class.

WorkbookDesigner

public WorkbookDesigner(Workbook workbook)
Initializes a new instance of the WorkbookDesigner class.
Parameters:
workbook - The template workbook file.

Property Getters/Setters Detail

getWorkbook/setWorkbook

public Workbook getWorkbook() / public void setWorkbook(Workbook value)
Gets and sets the Workbook object.

setWorkbook

public void setWorkbook(Workbook value)
Gets and sets the Workbook object.

getRepeatFormulasWithSubtotal/setRepeatFormulasWithSubtotal

public boolean getRepeatFormulasWithSubtotal() / public void setRepeatFormulasWithSubtotal(boolean value)
Indicates whether repeating formulas with subtotal row.

setRepeatFormulasWithSubtotal

public void setRepeatFormulasWithSubtotal(boolean value)
Indicates whether repeating formulas with subtotal row.

getUpdateEmptyStringAsNull/setUpdateEmptyStringAsNull

public boolean getUpdateEmptyStringAsNull() / public void setUpdateEmptyStringAsNull(boolean value)
If TRUE, Null will be inserted if the value is "";

setUpdateEmptyStringAsNull

public void setUpdateEmptyStringAsNull(boolean value)
If TRUE, Null will be inserted if the value is "";

getUpdateReference/setUpdateReference

public boolean getUpdateReference() / public void setUpdateReference(boolean value)
Indicates if references in other worksheets will be updated.

setUpdateReference

public void setUpdateReference(boolean value)
Indicates if references in other worksheets will be updated.

getCalculateFormula/setCalculateFormula

public boolean getCalculateFormula() / public void setCalculateFormula(boolean value)
Indicates whether formulas should be calculated.

setCalculateFormula

public void setCalculateFormula(boolean value)
Indicates whether formulas should be calculated.

getCallBack/setCallBack

public ISmartMarkerCallBack getCallBack() / public void setCallBack(ISmartMarkerCallBack value)
Gets and sets callback interface of processing smartmarker.

setCallBack

public void setCallBack(ISmartMarkerCallBack value)
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 true. If False, the template file must contain a range which is named as "_CellsSmartMarkers".

setLineByLine

public void setLineByLine(boolean value)
Indicates whether processing the smart marker line by line. The default value is true. 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)
Sets data source of a ICellsDataTable object.
Parameters:
dataSource - The name of the data source.
cellsDataTable - data table.

setDataSource

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.
Returns:
A collection of smart markers

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.