reportingodoo-10qweb

Print report on print button in odoo10


Hi I am having a problem in printing the report. I have coded the report format in html and then made its module and attached it with the relevant model. and upload it on my online server

First I was receiving this error : Wkhtmltopdf failed (error code: -6). Message: The switch --header-spacing, is not support using unpatched qt, and will be ignored.The switch --header-html, is not support using unpatched qt, and will be ignored.The switch --footer-html, is not support using unpatched qt, and will be ignored.QXcbConnection: Could not connect to display

I have solved this problem using this following link https://gist.github.com/tejastank/45b6eba13fb38e24110218e3ce50129b

Its still not printing but keeps on creating child of the report in rec_name area, please see the attachment enter image description here and showing this error on the side

enter image description here

Questions:

1).How I can print the report directly from the print button without getting these errors.

One of our client give us access of there ERP for some changes, I have seen there reports when we click on print button on there ERP it downloads the PDF version pf the report and then we print it. so

2). How can we download the report in PDF formate.

I am using odoo10 not odoo8. Thanks in advance


Solution

  • Try this Solution :

    Downlaod this -https://downloads.wkhtmltopdf.org/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb

    and then follow the step : (IF THE ABOUT WKHTMLTOPDF IS NOT INSTALL THAN AND THAN 1ST STEP HAVE TO DO IT) 1) sudo dpkg -i http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb

    2) sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin 3) sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin

    may be it will help you.