openerp-community team mailing list archive
-
openerp-community team
-
Mailing list archive
-
Message #04943
Re: report_webkit future
On 02/18/2014 11:53 AM, Niels Huylebroeck wrote:
Nicolas,
I can't see how you can compare wkhtmltopdf and qweb ?
Wouldn't it make more sense to compare jinja2 with qweb ?
Comparing QWeb to Jinja2 is more accurate indeed.
As you probably know, v8 will introduce a reporting engine based on QWeb
templates that is also using wkthmltopdf to produce PDF reports [1]
So you will basically have 2 alternatives to design custom HTML-based reports:
- manual design of Jinja2 templates, with report_webkit
- manual or wysiwyg design of QWeb templates (using the Website Builder)
But both will be available for server-side PDF rendering using wkhtmltopdf
(which has luckily been receiving some love and important features recently)
I can see some benefit in using qweb to generate the underlying html since
it would allow inheritance for report generation (stacking multiple reports
on top of the same base templates) and reducing the number of templating
languages to learn while developing with OpenERP.
Yes, that's one of the points :-)
But in the end if you want to print to pdf you will have to either use
wkhtmltopdf or the browser's own ability to convert html to paginated
format/layout and save or print the output.
Currently though I'm not sure if qweb is used for generating the screen
layout when you do a print (preview) from the browser. Most of the layout
there is defined by the regular model view afaik.
QWeb is the templating engine that renders the HTML output of any page, and it
comes in two flavors:
- When you access the back-end (the regular OpenERP web client since v6.1), the
output is rendered client-side using the Javascript-based QWeb engine,
automatically combining the QWeb templates of the web client widgets
- When you access the front-end (plain web pages such as Website, Blogs,
eCommerce, new in v8), the output is rendered server-side using the
Python-based QWeb engine, by combining the relevant pages and templates
And in both cases when you use the "Print" button of your browser the PDF
result is produced by your browser itself [2], based on the current HTML DOM
combined with specific CSS rules for printing.
Server-side PDFs are only rendered when you call a specific report URL, such as
the new /report/pdf route in Simon's branch [1].
[1]
http://openerp-community.2306076.n4.nabble.com/Openerp-community-tests-feedbacks-for-the-new-reporting-tt4644385.html
[2] Incidentally, if you are using Chrome, the underlying engine is almost the
same as what wkhtmltopdf uses.
Follow ups
References