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 abasta...@gmail.com
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
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
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(
On 30 Dec 2013, at 7:31 AM, Anthony abasta...@gmail.com wrote:
Sorry, a couple mistakes in the code. This should do it:
There's a pyrtf example in the book
http://web2py.com/books/default/chapter/29/10/services?search=pyrtf#PyRTF
that uses a helper (dumps) and apparently returns a string. I
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 abasta...@gmail.com
Sorry, a couple mistakes in the code. This should do it:
def generate_doc():
from gluon.contrib.pyrtf import *
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.
--
Resources:
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 =
done using
PyRTF
thanks
2013/12/28 Diego Tostes tostes.pyt...@gmail.com
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
There's also python-docx https://github.com/mikemaccana/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 tostes...@gmail.com javascript:
Hi,
Is it possible create doc files (word or openoffice) using
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 abasta...@gmail.com
There's also python-docx https://github.com/mikemaccana/python-docx.
On Saturday, December 28, 2013 10:35:33 AM UTC-5, 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 tostes.pyt...@gmail.com
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
11 matches
Mail list logo