Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread Paulo Almeida
Cool, you're all set then. Documentation on Platypus should help you do what you want. I know it can do tables flow between pages, repeating the header in the beginning of each page if desired, and I'm sure there are ways of creating headers and footers, although I have never tried them. Best, Pau

Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread Sven Richter
Shame on me. The problem was that i mixed SimpleDocTemplate (which the examples were based on), with BaseDocTemplate, which i used. And BaseDocTemplate needs an extra PageTemplate defined. So this code basically works: def generate_pdf(request): response = HttpResponse(mimetype='application/pd

Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread Sven Richter
Hm, what makes me wonder is this one: IndexError at /office/job//admin/job/offer/generate/pdf/ This is a url that is not accessible, cause it does not exist, at least i never defined it in any urls.py. Maybe thats the problem? Django tries to access a url which doesnt exist? Greetings Sven On Tu

Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread Sven Richter
On Tue, Mar 30, 2010 at 9:08 PM, Paulo Almeida wrote: > Ok, that is not easy to debug with so little information. Is the IndexError > in views.py? Maybe there is a mistake in urls.py, caused by adding the url > for the generate_pdf view? Hm, its indeed hard. I really dont know what that Error wil

Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread Paulo Almeida
Ok, that is not easy to debug with so little information. Is the IndexError in views.py? Maybe there is a mistake in urls.py, caused by adding the url for the generate_pdf view? - Paulo On Tue, Mar 30, 2010 at 7:57 PM, Sven Richter wrote: > On Tue, Mar 30, 2010 at 8:21 PM, palmeida > wrote: > >

Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread Sven Richter
On Tue, Mar 30, 2010 at 8:21 PM, palmeida wrote: > Is that all your code? I don't see a line like this (from my > generate_pdf function): > > doc = SimpleDocTemplate(response, pagesize=A4) I missed that one out of my example. You're right. But it doesnt generate a pdf like that, it just complains

Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread palmeida
Is that all your code? I don't see a line like this (from my generate_pdf function): doc = SimpleDocTemplate(response, pagesize=A4) That's what links the 'response' variable to the output of the doc.build function. But I don't think that should be what's causing the IndexError, because you don't

Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread HARRY POTTRER
On Mar 30, 12:08 pm, Sven Richter wrote: > > So if somebody could provide some working code, or a hint to > repository or an application with some working code, i'd really > appreciate that. > > Greetings > Sven You can look through my code: http://github.com/nbv4/flightloggin/blob/master/pdf/pd

Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread Sven Richter
Great, thank you very much, this got me started. However, its not working yet. This is the code i have right now: def generate_pdf(request): response = HttpResponse(mimetype='application/pdf') response['Content-Disposition'] = 'attachment; filename=somefilename.pdf' styles = getSampleS

Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread Paulo Almeida
I'm using Platypus (part of reportlab) to generate pdfs without micromanagement of Canvas elements. reportlab's documentation was very helpful to learn how to work with Paragraph, Table, Image, etc. Some code: # views.py @login_required def view_pdf(request, experiment_id): experiment = get_ob

django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread Sven Richter
Hi everybody, i am looking for a way to get BaseDocTemplate from the reportlab library working, connected with a httpresponse. I found the documentation for a simple reportlab page, using canvas. But to me it seems, that i need more options than basic Canvas offers. Like a page header or footer, t