See: Description
| Class | Description |
|---|---|
| ExcelBorder |
Excel border.
|
| ExcelCell |
Cell tag for use with Microsoft's Office 2003 SpreadsheetML.
|
| ExcelColumn |
Excel table column.
|
| ExcelComment |
Comment tag for use with Microsoft's Office 2003 SpreadsheetML.
|
| ExcelData |
Data tag for use with Microsoft's Office 2003 SpreadsheetML.
|
| ExcelDoc |
An Office 2003 xlsx Excel document.
|
| ExcelFont | |
| ExcelNumberFormat |
Excel number format.
|
| ExcelRow |
Excel row.
|
| ExcelStyle |
Excel style.
|
| ExcelTable |
Excel table.
|
| ExcelWorkbook |
Excel workbook.
|
| ExcelWorksheet |
MSOffice 2003 Excel worksheet.
|
| ExcelWorksheetOptions |
Excel worksheet options.
|
| SpreadsheetML |
XML Names for use with Microsoft's Office 2003 SpreadsheetML.
|
| Enum | Description |
|---|---|
| ExcelBorderPosition |
Excel border position.
|
| ExcelDataType |
Excel data type.
|
| ExcelHorizontalAlign | |
| ExcelLineStyle |
Excel line styles.
|
| ExcelVerticalAlign | |
| ExcelWorksheet.Pane |
| Exception | Description |
|---|---|
| ExcelFormatException |
Exception in creating an Excel worksheet.
|
Simple example:
ExcelDoc doc = new ExcelDoc();
ExcelWorkbook workbook = new ExcelWorkbook();
doc.setRootNode(workbook);
// Define some styles and add them to the workbook
ExcelStyle style = new ExcelStyle("sHeader");
style.addFont().setColor(HTMLColor.BLUE).setBold();
style.setBackgroundColor(HTMLColor.GREEN);
style.addBorder().setPosition(ExcelBorderPosition.Bottom).setLineStyle(ExcelLineStyle.Continuous).setWeight(2);
style.setHorizontalAlignment(ExcelHorizontalAlign.Center);
style.setVerticalAlignment(ExcelVerticalAlign.Bottom);
style.setTextRotation(90);
workbook.addStyle(style);
ExcelStyle col1Style = new ExcelStyle("col1Style");
col1Style.setHorizontalAlignment(ExcelHorizontalAlign.Center);
workbook.addStyle(col1Style);
ExcelStyle col2Style = new ExcelStyle("col2Style");
col2Style.setHorizontalAlignment(ExcelHorizontalAlign.Right);
col2Style.setNumberFormat(ExcelNumberFormat.Scientific);
workbook.addStyle(col2Style);
// Create a new sheet
ExcelWorksheet sheet = workbook.addWorksheet("Sheet1");
ExcelTable table = sheet.addTable().setExpandedColumnCount(2);
table.addColumn().setStyleId("col1Style").setWidth(100);
table.addColumn().setWidth(200);
ExcelRow row = table.addRow();
// Add a row with colum names
row.addCell().setStyleId("sHeader").setData("Column 1");
row.addCell().setStyleId("sHeader").setData("Column 2");
// Add a row of data
row = table.addRow();
row.addCell().setStyleId("col1Style").setData(1);
row.addCell().setStyleId("col2Style").setData(2.03444);
FileUtil.write(new File("xml_test.xml"), doc.toIndentedXML(0, 3));
jataylor@hairyfatguy.com