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)
Embed Image in Parameter Page
Bruno A
<p>Hi, I'm new to this forum. I see this forum is very helpful. It has solutions for different scenarios.</p>
<p>I have a interesting request from user to embed image in the parameter page.</p>
<p>Is it doable in the first place?</p>
<p>When I right click on report parameters I don't see Insert Element to insert any object.</p>
<p>Is there a sneaky way to do this using scripts on report methods like before factory or initialize.</p>
Find more posts tagged with
Comments
Clement Wong
<p>The default parameter page cannot display an image from a dynamic data set.</p>
<p> </p>
<p>What is the use case? Can you provide more details as to where the image is coming from?</p>
<p> </p>
<p>Are you using open source BIRT, or commercial BIRT? What version?</p>
Bruno A
<p>Hi, I attached screenshot. This report is being used by call center people. Use/purpose is to get customer information with the help of image and fill the respective parameter values.</p>
<p>Currently the image is in my local/workspace.</p>
<p>I'm using open source BIRT version 4.2.3</p>
<p> </p>
Clement Wong
<p>To clarify, your screenshot is a listing report? And you want images in that report? Or on the parameter page before the report is executed?</p>
<p> </p>
<p>The parameter page can be customized, or you can make a report look like a parameter page, and then execute your final report.</p>
Bruno A
<p>Hi, screenshot is not a listing report. It is a jpg file.</p>
<p>I would like to see image on the parameter page before the report is executed.</p>
<p>Can you please let me know how can I customize parameter page or make the report look like parameter page,</p>
<p>and then execute final report(in this case the image will show up in the 1st report and when hit ok the report parameters will show up in the drill through report right)</p>
<p>Do you have any design example.</p>
Clement Wong
<p>To confirm, you just want a simple image on your parameter page? You can modify the out of box JSP to do this. The file <strong>ParameterDialogFragment.jsp</strong> is located under ...\birt\webcontent\birt\pages\dialog</p>
<p> </p>
<p>Right before:<br><span style="font-family:'courier new', courier, monospace;"><DIV CLASS="birtviewer_parameter_dialog"></span></p>
<p> </p>
<p>Also, you can have a IF/THEN to display the image if you want it based on a specific report name/substring.</p>
<p> </p>
<p>Or did you want dynamic images from a database on your parameter page?</p>
Bruno A
<p>Hi, yes just a simple static image on the report parameter page(not dynamic images from a database).</p>
<p>I was able to find ParameterDialogFragment.jsp and I added <img src="/image/81.jpg" /> to the jsp</p>
<p>right before the DIV CLASS and copied 81.jpg to the birt\webcontent\birt\images.</p>
<p>Then I ran my report but the image is not showing up in the parameter page.</p>
<p>Is the syntax to display image incorrect?</p>
<p>I tried both relative and absolute path(image file from server).</p>
Clement Wong
<p>In my test, there is an existing "Idea.jpg" image under ...\birt\webcontent\birt\images, and I just added this code into ParameterDialogFragment.jsp.</p>
<p> </p>
<p>Where the first "birt" referenced in the URI is the application context path for the BIRT Viewer when it was deployed:</p>
<p><span style="font-family:'courier new', courier, monospace;"><IMG SRC="/birt/webcontent/birt/images/Idea.jpg"></span></p>
Bruno A
<p>Hi, I attached screenshots. The first is the one I added code to jsp and the 2nd one, I imported image to embedded images(I don't think this one is necessary) and when I hit on view report the image is not showing up in parameter page.</p>
<p>Am I missing something?</p>
Clement Wong
<p>You do not need to add an embedded image into a report design.</p>
<p> </p>
<p>Your image file should reside in your application server (Tomcat, Weblogic, jBoss, etc...), specifically under the deployment of the BIRT Viewer.</p>
<p> </p>
<p>Where are you running the design from? What application server did you deploy the BIRT Viewer to? What context path did you deploy the BIRT Viewer as?</p>
<p> </p>
<p>Are you running this in the Designer as a test? If so, then you'll need to put the image into your Designer's Viewer as well. For BIRT 4.5.0 and with our example that would be in ...eclipse\plugins\org.eclipse.birt.report.viewer_4.5.0.v201506092134\birt\webcontent\birt\images.</p>
Bruno A
<p>Hi, I'm running this in designer as a test and copied image in the path you mentioned under the BIRT version I'm using (which is 4.2.3) but no luck. I attached test report, jsp and image.</p>
<p>Can you please check if I'm missing something. May be something to do with the image path(syntax).</p>
<p> </p>
Clement Wong
<p>In your JSP, instead of <span style="font-family:'courier new', courier, monospace;"><img src="./eclipse/plugins/org.eclipse.birt.report.viewer_4.2.3.v20131216-0430/birt/webcontent/birt/images/81.jpg" /></span></p>
<p> </p>
<p>Since the image is served by the embedded app server, try <span style="font-family:'courier new', courier, monospace;"><img src="/birt/webcontent/birt/images/81.jpg" /></span></p>
Bruno A
<p>Hi, I tried but no luck.</p>
<p>Quick question, if above code works fine then if I run any report which has parameters</p>
<p>the image will show up right(on my local)?</p>
Clement Wong
<p>Sorry, that should have been "viewer" not "birt" because when viewing from the Designer, the context path is "/viewer"</p>
<p> </p>
<p><span style="font-family:'courier new', courier, monospace;"><img src="/viewer/webcontent/birt/images/81.jpg" /></span></p>
Bruno A
<p>Hi Clement, I tried above path but no luck. As a workaround I used 2 reports. 1st report has image in grid and a label hyperlink to the 2nd report which takes to parameter page.</p>
<p>Thanks a lot for your time.</p>