Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Dynamic Watermark based on row data
cambrown28
<p>Hi</p><p> </p><p>Is it possible to add a watermark to a BIRT report if the value of the row "status" is "CAN" but not display the watermark if the value of "status" is anything else.</p><p> </p><p>I have tried this with Master Pages and background images but I cannot work out how to make this dynamic based on data from the report.</p><p> </p><p>I can create a dynamic image (which works) but the problem is where to put it.</p>
Find more posts tagged with
Comments
micajblock
<p>What version of BIRT are you using?</p>
cambrown28
<p>Hi</p><p> </p><p>Sorry, should have mentioned that. It is BIRT 3.7.1</p><p> </p><p>I don't mind how this is done (if it can be), any possible solutions are greatly appreciated.</p><p> </p><p>Cam</p>
micajblock
<p>I am sorry, I thought I could change the image using an expression. That does not seem to be the case. The only workaround that I can think of is to use a background image in the layout itself. If this is a fixed page number report one can put a grid around the content and add the background image to the cell of the grid.</p>
cambrown28
<p>Thanks for the reply. I am still not sure how to make this dynamic based on row data.</p><p> </p><p>I can put a grid around the content and add the background image to the cell of the grid (if I am assuming correctly, this is done via the Advanced properties of the cell) but how do I change that image based on row data?</p><p> </p><p>Cam
</p>
wwilliams
<p>This should help</p><p><a data-ipb='nomediaparse' href='
http://birtworld.blogspot.com/2010/09/birt-image-report-item.html'>http://birtworld.blogspot.com/2010/09/birt-image-report-item.html</a></p>
;
micajblock
<blockquote class="ipsBlockquote" data-author="cambrown28" data-cid="128112" data-time="1400551457"><div><p>Thanks for the reply. I am still not sure how to make this dynamic based on row data.</p><p> </p><p>I can put a grid around the content and add the background image to the cell of the grid (if I am assuming correctly, this is done via the Advanced properties of the cell) but how do I change that image based on row data?</p><p> </p><p>Cam
</p></div></blockquote><p>You add code to the onRender something like this:</p><div><pre class="_prettyXprint">if (this.getRowData().getColumnValue("STATUS") == "CAN") {this.getStyle().backgroundImage = "myimage.png";}else {this.getStyle().backgroundImage = "";}</pre><p>If you do not have access to the row data in the grid use a page or report variable. See attached example using Classic Models.</p></div><p> </p>
cambrown28
<p>Thanks wwilliams and mblock. This has solved my issue. Appreciate the prompt and informative responses.</p><p> </p><p>Sorry for taking a while to respond, other issues here became higher priority for a few days.</p><p> </p><p>Cam</p>