Skip to content

Commit

Permalink
Bugfix for Excel Generator
Browse files Browse the repository at this point in the history
The old Version didn't work in Japanese (Multibyte Languages)
  • Loading branch information
ishimoto committed Jul 13, 2012
1 parent af18141 commit e15557a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Frameworks/Excel/ExcelGenerator/Sources/er/excel/EGWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ public class EGWrapper extends ERXNonSynchronizingComponent {
*/
private static final long serialVersionUID = 1L;

/** logging support */
private static final Logger log = Logger.getLogger(EGWrapper.class);
/** logging support */
private static final Logger log = Logger.getLogger(EGWrapper.class);

private String _fileName;
private NSDictionary _styles;
private NSDictionary _fonts;
private NSDictionary _fonts;

/**
* Public constructor
Expand Down Expand Up @@ -79,7 +80,7 @@ public void setFonts(NSDictionary value) {
_fonts = value;
}


@Override
public void appendToResponse(WOResponse response, WOContext context) {
if (isEnabled()) {
WOResponse newResponse = new WOResponse();
Expand Down Expand Up @@ -112,11 +113,15 @@ public void appendToResponse(WOResponse response, WOContext context) {
}
response.appendContentString(contentString);
} else {
response.appendContentData(data);
String fileName = fileName();
if(fileName == null) {
fileName = "results.xls";
}

response.disableClientCaching();
response.appendHeader(String.valueOf( data.length()), "Content-Length" );
response.setContent(data); // Changed by ishimoto because it was sooooo buggy and didn't work in Japanese

response.setHeader("inline; filename=\"" + fileName + "\"", "content-disposition");
response.setHeader("application/vnd.ms-excel", "content-type");
}
Expand Down

0 comments on commit e15557a

Please sign in to comment.