views:

306

answers:

1
<reportElement x="79" y="103" width="279" height="23" backcolor="#000000">
 <propertyExpression name="width"><![CDATA["100"]]></propertyExpression>
</reportElement>

I am trying to set the width of a reportElement by using a propertyExpresssion, Jasper Reports is picking up the width as 279 instead of 100 in the code above, and if I remove the width attribute in the reportElement tag I will get an error. What am I doing wrong? it compiles, fills and all, but the width in the expression is not being used.

A: 
JRElement element = jasperReport.getTitle().getElementByKey("graphWidthKey");
element.setWidth(100);
rajshekhar
I am looking for a jrxml solution to the example I have in my question, not a java version.
Chiwai Chan