On Friday, July 20, 2018 at 3:55:06 PM UTC+5, Cédric Krier wrote:
> On 2018-07-20 03:30, Khurram Shahzad wrote:
> > On Wednesday, July 18, 2018 at 8:30:06 PM UTC+5, Cédric Krier wrote:
> > > On 2018-07-18 13:07, Khurram Shahzad wrote:
> > > > If not possible (or very difficult), can I render the PDF file as a
> > > > report.
> > > > I am able to call a an HTTP Service to get the generated PDF file (as
> > > > stream) but can not show it as a report from Report Menu.
> > >
> > > You can override the method 'render' of your Report class. It must
> > > return the bytes of file that you have generated.
> > >
> > Thank you so much. I was able to successfully display the PDF file received
> > from a network service using Report menu. However, I had to add MIMETYPE
> > for PDF in report.py ('pdf': 'application/pdf'). Otherwise, it throws an
> > Exception in the convert method being 'No Such file ..'.
>
> Indeed if you do not need to convert, you should also override 'convert'
> method to return (output_format, data) directly.
> It is better than modify MIMETYPES because it has other usage.
>
True! That's the right way!
--
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/4d32c564-7db5-422e-8baa-336d7b7077d8%40googlegroups.com.