![]() |
||
Home Products Purchase Downloads Demos Forums Blogs Ticket Wiki API Corporate |
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aspose.cells.WorkbookDesigner
public class WorkbookDesigner
Encapsulates the object that represents a designer spreadsheet.
Constructor Summary | |
---|---|
WorkbookDesigner()
|
Method Summary | |
---|---|
void |
clearDataSource()
Clears all data sources. |
void |
clearDataSource(java.lang.String variable)
Clears the data source by the source name. |
java.lang.String[] |
getSmartMarkers(int sheetIndex)
Gets a collection of smart markers in a spreadsheet. |
Workbook |
getWorkbook()
Gets the internal Workbook object. |
void |
open(java.io.InputStream stream)
Opens a preset designer spreadsheet. |
void |
open(java.lang.String designerSpreadsheet)
Opens a preset designer spreadsheet. |
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 |
save(java.io.OutputStream stream)
Saves the workbook to the given stream. |
void |
save(java.io.OutputStream stream,
int fileFormatType)
Saves the workbook to the given stream. |
void |
save(java.lang.String resultSpreadsheet)
Creates and saves the result spreadsheet to the disk. |
void |
save(java.lang.String resultSpreadsheet,
int fileFormatType)
Creates and saves the result spreadsheet to the disk. |
void |
setDataSource(java.sql.ResultSet rs)
Sets data source of a ResultSet object. |
void |
setDataSource(java.lang.String dataSourceName,
AsposeDataTable dataTable)
Sets data source of a AsposeDataTable object and binds it to a data source name. |
void |
setDataSource(java.lang.String variable,
java.lang.Object data)
Sets data binding to a variable. |
void |
setDataSource(java.lang.String variable,
java.lang.Object[] dataArray)
Sets data array binding to a variable. |
void |
setDataSource(java.lang.String dataSourceName,
java.sql.ResultSet rs)
Sets data source of a ResultSet object and binds it to a data source name. |
void |
setDataSource(java.lang.String dataSourceName,
java.sql.ResultSet rs,
int cacheLimit)
Sets data source of a ResultSet object and binds it to a data source name. |
void |
setDataSource(java.lang.String dataSourceName,
java.sql.ResultSet rs,
int cacheLimit,
int recordLimit)
Sets data source of a ResultSet object and binds it to a data source name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WorkbookDesigner()
Method Detail |
---|
public Workbook getWorkbook()
public void setDataSource(java.sql.ResultSet rs)
rs
- The ResultSet object.public void setDataSource(java.lang.String dataSourceName, AsposeDataTable dataTable)
dataSourceName
- Data source name.dataTable
- The data table.public void setDataSource(java.lang.String dataSourceName, java.sql.ResultSet rs)
setDataSource(String, ResultSet, int, int)
with parameter
"cacheLimit" being -1(no cache) and "recordLimit" being -1(no limit).
dataSourceName
- Data source name.rs
- The ResultSet object.setDataSource(String, ResultSet, int, int)
public void setDataSource(java.lang.String dataSourceName, java.sql.ResultSet rs, int cacheLimit)
setDataSource(String, ResultSet, int, int)
with parameter
"recordLimit" being -1(no limit).
dataSourceName
- Data source name.rs
- The ResultSet object.cacheLimit
- the cached record limit for ResultSet with type TYPE_FORWARD_ONLY.setDataSource(String, ResultSet, int, int)
public void setDataSource(java.lang.String dataSourceName, java.sql.ResultSet rs, int cacheLimit, int recordLimit)
In the template excel file the markers are: Col1 Col2 Col3 Row1: &=ds.col1 &=ds.col2 &=ds.col3 Row2: &=ds.col1 &=ds.col4 In the ResultSet the records are: col1 col2 col3 col4 Record1: val11 val12 val13 val14 Record2: val21 val22 val23 val24 Record3: val31 val32 val33 val34 Without caching: workbookDesigner.setDataSource("ds", rs, -1); workbookDesigner.process(); the result in excel file will be: Col1 Col2 Col3 Row1: val11 val12 val13 Row1+1: val21 val22 val23 Row1+2: val31 val32 val33 Row2: &=ds.col1 &=ds.col4 With caching: workbookDesigner.setDataSource("ds", rs, 0); //cache all records workbookDesigner.process(); the result in excel file will be: Col1 Col2 Col3 Row1: val11 val12 val13 Row1+1: val21 val22 val23 Row1+2: val31 val32 val33 Row2: val11 val14 Row2+1: val21 val24 Row2+2: val31 val34
dataSourceName
- Data source name.rs
- The ResultSet object.cacheLimit
- the cached record limit for ResultSet with type TYPE_FORWARD_ONLY.
Value can be:
recordLimit
- the imported records limit.
Value can be:
public void setDataSource(java.lang.String variable, java.lang.Object data)
variable
- Variable name created using smark marker.data
- Source data.public void setDataSource(java.lang.String variable, java.lang.Object[] dataArray)
variable
- Variable name created using smark marker.dataArray
- Source data array.public void clearDataSource()
public void clearDataSource(java.lang.String variable)
variable
- Variable name created using smark marker.public java.lang.String[] getSmartMarkers(int sheetIndex)
sheetIndex
- Worksheet index.
public void process()
public void process(boolean isPreserved)
isPreserved
- if the unrecognized smart marker is preserved.public void process(int sheetIndex, boolean isPreserved)
sheetIndex
- Worksheet index.isPreserved
- Processes the smart markers and populates the data source values.public void open(java.lang.String designerSpreadsheet) throws java.io.IOException
designerSpreadsheet
- The preset designer spreadsheet.
java.io.IOException
- IOException if an I/O error occurs.public void open(java.io.InputStream stream) throws java.io.IOException
stream
- inputstream which contains the preset designer spreadsheet.
java.io.IOException
- IOException if an I/O error occurs.public void save(java.lang.String resultSpreadsheet) throws java.io.IOException
resultSpreadsheet
- Result spreadsheet
java.io.IOException
- if an I/O error occurs.public void save(java.lang.String resultSpreadsheet, int fileFormatType) throws java.io.IOException
resultSpreadsheet
- Result spreadsheetfileFormatType
- one of the FileFormatType values whcih specifies the file format.
java.io.IOException
- if an I/O error occurs.FileFormatType
public void save(java.io.OutputStream stream) throws java.io.IOException
stream
- the stream to write to.
java.io.IOException
- if an I/O error occurs.public void save(java.io.OutputStream stream, int fileFormatType) throws java.io.IOException
stream
- the stream to write to.fileFormatType
- one of the FileFormatType values whcih specifies the file format.
java.io.IOException
- if an I/O error occurs.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |