Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Placing an Image in the report design Using a Servlet or a Java Class or a JSP
Channamari
<p>Hi,</p>
<p> </p>
<p>I wanted to know if it is possible to place an image in the report design through my Java classes/Servlets/JSP at runtime.? The problem is i have designed a whole lot of reports and i have not included the logo of my client on the reports.. So, i kindly request to give me a solution for this at the earliest.. I read somewhere that i can use IRunAndRenderTask.java class to do this but i'm not able to proceed any further with that information alone.. It is a bit urgent.. Please reply asap.. Thanks in advance..</p>
<p> </p>
<p>Thanks</p>
<p>Channamari</p>
Find more posts tagged with
Comments
Channamari
<p> I figured out to do it this way..</p>
<p> </p>
<p> ReportDesignHandle reportDesignHandle = (ReportDesignHandle)design.getDesignHandle();<br>
ElementFactory efactory = reportDesignHandle.getElementFactory( );<br>
GridHandle grid = (GridHandle)reportDesignHandle.findElement("Top");<br>
grid = efactory.newGridItem( "Top", 2 , 1 );<br>
grid.setWidth( "100%" );<br>
reportDesignHandle.getBody( ).add(grid,0);<br>
RowHandle row = (RowHandle) grid.getRows( ).get( 0 );<br>
ImageHandle image = efactory.newImage( "Clent" ); <br>
image.setFile( "\"C:\\\\Users\\\\Chetan N C\\\\Documents\\\\Client.png\"" ); <br>
image.setWidth("100px");<br>
image.setHeight("50px");<br>
CellHandle cell = (CellHandle) row.getCells( ).get( 0 );<br>
cell.getContent( ).add( image );</p>
<p> </p>
<p>Can any body please suggest some improvements</p>