erosszz_jp Posted January 25, 2010 Share Posted January 25, 2010 i am using crosstab then would like to set the width and visibility property of an element depends on the data received from the datasource...how can i implement... please guide me on... Link to comment Share on other sites More sharing options...
erosszz_jp Posted January 27, 2010 Author Share Posted January 27, 2010 anybody encountered same requirements? Link to comment Share on other sites More sharing options...
vsbait Posted February 5, 2010 Share Posted February 5, 2010 i also encountered same requirement, actually i want to set the value of height and width property of reportElement from field valueexample code is givenbut getting this error:net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '$F{PositionX}' is not a valid value for 'NMTOKEN'please help, i am really stuck with thisCode:<field name="PositionX" class="java.lang.Integer"/><textField isStretchWithOverflow="true" isBlankWhenNull="true"><reportElement x="40" y="0" width="$F{PositionX}" height="15" key="textField"/><textElement textAlignment="Center"><font pdfFontName="Helvetica-Bold" size="2" isBold="true"/></textElement><textFieldExpression class="java.lang.Integer"><![CDATA[$F{PositionX}]]></textFieldExpression></textField>Post Edited by vsbait at 02/05/2010 07:27 Link to comment Share on other sites More sharing options...
arunsankarkk Posted February 5, 2010 Share Posted February 5, 2010 Hiii guys.. I have worked on some crossTab reports, but dont know whether we can achieve the changing of reportheight dynamically..but we can disable fields in report. Just pass condition in editExpression. Eg($V{field}.equals("a") ? $P{parameter1} : $P{parameter2}... You should pass field value while populating values to report(mean to say set Field("a"), Field("b")...). Hope this is the doubt you all have and iam clear in my explaination Link to comment Share on other sites More sharing options...
vsbait Posted February 6, 2010 Share Posted February 6, 2010 Thanks for your quick reply, now i can hope that their is some to help me. But actually my requirement is a little different, actually i want to design the jasper report base on the values from the database, means i store elements x,y,width,height,style etc. to database, then i retrieve that values from database using queryString of jasper report, now i want to set these x,y,width,height values to the reportElement x,y,height,width such as: <reportElement x="<here will be the xfield value from database>"/>i use this <reportElement x="<![CDATA[$F{xfield}]]>"/>but not working...what can be the solution 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