grzewal Posted January 4, 2007 Share Posted January 4, 2007 Hi. I've used iReport 1.2.5 for a long time but there was a bug (or my misuderstanding). Changed version to 1.3 but nothing changed. Here's the thing. As we all know using styles in JasperReports is much like cascading styles in HTML. And here's where the bug comes. Let's imagine I've defined a style with some padding, for example: <style name="defaultContentStyleJustified" isDefault="false" hAlign="Justified" vAlign="Middle" borderColor="#000000" topPadding="4" leftBorderColor="#000000" leftPadding="4" bottomBorderColor="#000000" bottomPadding="4" rightPadding="4" isStyledText="true" fontName="Arial" pdfEncoding="Cp1250" isPdfEmbedded="true" isBlankWhenNull="true" /> As you can see this style sets all the paddings to 4. Now let's imagine I've used this style in some textElements several times like this: <textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement style="defaultContentStyleJustified"x="0" y="0" width="483" height="20" key="textField-21" stretchType="RelativeToTallestObject" isPrintWhenDetailOverflows="true"/> <box topBorder="None" topBorderColor="#000000" topPadding="4" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000" bottomPadding="4"/> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$R{system.version}+ " "+ $F{SYSTEM_VERSION}]]></textFieldExpression></textField> and I've overriten the border and paddings values and what's most important I wanted to set leftPadding and rightPadding to 0. When I do this via iReport somehow the leftPadding="0" and rightPadding="0"is ommited when writing the jrxml template. As the idea of cascading styles works the element takes the padding form the style defined "higher" in chierarhy, which makes leftPadding="4" and rightPadding="4". My question is wheather the iReport ommits all paddings values set to 0 on purpose or is it a bug or is there something I do not understand... With regards, Grzegorz W. 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