On 9/21/18 8:27 AM, Richard V. wrote:
On Thursday, January 4, 2018 at 4:20:04 AM UTC-6, Cédric Krier wrote:
You have two options:
- return the PDF file as the result of Report.render.
- put the PDF data in a Binary field (may be a Function field) and
display the field on a Model (ModelSQL or ModelView of a wizard).
I am very interested in doing something very similar, but instead of
downloading a PDF, it is an XML file that is created on the fly with some
invoice information. Can anyone help me with some sample code on how to do
this? I tried Cédric's option #2 using a function field wrapping a binary field
and have the function field's getter method return the XML text, but on the
view, the field is shown as a file-upload widget with a text saying 0.00 bytes
and a button to select the file to be uploaded next to it. It seems that I
can't download the XML file.
If you want to create an XML file you can use the report engine to build
it and show them using the print option of the clients.
This way you don't have to create a wizard to lunch the XML, but just
select the records you want to export as XML.
Hope it helps!
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk
--
You received this message because you are subscribed to the Google Groups
"tryton" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tryton/f867efa9-7752-78e0-bcb6-3dad9ef24e6f%40koolpi.com.