Re: [web2py] Re: create doc files

2013-12-30 Thread Diego Tostes
thanks anthony!! works! but one more thing, is it possible create a rtf template and send parameters to the template? rgsd, Diego 2013/12/30 Anthony > Sorry, a couple mistakes in the code. This should do it: > > def generate_doc(): > from gluon.contrib.pyrtf import * > import cStrin

Re: [web2py] Re: create doc files

2013-12-30 Thread Jonathan Lundell
On 30 Dec 2013, at 7:31 AM, Anthony wrote: > Sorry, a couple mistakes in the code. This should do it: There's a pyrtf example in the book that uses a helper (dumps) and apparently returns a string. I wonder whether the

Re: [web2py] Re: create doc files

2013-12-30 Thread Anthony
Sorry, a couple mistakes in the code. This should do it: def generate_doc(): from gluon.contrib.pyrtf import * import cStringIO doc = Document() ss = doc.StyleSheet section = Section() doc.Sections.append( section ) p = Paragraph( ss.ParagraphStyles.H

Re: [web2py] Re: create doc files

2013-12-30 Thread Cliff Kachinske
What happens if you move doc.Sections.append ( section ) after the line that says section.append( p ) ? On Monday, December 30, 2013 7:52:07 AM UTC-5, Diego Tostes wrote: > > thanks anthony, > > but did not works... the result was a file with no name with "None" > printed at the first page >

Re: [web2py] Re: create doc files

2013-12-30 Thread Diego Tostes
thanks anthony, but did not works... the result was a file with no name with "None" printed at the first page 2013/12/29 Anthony > You are attempting to return a pyrtf.Document object, but instead you must > stream a file or file-like object. You have to render the document to a > file-lik

Re: [web2py] Re: create doc files

2013-12-29 Thread Anthony
You are attempting to return a pyrtf.Document object, but instead you must stream a file or file-like object. You have to render the document to a file-like object and use response.stream(): def generate_doc(): from gluon.contrib.pyrtf import * import cStringIO doc = Documen

Re: [web2py] Re: create doc files

2013-12-29 Thread Manuele Pesenti
Il 28/12/13 22:20, Diego Tostes ha scritto: > here is my code: > > http://pastebin.com/qh5AV8Xh > > but the download don't start when i access this controler. I would try something like this code for the csv file format: http://web2py.com/books/default/chapter/29/10/services#CSV M. -- Resour

Re: [web2py] Re: create doc files

2013-12-28 Thread Diego Tostes
here is my code: http://pastebin.com/qh5AV8Xh but the download don't start when i access this controler. 2013/12/28 Diego Tostes > i am using the pyrtf, but i dont know how create the file and download > without save the file on the server. > > any idea? > > > 2013/12/28 Anthony > >> The

Re: [web2py] Re: create doc files

2013-12-28 Thread Diego Tostes
i am using the pyrtf, but i dont know how create the file and download without save the file on the server. any idea? 2013/12/28 Anthony > There's also python-docx . > > > On Saturday, December 28, 2013 10:35:33 AM UTC-5, Diego Tostes wrote: > >> don

[web2py] Re: create doc files

2013-12-28 Thread Anthony
There's also python-docx . On Saturday, December 28, 2013 10:35:33 AM UTC-5, Diego Tostes wrote: > > done using > PyRTF > > > thanks > > > 2013/12/28 Diego Tostes > > >> Hi, >> >> Is it possible create doc files (word or openoffice) using templates >>

[web2py] Re: create doc files

2013-12-28 Thread Diego Tostes
done using PyRTF thanks 2013/12/28 Diego Tostes > Hi, > > Is it possible create doc files (word or openoffice) using templates > rendering? > > Rgds, > > Diego > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - http