public interface AQExcelWriter extends AQDataWriter
This writer constructs an in-memory spreadsheet which can be written to the disk by saveToFile() method or converted to a byte array via saveToByteArray().
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this writer and releases any system resources associated with it.
|
void |
insertPivotTable(AQPivotDataSet dataSet)
Inserts a new worksheet containing pivot table from the specified data set.
|
byte[] |
saveToByteArray()
Saves the spreadsheet to a byte array.
|
void |
saveToFile(String filename)
Save the spreadsheet to a file.
|
void |
setAutoResize(boolean on)
Controls whether the columns will be resized to fit the data.
|
void |
setColumnWidth(int columnIndex,
float width)
Sets the width of the specified column, in unit of characters using default font.
|
void |
setCurrentWorksheet(String name)
Sets the current worksheet.
|
void |
setFirstLineContainsColumnNames(boolean on)
Defines whether the first data row is preceded by a row containing column names.
|
void |
setNullString(String s)
Sets value to be placed in a cell containing null data.
|
void |
skip()
Skips one line in the output file.
|
void |
skip(int numberOfLines)
Skips specified number of lines in the output file.
|
write, write, write, write
void setCurrentWorksheet(String name)
Any data written prior to this call will be inserted into automatically added worksheet named "Data".
name
- Worksheet name.void setFirstLineContainsColumnNames(boolean on)
This method may be called before any data is written. An exception will be thrown if this method is invoked after data has been written.
on
- to turn the option on or offvoid setNullString(String s)
This method may be called before any data is written. An exception will be thrown if this method is invoked after data has been written.
s
- String value to be inserted in place of a null.void skip()
void skip(int numberOfLines)
numberOfLines
- Number of lines to skip.void setColumnWidth(int columnIndex, float width)
columnIndex
- Column index, 0-based.width
- Column width in characters(0-255).void setAutoResize(boolean on)
setColumnWidth(int, float)
.
This method may be called before any data is written. An exception will be thrown if this method is invoked after data has been written.
on
- to turn the option on/offvoid insertPivotTable(AQPivotDataSet dataSet) throws Exception
dataSet
- the data setException
- On Errorbyte[] saveToByteArray() throws Exception
Exception
- On Errorvoid saveToFile(String filename) throws Exception
filename
- Output file name.Exception
- On Errorvoid close() throws IOException
close
in interface AQDataWriter
close
in interface AutoCloseable
close
in interface Closeable
IOException
- On error
Copyright © 2017 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.