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)
Issues after updating BIRT
ALyons
<p>Hi, We recently migrated our RCP application from Helios to Juno (technically the legacy version of Juno 3.8.1), We also updated BIRT going from 2.6.2 to 4.2.2. We are using the web viewer in a swt browser window to present the reports.</p><p>The update went fairly smoothly without any major issues BIRT's performance on some large reports improved which I was happy about. However I've noticed that a script I use to auto re-size an image is no longer working, when went to go fix it I noticed that I couldn't log to console anymore, nor were any script errors appearing in the report engine log.</p><p>I logged to the System.out or System.err console using Packages.java.lang.System.out.println() without issue in 2.6.2, now that doesn't work. I presumed it was an error and looked at the report engine log to see what the error was but nothing showed up, I even forced an error: new Object().crashNow(); to no avail.</p><p>So how do I write to console in 4.2.2?</p><p>Why isn't the log working? I presume a setting is required somewhere.</p><p>Thanks - Adrian</p>
Find more posts tagged with
Comments
ALyons
<p>OK, don't know what I did but I've got console output back again, however error logging still isn't working.</p><p> </p><p>So I debugged my script and it appears that its functioning correctly which means that something changed in BIRT.</p><p> </p><p>Our product is a conceptual modeling tool that lets the user build models/diagrams in a manner similar to UML. The models are exported as an image to an XML file and that serves as our report data, loading the image into birt is no problem. However because these images could have a large variety of aspect ratios we can't just drop them onto the report, the report must dynamically resize the image element to match the limits of the page and maintain the aspect ratio.</p><p> </p><p>Using fit to container does not preserve aspect ratio and setting the image elements size on one axis causes the image to clip if the images aspect ratio doesn't match the limited side (i.e. limiting the height fails if its a very wide image, limiting the width fails if its a very tall image). Limiting both sides forces the aspect ratio to the image elements aspect ratio not the images.</p><p> </p><p>Ideally there would be an option on images to always maintain image data aspect ratio, but since there isn't I had to write my own. In the onCreate event I perform a comparison of sizes and aspect ratios of both the image data and the image area to determine the size the area needs to be, I then set its size using:</p><pre class="_prettyXprint _lang-js _linenums:1">this.setWidth(imagewidth + "mm");this.setHeight(imageheight + "mm");</pre><p>So whats the problem? Well the script was working fine in 2.6.2 for all images however in 4.2.2 the way BIRT is responding to it doesn't quite work for very wide images, it is scaling the image close to the requested size however its not to the exact size I set, its wider and thus its getting cut off.</p><p> </p><p>So can any of the BIRT developers tell me what changed for image layouts between 2.6.2 and 4.2.2?</p><p>If anyone else wants to see the full script I'm happy to post it, I excluded for brevity.</p>
ALyons
<p>Heh right after my last post I realised what was going wrong. We added the ability to set the page size dynamically prior to the report run, so large reports can be sized to large pieces of paper. Anyway, the default paper size we set it to was Letter if your system is in imperial units, that script was developed prior to the paper resizing and worked on a fixed page size of A4. Thus the image was resized to an A4 page and didn't fit on a Letter. Feel a bit silly now
</p><p> </p><p>If anyone wants the script let me know and I'll make a sample report out of it.</p>