-
-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathdemo12.js
More file actions
39 lines (30 loc) · 1.3 KB
/
Copy pathdemo12.js
File metadata and controls
39 lines (30 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Testing {{Bracket}} detail or Band Detail
"use strict";
const Report = require('../lib/fluentReports' ).Report;
const displayReport = require('./reportDisplayer');
function printreport() {
var data = [{name: 'Elijah', age: 18}, {name: 'Abraham', age: 22}, {name: 'Gavin', age: 28}];
// Create a Report
var rpt = new Report("demo12.pdf", {font: "Arimo"})
.registerFont("Arimo", {normal: __dirname+'/Fonts/Arimo-Regular.ttf', bold: __dirname+'/Fonts/Arimo-Bold.ttf', 'italic': __dirname+'/Fonts/Arimo-Italic.ttf'})
// Add a simple page Header, this can also be a function like the detail and/or footers
.pageHeader( ["Employee Ages"] )
// Add some Data
.data( data )
// Tell it how to print the data
//.detail("My name is {{name}} and age is {{age}} wow double {{brackets}}");
.detail( [['name', 200],['age', 50]]);
/*
.detail( function(Rpt, data) {
Rpt.band( [ {data:"", width: 80},
{data: data.name, width: 200},
{data: data.age, width: 50, underline: true, align: 3} ],
{border:1} );
} ); */
console.time("Rendered");
rpt.render(function(err, name) {
const testing = {images: 1, blocks: ["120,130,300,100"]};
displayReport(err, name, testing);
});
}
printreport();