dunham Posted August 6, 2019 Share Posted August 6, 2019 I have a "Text Field" that reads from a Map parameter "number" defined like thisString number = "first line n second line n third line";[/code]I want to shade every second line like this:Here is the definition of the "Text Field" <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement x="110" y="77" width="110" height="11"/> <textElement verticalAlignment="Middle"> <font fontName="SansSerif" size="8" isBold="false"/> <paragraph lineSpacing="Fixed" lineSpacingSize="10.0" leftIndent="2"/> </textElement> <textFieldExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}.get("number")]]></textFieldExpression> </textField>[/code]-> Is there a way to define it so that every odd line in the text field has a background color? Link to comment Share on other sites More sharing options...
trvpseudo Posted August 8, 2019 Share Posted August 8, 2019 you can use table in basic element.in the table style setup, remove all header and footer (if u dont need it). you can differ the odd row color by checking "use alternated detail rows background" this one help me when i havent found the table elementhttps://community.jaspersoft.com/questions/542320/different-colour-alternate-rows hope that helps, cheers!TV Link to comment Share on other sites More sharing options...
C-Box Posted August 26, 2019 Share Posted August 26, 2019 You could also use a Conditional Style with just an expression like $V{REPORT_COUNT} % 2 == 0 to set another background color to your textfields. (be aware, not to define a separate background colör at textfield level itself just at the style level!)Then you wont need a extra table component. hth + regardsC-Box 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