Jump to content
We've recently updated our Privacy Statement, available here ×

e.moshe.work

Members
  • Posts

    1
  • Joined

  • Last visited

e.moshe.work's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. hi. i know it was probably asked several times before and i found some issues like mine but didn't understand why my solution is now working. in short - i have a field called "status" which brings from the DB one of two results - true or false. i created a style and added 2 conditions in it - either $F{TestDate}.matches("true") or $F{TestDate}.matches("false"). for each of those conditions i defined colors (tried both forecolor and backcolor) and under the details i marked the style as "status" which is the name i used for it. however when i run the preview the column is empty and shows nothing. if i don't use the style the column show the correct value from the DB without any text color, so... what am i doing wrong here? here is the code: <property name="com.jaspersoft.studio.data.defaultdataadapter" value="New Data Adapter "/> <style name="status" mode="Opaque" hTextAlign="Center" markup="rtf" pattern=""> <conditionalStyle> <conditionExpression><![CDATA[$F{TestDate}.matches("true")]]></conditionExpression> <style mode="Transparent" forecolor="rgba(166, 63, 61, 0.45490196)" backcolor="#07EB48"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$F{TestDate}.matches("false")]]></conditionExpression> <style mode="Transparent" forecolor="rgba(255, 255, 255, 0.45490196)" backcolor="#F2070B"/> </conditionalStyle> </style> <queryString language="SQL"> <![CDATA[select * from results.portfolio_res WHERE TestDate >= ( CURDATE() - INTERVAL 1 DAY )]]> </queryString> <field name="TestDate" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="TestDate"/> <property name="com.jaspersoft.studio.field.tree.path" value="mtsockets_res"/> </field> <field name="TestTime" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="TestTime"/> <property name="com.jaspersoft.studio.field.tree.path" value="mtsockets_res"/> </field> <field name="TestName" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="TestName"/> <property name="com.jaspersoft.studio.field.tree.path" value="mtsockets_res"/> </field> <field name="PageURL" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="PageURL"/> <property name="com.jaspersoft.studio.field.tree.path" value="mtsockets_res"/> </field> <field name="ExecutionTime" class="java.lang.Float"> <property name="com.jaspersoft.studio.field.label" value="ExecutionTime"/> <property name="com.jaspersoft.studio.field.tree.path" value="mtsockets_res"/> </field> <field name="status" class="java.lang.String"> <property name="com.jaspersoft.studio.field.label" value="status"/> <property name="com.jaspersoft.studio.field.tree.path" value="mtsockets_res"/> </field> <group name="status"> <groupExpression><![CDATA[$F{status}]]></groupExpression> </group> <background> <band splitType="Stretch"/> </background>
×
×
  • Create New...