-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #792 from desertsky/ExcelGenerator_XlsxEnhancements
Updated POI to 3.14 to support XLSX file generation
- Loading branch information
Showing
14 changed files
with
136 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Frameworks/Excel/ExcelGenerator/Components/EGXLSXWrapper.wo/EGXLSXWrapper.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<span> | ||
<webobject name = "ComponentContent"></webobject></span> |
1 change: 1 addition & 0 deletions
1
Frameworks/Excel/ExcelGenerator/Components/EGXLSXWrapper.wo/EGXLSXWrapper.wod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ComponentContent : WOComponentContent { } |
4 changes: 4 additions & 0 deletions
4
Frameworks/Excel/ExcelGenerator/Components/EGXLSXWrapper.wo/EGXLSXWrapper.woo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"WebObjects Release" = "WebObjects 5.0"; | ||
encoding = "UTF-8"; | ||
} |
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+29.8 KB
Frameworks/Excel/ExcelGenerator/Libraries/poi-excelant-3.14-20160307.jar
Binary file not shown.
Binary file added
BIN
+1.23 MB
Frameworks/Excel/ExcelGenerator/Libraries/poi-ooxml-3.14-20160307.jar
Binary file not shown.
Binary file added
BIN
+5.65 MB
Frameworks/Excel/ExcelGenerator/Libraries/poi-ooxml-schemas-3.14-20160307.jar
Binary file not shown.
Binary file added
BIN
+1.26 MB
Frameworks/Excel/ExcelGenerator/Libraries/poi-scratchpad-3.14-20160307.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
Frameworks/Excel/ExcelGenerator/Sources/er/excel/EGXLSXSimpleTableParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package er.excel; | ||
|
||
import java.io.InputStream; | ||
|
||
import org.apache.poi.ss.usermodel.RichTextString; | ||
import org.apache.poi.ss.usermodel.Workbook; | ||
import org.apache.poi.xssf.usermodel.XSSFRichTextString; | ||
import org.apache.poi.xssf.usermodel.XSSFWorkbook; | ||
|
||
import com.webobjects.foundation.NSDictionary; | ||
|
||
/** | ||
* Instances of EGXLSXSimpleTableParser are used to generate Excel spreadsheets | ||
* in XLSX format. | ||
* | ||
* @author Michael Hast on Jun 6, 2016 | ||
*/ | ||
public class EGXLSXSimpleTableParser extends EGSimpleTableParser { | ||
|
||
// private static final Logger log = LoggerFactory.getLogger(EGXLSXSimpleTableParser.class); | ||
// | ||
// private InputStream _contentStream; | ||
// private XSSFWorkbook _workbook; | ||
// private NSMutableDictionary<String, NSDictionary<String, String>> _fontDicts; | ||
// private NSMutableDictionary<String, NSDictionary<String, String>> _styleDicts; | ||
// private NSMutableDictionary<String, XSSFFont> _fonts = new NSMutableDictionary<String, XSSFFont>(); | ||
// private NSMutableDictionary<NSDictionary<String, ?>, XSSFCellStyle> _styles = new NSMutableDictionary<NSDictionary<String, ?>, XSSFCellStyle>(); | ||
// | ||
public EGXLSXSimpleTableParser(InputStream contentStream) { | ||
this(contentStream, null, null); | ||
} | ||
|
||
public EGXLSXSimpleTableParser(InputStream contentStream, NSDictionary<String, NSDictionary<String, String>> fontDicts, NSDictionary<String, NSDictionary<String, String>> styleDicts) { | ||
super(contentStream, fontDicts, styleDicts); | ||
} | ||
// | ||
// EGSimpleTableParser API | ||
// | ||
@Override | ||
protected Workbook createWorkbook() { | ||
return new XSSFWorkbook(); | ||
} | ||
|
||
@Override | ||
protected RichTextString createRichTextString(Object value) { | ||
return new XSSFRichTextString(value != null ? value.toString() : null); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
Frameworks/Excel/ExcelGenerator/Sources/er/excel/EGXLSXWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package er.excel; | ||
|
||
import java.io.InputStream; | ||
|
||
import com.webobjects.appserver.WOContext; | ||
|
||
/** | ||
* Class for XLSX Excel Component EGXLSXWrapper. | ||
* | ||
* @binding sample sample binding explanation | ||
* | ||
* @author Michael Hast on Jun 6, 2016 9:22:46 AM | ||
*/ | ||
public class EGXLSXWrapper extends EGWrapper { | ||
|
||
public EGXLSXWrapper(WOContext context) { | ||
super(context); | ||
} | ||
// | ||
// EGWrapper API | ||
// | ||
@Override | ||
protected String defaultFilename() { | ||
return "results.xlsx"; | ||
} | ||
|
||
@Override | ||
protected String contentType() { | ||
return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; | ||
} | ||
|
||
@Override | ||
protected EGSimpleTableParser parser(InputStream stream) { | ||
return new EGXLSXSimpleTableParser(stream, fonts(), styles()); | ||
} | ||
} |