-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated appreport module, Changed de helper REPORT and Included a exa…
…mple to create complex reports, rendering a web2py views
- Loading branch information
Lucas
committed
Jan 27, 2011
1 parent
72f0fbd
commit c6ed5dc
Showing
647 changed files
with
194,969 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,6 +176,10 @@ Library. | |
# Licenses for third party contributed software | ||
|
||
plugin appreport contains third party software under the libs folder. | ||
Each file/module in libs is distributed with <programa> under its original license. | ||
Each file/module in libs is distributed with plugin appreport under its original license. | ||
|
||
#pyfpdf - Copyright (C) 2010 Mariano Reingart <[email protected]> - licensed of LGPL v3 | ||
#pyfpdf - Copyright (C) 2010 Mariano Reingart <[email protected]> - licensed under LGPL v3 | ||
#Pisa - Copyright (C) 2010 Dirk Holtwick, <holtwick.it> licenced under Apache License Version 2.0, January 2004 | ||
#pyPdf - Copyright (c) 2006, Mathieu Fenniak | ||
Copyright (c) 2007, Ashish Kulkarni <[email protected]> | ||
#reportlab - Copyright (c) 2000-2010, ReportLab Inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
plugin appreport, is an implementation of the module appreport, for the framework web2py, through the helpers, is possible generate PDF reports and html forms for emission of the reports, based only on the definition of the table data model. | ||
Plugin appreport, is an implementation of the module appreport, for the framework web2py, using helpers is possible generate PDF reports and forms html for emission of the reports. | ||
|
||
- The form is generated based on table fields. | ||
- The report can be generated based on the fields of the table or rendered by html code, | ||
|
||
created by Lucas D'Avila - email <[email protected]> / twitter @lucadavila | ||
|
||
################################ | ||
CHANGE LOG | ||
|
||
0.0.? | ||
-? | ||
0.0.2 | ||
- Updated appreport module, because was included a new engine (called Pisa) to build the PDF documents, for more information visit: http://www.xhtml2pdf.com/ | ||
- Changed de helper REPORT to set default Pisa as engine to build PDF documents. | ||
- Included a example to create complex reports, rendering a web2py views in PDF document, using the appreport plugin. | ||
|
Binary file not shown.
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,23 +3,47 @@ | |
def create(): | ||
|
||
form = crud.create(person) | ||
persons = crud.select(person, person.id > 0) | ||
form_favs = crud.create(favorite_music) | ||
persons = db().select(db.person.ALL, db.favorite_music.ALL, left=favorite_music.on(person.id == favorite_music.person)) | ||
|
||
return dict(form = form, persons = persons) | ||
return dict(form = form, form_favs = form_favs, persons = persons) | ||
|
||
def report(): | ||
|
||
form = plugin_appreport.REPORTFORM(person) | ||
def simple_report(): | ||
|
||
form = plugin_appreport.REPORTFORM(table=person) | ||
|
||
if form.accepts(request.vars, session): | ||
return plugin_appreport.REPORT(table = person, title = 'List of persons', filter = dict(form.vars)) | ||
|
||
return dict(form = form) | ||
|
||
def report_persons(): | ||
|
||
return dict(persons = db(person.id > 0).select()) | ||
|
||
|
||
def complex_report(): | ||
|
||
form = plugin_appreport.REPORTFORM(table=person) | ||
|
||
if form.accepts(request.vars, session): | ||
persons = db(form.prep_filter(filter = dict(form.vars))).select() | ||
html = response.render('person/report_persons.html', dict(persons = persons)) | ||
return plugin_appreport.REPORT(html = html) | ||
|
||
return dict(form = form) | ||
|
||
|
||
|
||
def custom_report(): | ||
|
||
html = """<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
</head> | ||
<body> | ||
<h2>Report of persons</h2> | ||
<table> | ||
<thead> | ||
<tr> | ||
|
@@ -30,7 +54,7 @@ def custom_report(): | |
</thead> | ||
<tbody> | ||
<tr> | ||
<td>Lucas Davila</td> | ||
<td>Lucas D'Avila</td> | ||
<td>[email protected]</td> | ||
<td>@lucadavila</td> | ||
</tr> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# coding: utf8 | ||
|
||
def create(): | ||
form = crud.create(person) | ||
persons = crud.select(person, person.id > 0) | ||
return dict(form = form, persons = persons) | ||
|
||
def report(): | ||
form = plugin_appreport.REPORTFORM(person) | ||
|
||
if form.accepts(request.vars, session): | ||
return plugin_appreport.REPORT(table = pessoa, title = 'List of persons', filter = dict(form.vars)) | ||
|
||
return dict(form = form) | ||
|
||
def custom_report(): | ||
|
||
html = """<html> | ||
<body> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Author</th> | ||
<th>Name</th> | ||
<th>Phone</th> | ||
<th>Email</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>15</td> | ||
<td>lucas davila</td> | ||
<td>123455</td> | ||
<td>[email protected]</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</body> | ||
</html> | ||
""" | ||
return plugin_appreport.REPORT(html = html, title = 'my custom report') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# coding: utf8 | ||
|
||
def create(): | ||
|
||
form = crud.create(person) | ||
form_favs = crud.create(favorite_music) | ||
persons = db().select(db.person.ALL, db.favorite_music.ALL, left=favorite_music.on(person.id == favorite_music.person)) | ||
|
||
return dict(form = form, form_favs = form_favs, persons = persons) | ||
|
||
|
||
def simple_report(): | ||
|
||
form = plugin_appreport.REPORTFORM(table=person) | ||
|
||
if form.accepts(request.vars, session): | ||
return plugin_appreport.REPORT(table = person, title = 'List of persons', filter = dict(form.vars)) | ||
|
||
return dict(form = form) | ||
|
||
def report_persons(): | ||
|
||
return dict(persons = db(person.id > 0).select()) | ||
|
||
|
||
def complex_report(): | ||
|
||
form = plugin_appreport.REPORTFORM(table=person) | ||
|
||
if form.accepts(request.vars, session): | ||
persons = db(form.prep_filter(filter = dict(form.vars))).select() | ||
html = response.render('person/report_persons.html', dict(persons = persons)) | ||
return plugin_appreport.REPORT(html = html, title = 'List of persons') | ||
|
||
return dict(form = form) | ||
|
||
|
||
|
||
def custom_report(): | ||
|
||
html = """<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
</head> | ||
<body> | ||
<h2>Report of persons</h2> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Author</th> | ||
<th>Email</th> | ||
<th>Twitter</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>Lucas D'Avila</td> | ||
<td>[email protected]</td> | ||
<td>@lucadavila</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</body> | ||
</html> | ||
""" | ||
return plugin_appreport.REPORT(html = html, title = 'my custom report using the plugin appreport') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* |
26 changes: 26 additions & 0 deletions
26
databases/c8b669d15150d7109e5f7ab36744a5b7_auth_event.table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
(dp1 | ||
S'origin' | ||
p2 | ||
S'CHAR(512)' | ||
p3 | ||
sS'client_ip' | ||
p4 | ||
S'CHAR(512)' | ||
p5 | ||
sS'user_id' | ||
p6 | ||
S'INTEGER REFERENCES auth_user(id) ON DELETE CASCADE' | ||
p7 | ||
sS'description' | ||
p8 | ||
S'TEXT' | ||
p9 | ||
sS'time_stamp' | ||
p10 | ||
S'TIMESTAMP' | ||
p11 | ||
sS'id' | ||
p12 | ||
S'INTEGER PRIMARY KEY AUTOINCREMENT' | ||
p13 | ||
s. |
14 changes: 14 additions & 0 deletions
14
databases/c8b669d15150d7109e5f7ab36744a5b7_auth_group.table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(dp1 | ||
S'role' | ||
p2 | ||
S'CHAR(512)' | ||
p3 | ||
sS'id' | ||
p4 | ||
S'INTEGER PRIMARY KEY AUTOINCREMENT' | ||
p5 | ||
sS'description' | ||
p6 | ||
S'TEXT' | ||
p7 | ||
s. |
14 changes: 14 additions & 0 deletions
14
databases/c8b669d15150d7109e5f7ab36744a5b7_auth_membership.table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(dp1 | ||
S'group_id' | ||
p2 | ||
S'INTEGER REFERENCES auth_group(id) ON DELETE CASCADE' | ||
p3 | ||
sS'user_id' | ||
p4 | ||
S'INTEGER REFERENCES auth_user(id) ON DELETE CASCADE' | ||
p5 | ||
sS'id' | ||
p6 | ||
S'INTEGER PRIMARY KEY AUTOINCREMENT' | ||
p7 | ||
s. |
22 changes: 22 additions & 0 deletions
22
databases/c8b669d15150d7109e5f7ab36744a5b7_auth_permission.table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
(dp1 | ||
S'record_id' | ||
p2 | ||
S'INTEGER' | ||
p3 | ||
sS'group_id' | ||
p4 | ||
S'INTEGER REFERENCES auth_group(id) ON DELETE CASCADE' | ||
p5 | ||
sS'table_name' | ||
p6 | ||
S'CHAR(512)' | ||
p7 | ||
sS'id' | ||
p8 | ||
S'INTEGER PRIMARY KEY AUTOINCREMENT' | ||
p9 | ||
sS'name' | ||
p10 | ||
S'CHAR(512)' | ||
p11 | ||
s. |
30 changes: 30 additions & 0 deletions
30
databases/c8b669d15150d7109e5f7ab36744a5b7_auth_user.table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
(dp1 | ||
S'first_name' | ||
p2 | ||
S'CHAR(128)' | ||
p3 | ||
sS'last_name' | ||
p4 | ||
S'CHAR(128)' | ||
p5 | ||
sS'email' | ||
p6 | ||
S'CHAR(512)' | ||
p7 | ||
sS'reset_password_key' | ||
p8 | ||
S'CHAR(512)' | ||
p9 | ||
sS'password' | ||
p10 | ||
S'CHAR(512)' | ||
p11 | ||
sS'registration_key' | ||
p12 | ||
S'CHAR(512)' | ||
p13 | ||
sS'id' | ||
p14 | ||
S'INTEGER PRIMARY KEY AUTOINCREMENT' | ||
p15 | ||
s. |
18 changes: 18 additions & 0 deletions
18
databases/c8b669d15150d7109e5f7ab36744a5b7_favorite_music.table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(dp1 | ||
S'person' | ||
p2 | ||
S'INTEGER REFERENCES person(id) ON DELETE CASCADE' | ||
p3 | ||
sS'artist' | ||
p4 | ||
S'CHAR(512)' | ||
p5 | ||
sS'id' | ||
p6 | ||
S'INTEGER PRIMARY KEY AUTOINCREMENT' | ||
p7 | ||
sS'title' | ||
p8 | ||
S'CHAR(512)' | ||
p9 | ||
s. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(dp1 | ||
S'phone' | ||
p2 | ||
S'CHAR(512)' | ||
p3 | ||
sS'email' | ||
p4 | ||
S'CHAR(512)' | ||
p5 | ||
sS'id' | ||
p6 | ||
S'INTEGER PRIMARY KEY AUTOINCREMENT' | ||
p7 | ||
sS'name' | ||
p8 | ||
S'CHAR(512)' | ||
p9 | ||
s. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(dp1 | ||
S'id' | ||
p2 | ||
S'INTEGER PRIMARY KEY AUTOINCREMENT' | ||
p3 | ||
sS'telefone' | ||
p4 | ||
S'CHAR(512)' | ||
p5 | ||
sS'nome' | ||
p6 | ||
S'CHAR(512)' | ||
p7 | ||
s. |
Oops, something went wrong.