ReportLab in application modules?

174 views
Skip to first unread message

carlo

unread,
Mar 18, 2009, 1:06:20 PM3/18/09
to web2py Web Framework
Anyone succedeed to get ReportLab modules installed under
applications.myapp.modules (Windows)?

carlo

Timothy Farrell

unread,
Mar 18, 2009, 1:42:41 PM3/18/09
to web...@googlegroups.com
Do you need to bundle reportlab with an app?

Reportlab requires some binary libaries that are not conducive Python's
true cross-platformness. I would say the better way is to just say,
"This app requires Reportlabs 2.x"

-tim
--
Timothy Farrell <tfar...@swgen.com>
Computer Guy
Statewide General Insurance Agency (www.swgen.com)

carlo

unread,
Mar 18, 2009, 2:02:48 PM3/18/09
to web2py Web Framework
thank you Tim.

Would you suggest any other package to get pdf printing more easily
integrated with a web2py app (Pisa??) ? I would like to ship my app
with every necessary module without counting on Python system..

carlo

On 18 Mar, 18:42, Timothy Farrell <tfarr...@swgen.com> wrote:
> Do you need to bundle reportlab with an app?
>
> Reportlab requires some binary libaries that are not conducive Python's
> true cross-platformness.  I would say the better way is to just say,
> "This app requires Reportlabs 2.x"
>
> -tim
>
> carlo wrote:
> > Anyone succedeed to get ReportLab modules installed under
> > applications.myapp.modules (Windows)?
>
> > carlo
>
> --
> Timothy Farrell <tfarr...@swgen.com>

carlo

unread,
Mar 18, 2009, 2:05:38 PM3/18/09
to web2py Web Framework
oops, I see Pisa is based on ReportLab

carlo

mdipierro

unread,
Mar 18, 2009, 2:05:57 PM3/18/09
to web2py Web Framework
If you just unzip reportlab under web2py/ and rezip web2py it works.

reportlab does not need to be installed and only needs the binaries
for image manipulation.

Massimo

Timothy Farrell

unread,
Mar 18, 2009, 2:16:53 PM3/18/09
to web...@googlegroups.com
If it's PDFability you want, Reportlabs, and other libs that build on
top of it, are the only serious options for Python. PyPDF can reorder,
crop, delete, etc. pages, but it cannot generate a page.

According to Massimo, you should only need the binaries if you're
including images in your reports. I use Pisa and I do include images.
But I have Pisa/Reportslabs installed as a normal Python module, not as
wrapped in a single web2py app.

-tim
--
Timothy Farrell <tfar...@swgen.com>

carlo

unread,
Mar 18, 2009, 2:23:19 PM3/18/09
to web2py Web Framework
Are you sure about that?
I put the reportlab folder in myapp.modules but when I try to import a
submodule I get an error.

carlo

mdipierro

unread,
Mar 18, 2009, 3:59:40 PM3/18/09
to web2py Web Framework
When you unzip reportlab there is a lot of junk in there. There is
another subfolder called reportlab where the .py files are. That is
the one you need. If you are using the binary distribution you have to
put it in the zip file Libraries.zip (windows) or site-packages.zip
(mac)

carlo

unread,
Mar 19, 2009, 6:59:00 AM3/19/09
to web2py Web Framework
Yes that is the folder I put in myapp modules (just the "reportlab"
folder): did you try something like

from applications.myapp.modules.reportlab import platypus
or
from applications.myapp.modules.reportlab.platypus import *

I got an error about some non existing submodule (platypus.flowables
for example)

My web2py version is the source version.

carlo

vince

unread,
Mar 21, 2009, 2:38:20 AM3/21/09
to web2py Web Framework
yes just pack the reportlab directory into library.zip and import like
this

from reportlab.lib.pagesizes import letter, A4

-vince

pradeep cs

unread,
Sep 29, 2012, 3:37:41 AM9/29/12
to web...@googlegroups.com
Hi,


I am new to web2py, i did go through this Blog and it was difficult for me to follow.

Finally below is the procedure and my help others in future.

I am using windows version of web2py (2.0.8)

I downloaded reportlab-2.1.5.zip from reportlab site.

After that i unzipped into a temporary folder, A new folder by name reportlab-2.1.5 along with sub folders are created.

copy reportlab folder from reportlab-2.1.5/src on to web2py folder...

this worked for me..

regards
pradeep
Reply all
Reply to author
Forward
0 new messages