Re: [Zope] Reportlab and Zope

2000-07-06 Thread Dieter Maurer

Jorge Magalhaes writes:
 >  How i can insert the contents of the Local File System in to HTML environment?
The easiest way, probably, is Jonothan Farr's LocalFS product.



Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Reportlab and Zope

2000-07-06 Thread Jorge Magalhaes


Hi:

In this post i report my experience with Reportlab in Zope:

1.
 Install the Reportlab package in /usr/local/Zope/lib/python1.5 directory

2.
in the Zope directory i create a sub folder ./pdffiles

and:

> cd /usr/local/Zope/pdffiles
> su
> chmod 777

3.
 in the Extensions folder i create

###
#mymodule.py
###
import string
from reportlab.pdfgen.canvas import Canvas
from reportlab.lib.pagesizes import A3, landscape 
from reportlab.pdfgen.textobject import PDFTextObject
from types import *

def helloworld():
c = Canvas("./pdffiles/helloworld.pdf", pagesize=landscape(A3), bottomup=0)
c.setFont("Times-Roman", 12.0, leading=10.0)
c.drawString(100,100, "Hello World")
c.showPage()
c.save()


4.
In Zope:

External module:
ID: HelloW
function: helloworld
module: mymodule

Local File System
ID: Hello
patch: /usr/local/Zope/pdffiles

DTML Method:
ID: HelloWorld



 See the pdf file 
...

My question is:

How i can insert the contents of the Local File System in to HTML environment?


Have a nice day

Jorge


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Reportlab and Zope

2000-07-05 Thread Jorge Magalhaes


 
 Hi:
 
 I try to use Reportlab lib's with my zope. 
 
 In my DTML method i call the python file (External Method) with:
 
 
 
 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
 
 


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )