2006 IR Open Dicussion Posted September 5, 2006 Share Posted September 5, 2006 By: fancellu - fancellu Images rendered 4/3 larger than reality 2006-03-04 05:02 iReports 1.2.0 I have a report with an image, set to RetainShape. However when I render to JRViewer or PDF the images look exactly 4/3 larger, and hence jaggy. Why is this? I can replicate this by creating a new document, plopping in an image, setting to retain shape and setting the size, i.e. very very simply. Here is the xml of the report <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="untitled_report_1" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="2" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="50" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="50" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="30" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="100" isSplitAllowed="true" > <image scaleImage="RetainShape" vAlign="Top" hAlign="Left" isUsingCache="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement mode="Opaque" x="49" y="13" width="463" height="43" forecolor="#000000" backcolor="#FFFFFF" key="image-1" stretchType="NoStretch" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <graphicElement stretchType="NoStretch" pen="None" fill="Solid" /> <imageExpression class="java.lang.String"><![CDATA["gfx\trialserve_predictor.gif"]]></imageExpression> </image> </band> </detail> <columnFooter> <band height="30" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="50" isSplitAllowed="true" > </band> </pageFooter> <lastPageFooter> <band height="50" isSplitAllowed="true" > </band> </lastPageFooter> <summary> <band height="50" isSplitAllowed="true" > </band> </summary> </jasperReport> By: fancellu - fancellu RE: Images rendered 4/3 larger than reality 2006-03-04 05:25 I told ireports that the image was 75% smaller than it actually is, and now it looks good! Where does this weirdness come from? Link to comment Share on other sites More sharing options...
gorkag Posted November 17, 2006 Share Posted November 17, 2006 Hi! I have the same problem with my images. I have to insert a logo in my reports and they appear at 4/3 of their real size too!You can see this effect in the image examples of jasper:http://jasperreports.sourceforge.net/samples/ImagesReport.htmlthe real image:http://jasperreports.sourceforge.net/jasperreports.png I tried the solution you chose, putting them at 3/4 of the size just to make them have their real size inside the reports (4/3*3/4 = 1 ;)). BUT! with this approach, the logo is out of focus! Haven´t you noticed this? Anyone can help me with this? The logo is not well shown, and the client is complaining! Thanks in advance for all your help! Link to comment Share on other sites More sharing options...
dpinfo Posted November 17, 2006 Share Posted November 17, 2006 Use the option clip instead of retain shape. Clip will maintein the exacly dimension of the image.For more information look on the manual of Ireport.ByeDpinfo Link to comment Share on other sites More sharing options...
dpinfo Posted November 17, 2006 Share Posted November 17, 2006 Use the option clip instead of retain shape. Clip will maintein the exacly dimension of the image.For more information look on the manual of Ireport.ByeDpinfo Link to comment Share on other sites More sharing options...
gorkag Posted November 17, 2006 Share Posted November 17, 2006 Hi! thansk for the reply, but that is not the answer. If you take a look at the example: http://jasperreports.sourceforge.net/samples/ImagesReport.html you will notice it is this code:Code:<image scaleImage="Clip" onErrorType="Icon" isLazy="true"><reportElement x="0" y="0" width="150" height="40"/><imageExpression class="java.lang.String">"http://jasperreports.sourceforge.net/jasperreports.png"</imageExpression></image> It is already "Clip", but the size is not the real one of the image, but 4/3 of it. I think this may be a bug, but I have not found anyone with this problem but this post! Don´t you use images in your reports? Thanks again. Link to comment Share on other sites More sharing options...
sdyson Posted September 7, 2007 Share Posted September 7, 2007 I'm experiencing this problem as well. It seems a strange bug to have been in the jasper for so long. Has there been any official response? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now