Skip to content

Commit

Permalink
fix in_memory_json agmoyano#6
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Upir authored and Konstantin Upir committed Oct 9, 2015
1 parent a6f03ea commit 04b1cfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,14 @@ jasper.prototype.export = function(report, type) {

var processConn = function(conn, item) {
if(conn == 'in_memory_json') {
var jsonString = JSON.stringify(item.dataset);
var jsonString = JSON.stringify(item.dataset);

var byteArray = java.newArray('byte', jsonString.split('').map(function(c, i) {
return java.newByte(jsonString.charCodeAt(i));
}));
var byteArray = [];
var buffer = Buffer(jsonString);
for (var i = 0; i < buffer.length; i++) {
byteArray.push(buffer[i]);
}
byteArray = java.newArray('byte', byteArray);

return new self.jrjsonef(new self.jbais(byteArray));
}else if(typeof conn == 'string') {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-jasper",
"version": "0.1.0",
"version": "0.1.1",
"description": "JasperReports within Node.js",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 04b1cfe

Please sign in to comment.