public class ExcelParameter
extends java.lang.Object
implements java.io.Serializable
ExcelParameter
class is used for exporting to Excel. It contains all the
information for exporting report results.
To create an ExcelParameter
using the constructors in this class:
ExcelParameter()Then you can set the value of parameters as you want.
There are four types of report layouts when exporting reports to Excel. They are:
1."Preserve Report Formatting": You must use the method setNewExcelLayout(true). This method calls setBiff8(false) regardless of the previous setting. 2.Normal Formatting: This type is from v7 and sometimes works better for analysis even though the look of the report is not maintained. If you want to use this type, you must use setNewExcelLayout(false) and setBiff8(false). 3.Excel 2000: You must use the method setBiff8(true). This method calls setNewExcelLayout(false) regardless of the previous setting. 4.Columned Type: If you want to use the columned type, you must set "Columned" to true in report template and then use Normal Formatting when exporting reports to Excel file.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXP
The suffix file name of the XLS Excel file.
|
static int |
EXPORTSHAPE
Useful constant for exporting shapes.
|
static int |
KEEPORIGIN
Useful constant for word wrap.
|
static int |
NOEXPORTSHAPE
Useful constant for exporting shapes.
|
static int |
NOWORDWRAP
Useful constant for word wrap.
|
static byte |
TYPE_FORMAT_AUTO
The exporting excel format is "Auto Format"
|
static byte |
TYPE_FORMAT_COLUMN
The exporting excel format is "column Format"
|
static byte |
TYPE_FORMAT_DATA
The exporting excel format is "Data Format"
|
static byte |
TYPE_FORMAT_REPORT
The exporting excel format is "Report Format"
|
static int |
WORDWRAPALL
Useful constant for word wrap.
|
static int |
XLSFORMAT
Specifies the Excel result as XLS format.
|
static java.lang.String |
XLSXEXP
The suffix file name of the XLSX format Excel file.
|
static int |
XLSXFORMAT
Specifies the Excel result as XLSX format.
|
Constructor and Description |
---|
ExcelParameter()
Initializes a newly created
ExcelParameter object so that it can
hold the values used in exporting to the Excel file. |
Modifier and Type | Method and Description |
---|---|
ExcelParameter |
copy()
Adding the method for MailInformation can clone this object.
|
boolean |
getDisplayValueConsistently()
Get the "Display Value Consistently" option.
|
boolean |
getGenerateExcelFormula()
Get the "Generate Excel Formula" option.
|
boolean |
getOverflowToAdjacentZeroLengthTextCell()
Get the "Overflow to Adjacent Zero Length Text Cell" option.
|
java.lang.String |
getPrintPageFooter()
Gets the print page footer.
|
java.lang.String |
getPrintPageHeader()
Gets the print page header.
|
int |
getWordWrapType()
Gets the word wrap type in the parameter.
|
boolean |
isAutoFormat()
Gets the boolean value of whether to check the "Auto format" option.
|
boolean |
isBiff8()
Gets the boolean value of whether to check the "Data format" option.
|
boolean |
isColumnFormat()
Gets the boolean value of whether to check the "Column format" option.
|
boolean |
isExportShape()
Gets the boolean value of whether to export shapes.
|
boolean |
isNewExcelLayout()
Gets the boolean value of whether to check the "Preserve Report Formatting" option.
|
boolean |
isNoFileExt() |
boolean |
isPrintGridlines()
Gets the flag that indexes whether to print gridlines or not.
|
boolean |
isShareLabel()
Gets the boolean value of whether to set ShareLabel.
|
boolean |
isXlsFormat()
Gets the flag which specifies whether the Excel result is XLS or not.
|
void |
setBiff8(boolean biff8)
Deprecated.
please use the method
setTypeFormat(byte) to replace it
Sets the "Excel 2000" option. If it is true, then option "Preserve Report Formatting" will be set to false. |
void |
setDisplayValueConsistently(boolean b)
Set the "Display Value Consistently" option.
|
void |
setFileFormat(int format)
Sets the Excel result format.
|
void |
setGenerateExcelFormula(boolean b)
Set the "Generate Excel Formula" option.
|
void |
setNewExcelLayout(boolean isNewExcelLayout)
Deprecated.
please use the method
setTypeFormat(byte) to replace it
Sets the value of whether to check the "Preserve Report Formatting" option.
If it is true, isBiff8 will be set to false. |
void |
setNoFileExt(boolean noFileExt) |
void |
setOverflowToAdjacentZeroLengthTextCell(boolean b)
Set the "Overflow to Adjacent Zero Length Text Cell" option.
|
void |
setParam(int param)
Sets whether to export shapes.
|
void |
setPrintGridlinesAble(boolean isPrint)
Sets the flag that indexes whether to print gridlines or not.
|
void |
setPrintPageHeaderAndFooter(java.lang.String header,
java.lang.String footer)
Sets the value of Print page header and footer in Excel file.
|
void |
setShareLable(boolean shareLabel)
Deprecated.
This method is not used, we export the Excel file as share format.
|
void |
setTypeFormat(byte typeFormat)
Set the exporting excel type format.
|
void |
setWordWrapType(int wordWrapType)
Sets the word wrap type.
|
public static final int KEEPORIGIN
public static final int NOWORDWRAP
public static final int WORDWRAPALL
public static final int EXPORTSHAPE
public static final int NOEXPORTSHAPE
public static final java.lang.String EXP
public static final java.lang.String XLSXEXP
public static final int XLSFORMAT
public static final int XLSXFORMAT
public static final byte TYPE_FORMAT_AUTO
public static final byte TYPE_FORMAT_REPORT
public static final byte TYPE_FORMAT_COLUMN
public static final byte TYPE_FORMAT_DATA
public ExcelParameter()
ExcelParameter
object so that it can
hold the values used in exporting to the Excel file. Note that this constructor
is empty. Every value is a default value.public void setTypeFormat(byte typeFormat)
typeFormat
- the type format, its value should be TYPE_FORMAT_AUTO
, TYPE_FORMAT_COLUMN
, TYPE_FORMAT_REPORT
or TYPE_FORMAT_DATA
Note: If this method is not invoked, the default type format is TYPE_FORMAT_COLUMN
public void setPrintPageHeaderAndFooter(java.lang.String header, java.lang.String footer)
header
- The Print page header in Excel file.footer
- The Print page footer in Excel file.public java.lang.String getPrintPageHeader()
public java.lang.String getPrintPageFooter()
public void setPrintGridlinesAble(boolean isPrint)
isPrint
- Prints the gridlines when it is true.public boolean isPrintGridlines()
public void setWordWrapType(int wordWrapType)
KEEPORIGIN NOWORDWRAP WORDWRAPALL
wordWrapType
- public void setParam(int param)
param
- When param is 1, export shapes to Excel. Any other value ignore shapes.public void setShareLable(boolean shareLabel)
shareLabel
- the boolean value share value.public void setNewExcelLayout(boolean isNewExcelLayout)
setTypeFormat(byte)
to replace it
Sets the value of whether to check the "Preserve Report Formatting" option.
If it is true, isBiff8 will be set to false.isNewExcelLayout
- the boolean value that represents the option.public int getWordWrapType()
public boolean isExportShape()
public boolean isShareLabel()
public boolean isNewExcelLayout()
public boolean isBiff8()
public void setBiff8(boolean biff8)
setTypeFormat(byte)
to replace it
Sets the "Excel 2000" option. If it is true, then option "Preserve Report Formatting" will be set to false.biff8
- public boolean isAutoFormat()
public boolean isColumnFormat()
public void setFileFormat(int format)
format
- it should be XLSFORMAT
or XLSXFORMAT
for now.public boolean isXlsFormat()
public void setOverflowToAdjacentZeroLengthTextCell(boolean b)
b
- the option value.public boolean getOverflowToAdjacentZeroLengthTextCell()
public void setDisplayValueConsistently(boolean b)
b
- the option value.public boolean getDisplayValueConsistently()
public void setGenerateExcelFormula(boolean b)
b
- the option value.public boolean getGenerateExcelFormula()
public ExcelParameter copy()
public void setNoFileExt(boolean noFileExt)
public boolean isNoFileExt()