How to Set Watermark Text or Watermark Image in Background of QWEB Report?
In Qweb Report, we can add watermark text or images in background.
we have to take one <div> (HTML tag), <p> or <img> tag with many CSS attributes.
Example: I want to add sale order company logo in sale report as watermark text to the report in orange colour.
Add Following <div> in sale–>view–>report_saleorder.xml–>in <div class=”page”>
In report_saleorder.xml File
<img t-att-src=”‘data:image/png;base64,%s’ % doc.company_id.logo”/>
Company image of sale order will get print in report as watermark. The image will be render using
- You can add css to elements in QWeb reports so you can add images in it.
- You can do anything you’d like with CSS so just host an image somewhere and add an element to your report which you style as you’d like.
Other Example: I want to add order number in sale report as watermark text to the report in orange color.
<div class=”watermark” style=”position:absolute;opacity:0.25;font-size:3em;width:100%;text-align:center;z-index:1000;”>
For any further queries feel free to Contact Us we would be glad to help you.