|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.extentech.ExtenXLS.ExtenXLS
public class ExtenXLS
Useful Entry-Point for ExtenXLS functionality.
Provides helpful, command-line methods.
Command line parameters:
-xinitialize Excel Template
-oname of output file or "stdout" for System.out
-xls
-xml output XML representation of file
-bindfiletransform using XML Report Definition File (RDF)
for example:
read in template.xls, output templateout.xml in XML format
-xtemplate.xls -otemplateout.xml -fxml
Read in template.xls, output to stdout in XLS format:
java com.extentech.ExtenXLS.ExtenXLS -xTemplate.xls-oTemplateout.xml -fxml
Read in an rdf and parameters:
java com.extentech.ExtenXLS.ExtenXLS -rMyReport.rdf -oMyOutPut.xls -fxls
| Constructor Summary | |
|---|---|
ExtenXLS()
|
|
| Method Summary | |
|---|---|
static void |
addImages(org.xmlpull.v1.XmlPullParser xpp,
com.extentech.formats.XLS.Boundsheet bound)
Takes XML defining images and adds the images defined in it into the specific position in the sheet |
static void |
dumpCSVtoSpreadsheet(File csv,
WorkBook book,
int sheetnum)
simply read the csv into a workbook set the "com.extentech.extenxls.csvdelimiter" system property to change the delimiter aka: System.getProperties().setProperty("com.extentech.extenxls.csvdelimiter", "|"); |
static void |
dumpCSVtoSpreadsheet(InputStream csv,
WorkBook book,
int sheetnum)
simply read the csv into a workbook set the "com.extentech.extenxls.csvdelimiter" system property to change the delimiter aka: System.getProperties().setProperty("com.extentech.extenxls.csvdelimiter", "|"); |
static ByteArrayOutputStream |
getDocumentBytes(org.jdom.Document d)
output the DOM to ByteArrayOutputStream |
static String |
getJSON(CellHandle ch)
Get a JSON representation of a cell utilizing a merged range identifier |
static String |
getJSON(CellHandle ch,
int[] mergedRange)
Get a JSON representation of a cell utilizing a merged range identifier |
static String |
getJSON(CellRange cr)
Get a JSON representation of a cellRange |
static String |
getJSON(ImageHandle ih)
Get a JSON representation of an Image |
static String |
getJSON(NameHandle nh)
Get a JSON representation of a NamedRange |
static String |
getJSON(RowHandle rh)
Get a JSON representation of a row |
static org.json.JSONObject |
getJSONObject(CellHandle ch)
Get a JSON representation of a cell utilizing a merged range identifier |
static org.json.JSONObject |
getJSONObject(CellHandle ch,
int[] mergedRange)
Get a JSON Object representation of a cell utilizing a merged range identifier |
static org.json.JSONObject |
getJSONObject(NameHandle rh)
Get a JSON representation of a NamedRange |
static org.json.JSONObject |
getJSONObject(RowHandle rh)
Get a org.JSON object representation of a row |
static org.json.JSONObject |
getJSONObject(RowHandle rh,
int maxcols)
Get a org.JSON object representation of a row, limit number of cols of data |
static File |
getPDF(WorkBook book)
|
static File |
getPDF(WorkBook book,
int height,
int width)
|
static String |
getSheetXML(WorkBook mybook,
String sheetname)
Get the XML for a worksheet |
static String |
getSheetXML(WorkBook mybook,
String sheetname,
int maxrows,
int maxcols)
Get the XML for a worksheet Add the ability to return a maximum number of rows and cols -1 returns all cols/rows |
static String |
getStyleHTML(CellHandle cx)
Get an HTML representation of the Cell Style |
static WorkBook |
getXLS(Object xmlsource)
Convert an XML WorkBook file to BIFF8 (native XLS) WorkBook Input roughly conforms to XMLSS Spec. |
static WorkBook |
getXLS(WorkBookHandle bk,
Object xmlsource)
Convert an XML WorkBook file to BIFF8 (native XLS) WorkBook Input roughly conforms to XMLSS Spec. |
static WorkBook |
getXLS(WorkBook bk,
Object xmlsource)
Convert a WorkBook XML file to BIFF8 (native XLS) WorkBook Input roughly conforms to XMLSS Spec. |
static String |
getXML(WorkBook mybook)
Convert a BIFF8 (native XLS) file to XML one sheet at a time. |
static String |
getXML(WorkBook mybook,
String sheetname)
Convert a BIFF8 (native XLS) file to XML. |
static String |
getXML(WorkBook mybook,
String sheetname,
int maxrows,
int maxcols)
Convert a BIFF8 (native XLS) file to XML. |
static String |
getXMLFragment(WorkBook mybook,
String fragspec)
Retrieves an XML 'fragment' from the Specified WorkBook. |
void |
log(String s)
|
void |
log(String s,
Exception e)
|
void |
log(String s,
Exception e,
boolean b)
|
static void |
main(String[] args)
Command line parameters: -x |
static void |
parseNBind(WorkBook bk,
Object input)
Read in an XML stream and populate a WorkBook using the XML data therein. |
static String |
readInputStream(InputStream in)
read an inputstream into a string |
static void |
setDebugLevel(int DEBUGLEVEL)
|
static void |
transform(OutputStream out,
String xslfile,
WorkBook book,
Map params)
Transform a WorkBook into an output file type by applying an XSLT. |
static org.jdom.Document |
transform(String xslfile,
CellRange cr,
String midi)
Transform a CellRange into an output file type by applying an XSLT. |
static org.jdom.Document |
transform(String xslfile,
NameHandle name)
Transform a NamedRange into an output file type by applying an XSLT. |
static org.jdom.Document |
transform(String xslfile,
NameHandle name,
String midi)
Transform a NamedRange into an output file type by applying an XSLT. |
static org.jdom.Document |
transform(String xslfile,
String input,
Map params)
Transform a String into an output file type by applying an XSLT. |
static org.jdom.Document |
transform(String xslfile,
WorkBook book)
Transform a WorkBook into an output file type by applying an XSLT. |
static org.jdom.Document |
transform(String xslfile,
WorkBook book,
Map params)
Transform a WorkBook into an output file type by applying an XSLT. |
static void |
writeBookToFile(String strFileName,
WorkBook mybook)
Write book to File using Buffered Output Stream |
static void |
writeBytesToFile(String strFileName,
byte[] bbuf)
|
static void |
writeXML(WorkBook mybook,
String sheetname,
OutputStream out)
Convert a BIFF8 (native XLS) file to XML. |
static void |
writeXML(WorkBook mybook,
String sheetname,
OutputStream out,
int maxrows,
int maxcols)
Convert a BIFF8 (native XLS) file to XML. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String XML_HEAD
public static final String JSON_CELL_VALUE
public static final String JSON_CELL_FORMATTED_VALUE
public static final String JSON_CELL_FORMULA
public static final String JSON_CELL
public static final String JSON_CELLS
public static final String JSON_DATETIME
public static final String JSON_DATEVALUE
public static final String JSON_DOUBLE
public static final String JSON_RANGE
public static final String JSON_DATA
public static final String JSON_FLOAT
public static final String JSON_INTEGER
public static final String JSON_LOCATION
public static final String JSON_ROW
public static final String JSON_HEIGHT
public static final String JSON_STRING
public static final String JSON_STYLEID
public static final String JSON_TYPE
public static final String JSON_FORMULA_HIDDEN
public static final String JSON_LOCKED
public static final String JSON_HIDDEN
public static final String JSON_VALIDATION_MESSAGE
public static final String JSON_MERGEACROSS
public static final String JSON_MERGEDOWN
public static final String JSON_MERGEPARENT
public static final String JSON_MERGECHILD
public static final String JSON_HREF
public static final String JSON_WORD_WRAP
public static final String JSON_RED_FORMAT
public static Writer dump_input
public static final int COMMAND_ADDCELL
public static final int COMMAND_ADDSHEET
public static final int COMMAND_ADDROW
public static final int COMMAND_ADDNAME
public static final int COMMAND_ADDCELLDATA
public static final int COMMAND_ADDEXTERNALNAME
public static final int COMMAND_ADDFONT
public static final int COMMAND_ADDBORDERS
public static final int COMMAND_ADDALIGNMENT
public static final int COMMAND_ADDCOLORS
public static final int COMMAND_ADDWINDOWOPTIONS
public static final int COMMAND_ADDCOLUMNS
public static final int COMMAND_ADDNUMBERFORMAT
public static final int COMMAND_ADDCHART
public static final int COMMAND_ADDCHARTSERIES
public static final int COMMAND_AXISOPTIONS
public static final int COMMAND_ADDDATARANGE
public static final int COMMAND_ADDCHARTOPTIONS
public static final int COMMAND_ADDTHREEDREC
public static final int COMMAND_ADDCHARTFONT
public static final int COMMAND_ADDCHARTFONTREC
public static final int COMMAND_ADDIMAGES
public static final int COMMAND_ADDVALIDATION
public static final int COMMAND_ADDVALIDATIONFORMULA1
public static final int COMMAND_ADDVALIDATIONFORMULA2
public static final int COMMAND_ADDPANE
public static final int COMMAND_ADDCONDITIONALFORMAT
public static final int COMMAND_ADDCELLPROTECT
public static int ROW_HEIGHT_DIVISOR
public static int COLSIZE_DIVISOR
| Constructor Detail |
|---|
public ExtenXLS()
| Method Detail |
|---|
public static void main(String[] args)
public static void writeBytesToFile(String strFileName,
byte[] bbuf)
public static void writeBookToFile(String strFileName,
WorkBook mybook)
strFileName - mybook -
public static String getXMLFragment(WorkBook mybook,
String fragspec)
mybook -
public static void addImages(org.xmlpull.v1.XmlPullParser xpp,
com.extentech.formats.XLS.Boundsheet bound)
xpp - the PullParser in the correct location, at ImageHandle.getXMLpublic static String readInputStream(InputStream in)
in -
public static void parseNBind(WorkBook bk,
Object input)
throws org.xmlpull.v1.XmlPullParserException,
IOException
fl -
org.xmlpull.v1.XmlPullParserException
IOException
public static WorkBook getXLS(WorkBook bk,
Object xmlsource)
the - XML inputa - workbook to populate
public static void setDebugLevel(int DEBUGLEVEL)
public static WorkBook getXLS(WorkBookHandle bk,
Object xmlsource)
throws Exception
mybook -
Exceptionpublic static WorkBook getXLS(Object xmlsource)
mybook -
public static File getPDF(WorkBook book)
bout -
public static File getPDF(WorkBook book,
int height,
int width)
bout -
public static String getXML(WorkBook mybook)
mybook - sheetname -
public static String getSheetXML(WorkBook mybook,
String sheetname,
int maxrows,
int maxcols)
mybook - sheetname -
public static String getSheetXML(WorkBook mybook,
String sheetname)
mybook - sheetname -
public static void writeXML(WorkBook mybook,
String sheetname,
OutputStream out)
mybook -
public static void writeXML(WorkBook mybook,
String sheetname,
OutputStream out,
int maxrows,
int maxcols)
mybook - maxrows - = the maximum number of rows to output in a worksheetmaxcols - = the maximum number of cols to output in a worksheet
public static String getXML(WorkBook mybook,
String sheetname,
int maxrows,
int maxcols)
mybook -
public static String getXML(WorkBook mybook,
String sheetname)
mybook -
public static void transform(OutputStream out,
String xslfile,
WorkBook book,
Map params)
throws Exception
xslfile - book - params -
Exception
public static org.jdom.Document transform(String xslfile,
NameHandle name)
throws Exception
xslfile - NamedRange - to be transformed
Exception
public static org.jdom.Document transform(String xslfile,
CellRange cr,
String midi)
throws Exception
xslfile - Cell - Range to be transformedmidi - the meme id of the meme workbook
Exception
public static org.jdom.Document transform(String xslfile,
NameHandle name,
String midi)
throws Exception
xslfile - NamedRange - to be transformedmidi - the meme id of the meme workbook
Exception
public static org.jdom.Document transform(String xslfile,
String input,
Map params)
throws Exception
xslfile - input - string to be transformed
Exception
public static org.jdom.Document transform(String xslfile,
WorkBook book,
Map params)
throws Exception
xslfile - book - params -
Exceptionpublic static String getJSON(ImageHandle ih)
imagehandle -
public static String getJSON(NameHandle nh)
namehandle -
public static org.json.JSONObject getJSONObject(NameHandle rh)
NameHandle -
public static org.json.JSONObject getJSONObject(RowHandle rh,
int maxcols)
cr -
public static org.json.JSONObject getJSONObject(RowHandle rh)
cr -
public static String getJSON(RowHandle rh)
cr -
public static String getJSON(CellRange cr)
cr -
public static String getStyleHTML(CellHandle cx)
cx - the cellhandle to get the style from
public static String getJSON(CellHandle ch)
ch -
public static org.json.JSONObject getJSONObject(CellHandle ch)
ch -
public static String getJSON(CellHandle ch,
int[] mergedRange)
ch -
public static org.json.JSONObject getJSONObject(CellHandle ch,
int[] mergedRange)
ch -
public static org.jdom.Document transform(String xslfile,
WorkBook book)
throws Exception
xslfile - book -
Exception
public static void dumpCSVtoSpreadsheet(File csv,
WorkBook book,
int sheetnum)
throws com.extentech.formats.XLS.WorkSheetNotFoundException
csv -
com.extentech.formats.XLS.WorkSheetNotFoundException
public static void dumpCSVtoSpreadsheet(InputStream csv,
WorkBook book,
int sheetnum)
throws com.extentech.formats.XLS.WorkSheetNotFoundException
csv -
com.extentech.formats.XLS.WorkSheetNotFoundExceptionpublic static ByteArrayOutputStream getDocumentBytes(org.jdom.Document d)
public void log(String s,
Exception e)
log in interface com.extentech.toolkit.LogOutputterpublic void log(String s)
log in interface com.extentech.toolkit.LogOutputter
public void log(String s,
Exception e,
boolean b)
log in interface com.extentech.toolkit.LogOutputter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||