public abstract class SaveOptions extends Object
Following classes inherit from this base class:
Following code demonstrates different ways of saving ExcelFile to specified file format.
ExcelFile ef = ExcelFile.load(fileName);
// Saves the spreadsheet to a file with the specified path
ef.save("Report.xlsx");
try (FileOutputStream stream = new FileOutputStream("Report.ods")) {
// Saves file to the stream
ef.save(stream, SaveOptions.getOdsDefault());
}
// Saves the file using specified save options
HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions();
htmlSaveOptions.setSelectionType(SelectionType.ENTIRE_FILE);
ef.save("Report.html", htmlSaveOptions);
Modifier and Type | Method and Description |
---|---|
abstract String |
getContentType()
Gets the content-type for this specific file format as defined in the RFC 2616.
|
static CsvSaveOptions |
getCsvDefault()
Gets the default options for saving to Character Separated Values file format.
|
static HtmlSaveOptions |
getHtmlDefault()
Gets the default options for saving to HyperText Markup Language File format.
|
abstract FileFormatLimitations |
getLimitations()
Gets limitations for saving to a file formats.
|
static OdsSaveOptions |
getOdsDefault()
Gets the default options for saving to OpenDocument Spreadsheet file format.
|
static XlsSaveOptions |
getXlsDefault()
Gets the default options for saving to, XLS file format (Microsoft Excel Spreadsheet format; Excel 2003 and prior versions) .
|
static XlsxSaveOptions |
getXlsxDefault()
Gets the default options for saving to XLSX file format (Microsoft Excel Open XML Spreadsheet; Excel 2007 and later).
|
public abstract String getContentType()
public static CsvSaveOptions getCsvDefault()
MS Excel uses ';' as default if current culture uses ',' for decimal separator. GemBox.Spreadsheet always uses ','.
public static HtmlSaveOptions getHtmlDefault()
public abstract FileFormatLimitations getLimitations()
This is the table for all limitations of each format:
Rows | Columns | Colors | CellStyles | |
---|---|---|---|---|
XLSX | 1048576 | 16384 | 16000000 | 64000 |
XLS | 65536 | 256 | 56 | 3979 |
ODS | 1048576 | 16384 | 16000000 | 64000 |
CSV | Integer.MAX_VALUE |
Integer.MAX_VALUE |
Integer.MAX_VALUE |
Integer.MAX_VALUE |
TXT | Integer.MAX_VALUE |
Integer.MAX_VALUE |
Integer.MAX_VALUE |
Integer.MAX_VALUE |
HTML | Integer.MAX_VALUE |
Integer.MAX_VALUE |
Integer.MAX_VALUE |
Integer.MAX_VALUE |
public static OdsSaveOptions getOdsDefault()
public static XlsSaveOptions getXlsDefault()
public static XlsxSaveOptions getXlsxDefault()
© GemBox d.o.o. — All rights reserved.