fluentreports
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -66,3 +66,4 @@ var Report = require('../lib/fluentReports' ).Report; | ||
var weekdetail = function ( report, data ) { | ||
report.print( ["Week Number: " + data.week], {x: 100} ); | ||
// We could do this --> report.setCurrentY(report.getCurrentY()+2); Or use the shortcut below of addY: 2 | ||
report.print( ["Week Number: " + data.week], {x: 100, addY: 2} ); | ||
}; | ||
@@ -76,2 +77,4 @@ | ||
// You don't have to pass in a report name; it will default to "report.pdf" | ||
@@ -81,3 +84,3 @@ var reportName = "demo1.pdf"; | ||
var rpt = new Report(reportName) | ||
.autoPrint(false) // Optional | ||
.autoPrint(false) // Optional | ||
.pageHeader( ["Employee Hours"] )// Optional | ||
@@ -93,3 +96,3 @@ .finalSummary( ["Total Hours:", "hours", 3] )// Optional | ||
rpt.groupBy( "name" ) | ||
.sum( "hours" ) | ||
.sum('hours') | ||
.header( nameheader ) | ||
@@ -100,2 +103,5 @@ .footer( namefooter ) | ||
// Debug output is always nice (Optional, to help you see the structure) | ||
@@ -102,0 +108,0 @@ rpt.printStructure(); |
@@ -110,3 +110,4 @@ var Report = require('../lib/fluentReports' ).Report; | ||
ninety_original: 0, | ||
hundredtwenty_original: 0 } ]; | ||
hundredtwenty_original: 0 } | ||
]; | ||
@@ -137,3 +138,3 @@ | ||
for (var i=0;i<msg.length;i++) { | ||
if(msg[i]) { rpt.print(msg[i]); } | ||
if(msg[i]) { rpt.print(msg[i], {textColor: 'blue'}); } | ||
else { rpt.newLine(); } | ||
@@ -183,3 +184,3 @@ } | ||
{data: 'Total Due', width: 60, align: 3} | ||
], {border: 0, width: 0}); | ||
]); | ||
rpt.fontNormal(); | ||
@@ -222,3 +223,3 @@ rpt.bandLine(); | ||
for (var key in data) { | ||
if (key == 'sale.no') continue; | ||
if (key === 'sale.no') { continue; } | ||
if (data.hasOwnProperty(key)) { | ||
@@ -228,4 +229,7 @@ // Simple Stupid Money formatter. It is really dumb. ;-) | ||
var idx = data[key].indexOf('.'); | ||
if (idx < 0) data[key] += '.00'; | ||
else if (idx < data[key].length - 1) data[key] += '0'; | ||
if (idx < 0) { | ||
data[key] += '.00'; | ||
} else if (idx < data[key].length - 1) { | ||
data[key] += '0'; | ||
} | ||
} | ||
@@ -237,2 +241,5 @@ } | ||
// Optional -- If you don't pass a report name, it will default to "report.pdf" | ||
@@ -272,3 +279,3 @@ var rptName = "demo2.pdf"; | ||
console.time("Rendered"); | ||
var a= resultReport.render(function(err, name) { | ||
resultReport.render(function(err, name) { | ||
console.timeEnd("Rendered"); | ||
@@ -275,0 +282,0 @@ if (err) { |
@@ -14,4 +14,4 @@ { | ||
"main" : "lib/fluentReports", | ||
"version" : "0.0.2", | ||
"version" : "0.0.3", | ||
"engines" : {"node": ">= 0.6.0" } | ||
} |
@@ -0,0 +0,0 @@ Fluent Reports |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
24656655
40
6396
1
1
5