|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.servlet.commands.jdbc.export.Util
public class Util
Contains utility methods and attributes used by the Export To Excel commands.
Field Summary | |
---|---|
static java.lang.String |
CHARSET_FOR_HTML_EXPORT_TO_EXCEL
Unicode charset to use to encode the data when exporting to Microsoft Excel in HTML format. |
static java.lang.String |
CHARSET_FOR_NON_HTML_EXPORT_TO_EXCEL
Unicode charset to use to encode the data when exporting to Microsoft Excel in non HTML format. |
static int |
REVERSED_BOM_FOR_NON_HTML_EXPORT_TO_EXCEL
Byte-order mark (BOM) to use when exporting in Unicode with CHARSET_FOR_NON_HTML_EXPORT_TO_EXCEL . |
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static void |
addExcelXMLDirective(BaseTableCell renderer,
java.lang.Object rawValue,
java.lang.String sasFormatName,
java.util.Locale locale,
java.lang.String formattedValue,
boolean treatNumericCustomFormattedValuesAsText)
|
static void |
addExcelXMLDirective(BaseTableCell renderer,
javax.swing.table.TableModel tm,
int rowNumber,
int colModelIndex,
java.util.Locale locale,
java.lang.String customAttributes,
java.lang.String formattedValue,
boolean treatNumericCustomFormattedValuesAsText)
|
static com.sas.storage.iquery.BusinessQueryToTableModelAdapter |
createModelWithDisabledOfflineResultSets(com.sas.iquery.metadata.business.BusinessQuery businessQuery,
com.sas.iquery.dataretrieval.QueryConnectorInterface queryConnector,
java.lang.Boolean dualResultSets)
Return a new BusinessQueryToTableModelAdapter with offline results sets turned off. |
static java.lang.String |
encodeForExcel(java.lang.String text)
S0632986 Encodes the characters '&', '"', '<', and '>' respectively with '&', '"', '<' and '>'. |
static java.lang.String[] |
getColumnsToExportAsTextIfCustomFormatted(java.lang.String[] columnUniqueModelIdentifiers,
com.sas.iquery.metadata.business.DataItem[] dataItems)
Returns the array of unique model identifiers of columns that should be exported as text if custom formatted. |
static java.lang.String[] |
getColumnUniqueModelIdentifiers(java.util.Enumeration<TableColumn> columns)
Returns the array of Unique Model Identifiers for a set of TableColumn objects |
static com.sas.iquery.metadata.business.DataItem[] |
getDataItemsInBusinessQuery(com.sas.iquery.metadata.business.BusinessQuery query)
|
static com.sas.iquery.metadata.business.DataItem[] |
getDataItemsInTableModel(javax.swing.table.TableModel tm)
|
static java.lang.String |
getExportFileName(java.lang.String fileExtension)
Returns a randomly generated file name for the file to be exported. |
static java.lang.String |
getHTMLFooter()
When exporting data to HTML it returns the footer of the html file to export. |
static java.lang.String |
getHTMLHeader(HTMLExportCSSInfoInterface[] css,
java.lang.String styles)
When exporting data to HTML it returns the header of the html file to export. |
static java.lang.String |
getHTMLNewLineSpan(java.lang.String string)
Generates an HTML 'span' tag on a new line containing the string. |
static boolean |
isNumericMissingValue(BaseTableView table,
java.lang.String value)
S0400309 to export relational missing values as blanks Returns true if the received value is a numeric missing value, otherwise return false. |
Field Detail |
---|
public static java.lang.String CHARSET_FOR_NON_HTML_EXPORT_TO_EXCEL
public static int REVERSED_BOM_FOR_NON_HTML_EXPORT_TO_EXCEL
CHARSET_FOR_NON_HTML_EXPORT_TO_EXCEL
.
It's called "reversed" because it will be automatically reversed before writing it in the output stream.
For example if the expected BOM in the output stream is (in hexadecimal) FFFE, its "reversed" version is FEFF
public static java.lang.String CHARSET_FOR_HTML_EXPORT_TO_EXCEL
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static java.lang.String getHTMLHeader(HTMLExportCSSInfoInterface[] css, java.lang.String styles)
css
- The HTMLExportCSSInfoInterface
objects that describe the CSS files to be included.styles
- The definitions of the inline style sheets to be included.
public static java.lang.String getHTMLFooter()
public static java.lang.String getHTMLNewLineSpan(java.lang.String string)
string
An empty HTML 'span' tag on a new line is generated if the string is either empty or null.
Something like
string
- The string to put inside the 'span' tag
string
or
public static java.lang.String getExportFileName(java.lang.String fileExtension)
fileExtension
- Is appended to the randomly generated file name.
Examples of fileExtension are ".xls" or ".csv".
public static void addExcelXMLDirective(BaseTableCell renderer, java.lang.Object rawValue, java.lang.String sasFormatName, java.util.Locale locale, java.lang.String formattedValue, boolean treatNumericCustomFormattedValuesAsText)
public static void addExcelXMLDirective(BaseTableCell renderer, javax.swing.table.TableModel tm, int rowNumber, int colModelIndex, java.util.Locale locale, java.lang.String customAttributes, java.lang.String formattedValue, boolean treatNumericCustomFormattedValuesAsText)
public static com.sas.storage.iquery.BusinessQueryToTableModelAdapter createModelWithDisabledOfflineResultSets(com.sas.iquery.metadata.business.BusinessQuery businessQuery, com.sas.iquery.dataretrieval.QueryConnectorInterface queryConnector, java.lang.Boolean dualResultSets)
businessQuery
- the BusinessQuery on which the created adapter is based on. If null, null is returned.queryConnector
- the specific QueryConnectorInterface object the created adapter has to use.
If null the adapter will use a new instance of a com.sas.iquery.dataretrieval.QueryConnector object.dualResultSets
- if Boolean#FALSE the created adapter will not use dual result sets,
otherwise the created adapter will use the default policy about using/not using dual result sets.
BusinessQueryToTableModelAdapter.DEFAULT_POLICY_ON_USING_DUAL_RESULT_SETS
public static boolean isNumericMissingValue(BaseTableView table, java.lang.String value)
table
- the TableView used to verify that the current column is numeric.value
- the value to check.
public static java.lang.String[] getColumnsToExportAsTextIfCustomFormatted(java.lang.String[] columnUniqueModelIdentifiers, com.sas.iquery.metadata.business.DataItem[] dataItems)
columnUniqueModelIdentifiers
- array of column unique model identifiers candidate to be exported as text if custom formatted.tm
-
public static java.lang.String[] getColumnUniqueModelIdentifiers(java.util.Enumeration<TableColumn> columns)
columns
- the enumeration of TableColumn objects
public static com.sas.iquery.metadata.business.DataItem[] getDataItemsInTableModel(javax.swing.table.TableModel tm)
public static com.sas.iquery.metadata.business.DataItem[] getDataItemsInBusinessQuery(com.sas.iquery.metadata.business.BusinessQuery query)
public static java.lang.String encodeForExcel(java.lang.String text)
text
- the text to be encoded
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |