|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.table.TableWriter
public class TableWriter
TableWriter creates a comma separated values (CSV) stream from a table. The delimiter can be set to any String, but comma is the default.
Field Summary | |
---|---|
protected java.lang.String |
_delimiter
The delimiter string to be used |
protected static java.lang.String |
_excelArgs
|
protected static java.lang.String |
_fileExt
|
protected java.io.Writer |
_out
The Writer object to be used |
protected static boolean |
_verbose
|
protected static java.lang.String |
DEFAULT_DELIMITER
|
protected static java.lang.String |
EXCEL
|
protected boolean |
formattedDataUsed
|
static java.lang.String |
RB_KEY
|
Constructor Summary | |
---|---|
TableWriter(java.io.Writer out)
Creates a TableWriter with the default comma delimiter. |
|
TableWriter(java.io.Writer out,
java.lang.String delimiter)
|
Method Summary | |
---|---|
static void |
export(com.sas.sasserver.mdtable.MultidimensionalTableInterface mdModel)
Sends the table to Excel or to the browser, as appropriate. |
static void |
export(com.sas.mdtable.StaticMultidimensionalTableInterface mdModel,
boolean formattedDataUsed)
Sends the table to Excel or to the browser, as appropriate. |
static void |
export(com.sas.mdtable.StaticMultidimensionalTableInterface mdModel,
boolean formattedDataUsed,
boolean isRotated)
Sends the table to Excel or to the browser, as appropriate. |
static void |
export(StaticTableInterface table)
Sends the table to Excel or to the browser, as appropriate. |
static void |
export(StaticTableInterface table,
boolean formattedDataUsed)
Sends the table to Excel or to the browser, as appropriate. |
static byte[] |
getCSVAsByteArray(com.sas.sasserver.mdtable.MultidimensionalTableInterface mdModel)
Convenience method to represent a table as a CSV and return it as a byte array. |
static byte[] |
getCSVAsByteArray(com.sas.mdtable.StaticMultidimensionalTableInterface mdModel,
boolean formattedDataUsed)
Convenience method to represent a table as a CSV and return it as a byte array. |
static byte[] |
getCSVAsByteArray(com.sas.mdtable.StaticMultidimensionalTableInterface mdModel,
boolean formattedDataUsed,
boolean isRotated)
Convenience method to represent a table as a CSV and return it as a byte array. |
static byte[] |
getCSVAsByteArray(StaticTableInterface model)
Convenience method to represent a table as a CSV and return it as a byte array. |
static byte[] |
getCSVAsByteArray(StaticTableInterface model,
boolean formattedDataUsed)
Convenience method to represent a table as a CSV and return it as a byte array. |
java.lang.String |
getDelimiter()
Get the delimiter (the separator for data items). |
protected static java.lang.String |
getExcelEXE()
|
static boolean |
isExportAllowed()
Indicates whether exporting can happen (checks security, application paths, etc. as appropriate. |
boolean |
isFormattedDataUsed()
Gets whether the writer is going to use the formatted data (if available), or the raw data. |
boolean |
isTransposed()
Sets whether the md tableview is rotated. |
static void |
resetCheck()
clears the checked flag so that isExportAllowed will check again |
void |
setDelimiter(java.lang.String delimiter)
Set the delimiter (the separator for data items). |
void |
setFormattedDataUsed(boolean useFormat)
Sets whether the writer is going to use the formatted data (if available), or the raw data. |
void |
setTransposed(boolean isRotated)
Sets whether the md tableview is rotated. |
static void |
setVerbose(boolean verbose)
Useful for debugging |
void |
writeCSV(com.sas.sasserver.mdtable.MultidimensionalTableInterface mdModel)
Writes a table as a CSV to the writer specified in the constructor. |
void |
writeCSV(com.sas.mdtable.StaticMultidimensionalTableInterface mdModel)
Writes a table as a CSV to the writer specified in the constructor. |
void |
writeCSV(StaticTableInterface model)
Writes a table as a CSV to the writer specified in the constructor. |
Field Detail |
---|
public static final java.lang.String RB_KEY
protected static java.lang.String DEFAULT_DELIMITER
protected boolean formattedDataUsed
protected java.io.Writer _out
protected java.lang.String _delimiter
protected static boolean _verbose
protected static final java.lang.String _excelArgs
protected static final java.lang.String _fileExt
protected static final java.lang.String EXCEL
Constructor Detail |
---|
public TableWriter(java.io.Writer out)
out
- the writer to which the table should be written as a CSVpublic TableWriter(java.io.Writer out, java.lang.String delimiter)
out
- the writer to which the table should be written as a CSVdelimiter
- the delimiter stringMethod Detail |
---|
public void setDelimiter(java.lang.String delimiter)
delimiter
- the delimiter stringpublic java.lang.String getDelimiter()
public void setFormattedDataUsed(boolean useFormat)
useFormat
- boolean indicating whether to use the formatted data or notpublic boolean isFormattedDataUsed()
public void setTransposed(boolean isRotated)
isRotated
- boolean indicating whether to the mdtableview is rotatedpublic boolean isTransposed()
public static byte[] getCSVAsByteArray(StaticTableInterface model)
model
- the two dimensional table to usepublic static byte[] getCSVAsByteArray(com.sas.sasserver.mdtable.MultidimensionalTableInterface mdModel)
model
- the multidimensional table to usepublic static byte[] getCSVAsByteArray(StaticTableInterface model, boolean formattedDataUsed)
model
- the two dimensional table to usepublic static byte[] getCSVAsByteArray(com.sas.mdtable.StaticMultidimensionalTableInterface mdModel, boolean formattedDataUsed)
model
- the multidimensional table to usepublic static byte[] getCSVAsByteArray(com.sas.mdtable.StaticMultidimensionalTableInterface mdModel, boolean formattedDataUsed, boolean isRotated)
model
- the multidimensional table to usepublic void writeCSV(StaticTableInterface model) throws java.io.IOException
model
- the two dimensional table to use
java.io.IOException
public void writeCSV(com.sas.sasserver.mdtable.MultidimensionalTableInterface mdModel) throws java.io.IOException
model
- the multidimensional table to use
java.io.IOException
public void writeCSV(com.sas.mdtable.StaticMultidimensionalTableInterface mdModel) throws java.io.IOException
model
- the multidimensional table to use
java.io.IOException
public static void setVerbose(boolean verbose)
public static void resetCheck()
public static boolean isExportAllowed()
protected static java.lang.String getExcelEXE()
public static void export(StaticTableInterface table)
public static void export(com.sas.sasserver.mdtable.MultidimensionalTableInterface mdModel)
public static void export(StaticTableInterface table, boolean formattedDataUsed)
public static void export(com.sas.mdtable.StaticMultidimensionalTableInterface mdModel, boolean formattedDataUsed)
public static void export(com.sas.mdtable.StaticMultidimensionalTableInterface mdModel, boolean formattedDataUsed, boolean isRotated)
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |