[Zope] Reportlab and Zope
Jorge Magalhaes
jmagalhaes@eng.uminho.pt
Wed, 05 Jul 2000 19:12:30 +0100 (WET)
Hi:
I try to use Reportlab lib's with my zope.
In my DTML method i call the python file (External Method) with:
<dtml-call "makereport">
All run OK, but i don't find the *pdf file.
Where is my pdf file?
##########################3
# makereport.py
##########################3
import string
from reportlab.pdfgen.canvas import Canvas
from reportlab.lib.pagesizes import A3, landscape
from reportlab.pdfgen.textobject import PDFTextObject
from types import *
import MySQL
x=y=100
turmaa = 'Michael'
DBH = MySQL.connect("localhost","aa","bb")
DBH.selectdb("school")
query= ("select score from exam where name= %s") % repr(turmaa)
STH1= DBH.query(query)
Scores= STH1.fetchrows(-1)
c = Canvas("score.pdf", pagesize=landscape(A3), bottomup=0)
c.setFont("Times-Bold", 12.0, leading=10.0)
for scor in range(len(Scores)):
c.drawString(x, y, Scores[scor][0])
y = y + 15
c.showPage()
c.save()
DBH.close()
thanks in advance
have a nice day
Jorge