findashwin Posted May 3, 2008 Share Posted May 3, 2008 Ok. If I use printwhenexpression functionality, I can get alternate row coloring to work. No Problem there. But that is not the solution to export in html. So after doing some looking around, I have decided to use styles & conditional styles. For some reason, I see no coloring in either pdf or html? Code snippet here.... style declaration in begining of jrxml-------------------------------------------<style name="row_style" isDefault="false" ackcolor="#00FF00"><conditionalStyle><conditionExpression><![CDATA[boolean.valueOf( $V{PAGE_COUNT}.intValue() % 2 == 1 )]]> </conditionExpression><style isDefault="false" backcolor="#FFFF00"/></conditionalStyle></style> -----------------------------------------place where its referenced is as follows <textField isStretchWithOverflow="true" ><reportElement style="row_style" x="0" y="0" width="150" height="15"/><box><pen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/></box><textElement><font size="10"/></textElement><textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_1}]]></textFieldExpression></textField> Link to comment Share on other sites More sharing options...
findashwin Posted May 3, 2008 Author Share Posted May 3, 2008 I have a more basic problem. The background color that I am setting on JRDesigntextfield doesnt show up in pdf or html. I am doing this programmatically. Is there anything else that I need to do? this is the textfield is declared. <textField isStretchWithOverflow="true"><reportElement x="0" y="0" width="150" height="15" backcolor="#00FF00"/><box><pen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/></box><textElement><font size="10"/></textElement><textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_1}]]></textFieldExpression></textField> Link to comment Share on other sites More sharing options...
findashwin Posted May 3, 2008 Author Share Posted May 3, 2008 whoa! I got it finally. I wasnt setting the background of text to JRElement.MODE_OPAQUE. Link to comment Share on other sites More sharing options...
dnvsrikanth Posted May 4, 2008 Share Posted May 4, 2008 hi findashwin Refer to the article in the following link. This may simplify the task you are doing... http://www.brianburridge.com/2006/06/19/highlighting-odd-even-rows-jasperreports/ DNV Srikanth 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