fluentreports
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -14,3 +14,3 @@ var Report = require('../lib/fluentReports' ).Report; | ||
{week: 20, day: "Wednesday", hours: 8}, | ||
{week: 21, day: "Thursday", hours: 2}, | ||
{week: 21, day: "Thursday", hours: -2}, | ||
{week: 21, day: "Friday", hours: 8}, | ||
@@ -71,6 +71,6 @@ | ||
report.band( [ | ||
["", 80], | ||
[data.day, 100], | ||
[data.hours, 100, 3] | ||
], {border:1, width: 0, wrap: 1, fill: '#00ffff', textColor: '#ff0000'} ); | ||
{data: "", width: 80}, | ||
{data: data.day, width: 100}, | ||
{data: data.hours, width: 100, align: 3, textColor: data.hours < 0 ? '#FF0000' : "#000000"} | ||
], {border:1, width: 0, wrap: 1, fill: '#aaaaaa', textColor: '#0000ff'} ); | ||
}; | ||
@@ -77,0 +77,0 @@ |
var Report = require('../lib/fluentReports' ).Report; | ||
var primary_data = [ | ||
{no: 1, date: '08-17-72', name: "John Doe", address_1: "add 1", address_2: "addd_2", city: "city", state: 'ok', zip: '00000', qty: 5, price: 2.21, amount: 5.55, description: "product 1", "product.product_type": 1}, | ||
{no: 1, date: '08-18-72', name: "John Doe", address_1: "add 1", address_2: "addd_2", city: "city", state: 'ok', zip: '00000', qty: 1, price: 2.21, amount: 2.21, description: "product 1", "product.product_type": 1}, | ||
{no: 1, date: '08-19-72', name: "John Doe", address_1: "add 1", address_2: "addd_2", city: "city", state: 'ok', zip: '00000', qty: 15, price: 4.21, amount: 15.55, description: "product 2", "product.product_type": 2}, | ||
{no: 1, date: '08-17-2014', name: "John Doe", address_1: "add 1", address_2: "addd_2", city: "city", state: 'ok', zip: '00000', qty: 5, price: 2.21, amount: 5.55, description: "product 1", "product.product_type": 1}, | ||
{no: 1, date: '08-18-2014', name: "John Doe", address_1: "add 1", address_2: "addd_2", city: "city", state: 'ok', zip: '00000', qty: 1, price: 2.21, amount: 2.21, description: "product 1", "product.product_type": 1}, | ||
{no: 1, date: '08-19-2014', name: "John Doe", address_1: "add 1", address_2: "addd_2", city: "city", state: 'ok', zip: '00000', qty: 15, price: 4.21, amount: 15.55, description: "product 2", "product.product_type": 2}, | ||
]; | ||
function natelog() {}; | ||
function printreport() { | ||
@@ -44,6 +42,5 @@ 'use strict'; | ||
var fSize = 9; | ||
// x.image('ui/img/KellPro_LOGO.jpg', {width: 175}); | ||
x.print('101 South 15th Street, Duncan OK 73533',{x: 0, fontsize: fSize}); | ||
x.print('Some address in Duncan OK 73533',{x: 0, fontsize: fSize}); | ||
x.print('THIS IS NOT AN INVOICE',{x: 40, y: 100 , fontsize: fSize+4, fontBold: true }); | ||
x.print('Questions? Please call 888-535-5776',{x: 40, y: 150 , fontsize: fSize }); | ||
x.print('Questions? Please call us.',{x: 40, y: 150 , fontsize: fSize }); | ||
x.band([{data: 'Proposal #:', width: 100}, {data: r.no, width: 100}], {x: 400, y: 60}); | ||
@@ -70,3 +67,3 @@ //HELP: band() fontsize needs to be case insensitive | ||
x.print('This quote is good for 60 days from the date prepared. Product availability is subject to change without notice. Due to rapid changes in technology, ' + | ||
'and to help us keep our prices competitive, KellPro requests that you appropriate an additional 5-10% of the hardware shown on the proposal to compensate ' + | ||
'and to help us keep our prices competitive, we request that you appropriate an additional 5-10% of the hardware shown on the proposal to compensate ' + | ||
'for possible price fluctuations between the date this proposal was prepared and the date you place your order. Once a proposal has been approved and ' + | ||
@@ -84,11 +81,11 @@ 'hardware ordered, returned goods are subject to a 15% restocking fee.', {x: 40, y: 175, width: 540}); | ||
{data: 'Annual', width: 70, align: 3} | ||
],{x: 20}); | ||
],{x: 0}); | ||
x.bandLine(1); | ||
}; | ||
var proposalFooter = function(x, r){ | ||
var proposalFooter = function(x, r) { | ||
x.fontSize(7.5); | ||
x.print('*If your office accepts this proposal and it contains equipment for purchase through state contract, please contact KellPro for ' + | ||
'state contract ordering information.', {x: 40, width: 570}); | ||
x.print('To place an order for the goods and services provided by Kellpro, please either contact KellPro to place your order or fax a copy ' + | ||
x.print('To place an order for the goods and services provided by us, please either contact us to place your order or fax a copy ' + | ||
'of your PO to ', {x: 40, width: 570});// + company.fax + '.'); | ||
@@ -100,10 +97,2 @@ x.print('Please call us if you have any other questions about how to order. Thank you for your business!', {x: 40, width: 570}); | ||
// var footer = proposalfooter(report, fdata); | ||
//x.line(38, x.getCurrentY(),578 , x.getCurrentY()); | ||
//x.band([{data: totalprop, width: 100, align: 3}],{x: 390, y: x.getCurrentY() + 5 }); | ||
//SUMMIT DISCUSSION: maybe we can get something like this later. | ||
// rx.dfband(data.id, 50) | ||
var report = new Report("demo5.pdf").data(primary_data); | ||
@@ -114,3 +103,3 @@ | ||
.margins(20) | ||
//.pageheader(function(x){x.print('simple page header');}) | ||
.pageheader(function(x){x.print('simple page header');}) | ||
.detail(detail); | ||
@@ -122,7 +111,7 @@ | ||
.header( proposalHeader ) | ||
// .footer( proposalFooter ) | ||
.footer( proposalFooter ) | ||
.groupBy( "product.product_type" ) | ||
.sum( "amount" ) | ||
.header( productTypeHeader ); | ||
// .footer( productTypeFooter ); | ||
.header( productTypeHeader ) | ||
.footer( productTypeFooter ); | ||
@@ -129,0 +118,0 @@ |
@@ -14,4 +14,4 @@ { | ||
"main" : "lib/fluentReports", | ||
"version" : "0.0.3", | ||
"version" : "0.0.4", | ||
"engines" : {"node": ">= 0.6.0" } | ||
} |
@@ -10,7 +10,6 @@ Fluent Reports | ||
``` npm install fluentreports | ||
```npm install fluentreports``` | ||
Features: | ||
@@ -26,3 +25,3 @@ | ||
* Sub-Reports, Sub-Sub-Reports, etc... | ||
* Bands (Tables) & Suppressed Bands (w/ column wrapping or column clipping) | ||
* Bands (Tables/Grids) & Suppressed Bands (w/ column wrapping or column clipping) | ||
* Free Flow Text | ||
@@ -33,11 +32,19 @@ * Ability to override each part of the report for total customization of your report | ||
* Quickly generate complex reports with minimal lines of code. | ||
* Tables/Grid with cell wrapping/truncating | ||
* Colorization (& other cell changes) of text per cell in Bands | ||
See the simple/stupid examples for a overview on how to generate a somewhat complex report. | ||
Both of those reports I tried to throw in a chunk of the kitchen sink to try and give you and | ||
idea how powerful the engine is. I'll try and generate a really simple report in a future commit. | ||
In these reports I tried to throw in a chunk of the kitchen sink to try and give you and | ||
idea how powerful the engine is. | ||
Currently has 5 example reports showing: | ||
* Simple Grid Report with Grouping | ||
* Simple Account Summary Report (w/ color & grid for account balances) | ||
* Simple Fax Cover Sheet (w/ image) | ||
* Grid Report showing off Sub-Reports with auto-queries | ||
* More complex invoice/proposal with grouping, headers, footers. | ||
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 not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
24657955
6410
48