I want to display different column header text and regarding this header different values as well in my table. The header text and the value depends on one Parameter value. This parameter is defined in the "Parameters" section of the report as String, I also see it on the "Preview" view and I also give it a value there.
My problem is, that it's not working (this column is always empty: no header text, no value in detail) :) How can I use properly any IF statement here? This is my code for the table header:
($P{first_column} == "first_column") ? "First Column" : ($P{first_column} == "second_column" ? "Second Column" : ($P{first_column} == "third_column" ? "Third Column" : ""))
What am I doing wrong? Thank you!
EDIT.:
this is the TextField expresion copied from the "source" view:
<textField>
<reportElement mode="Opaque" x="0" y="0" width="58" height="30" backcolor="#CFCFCF" uuid="96edf250-4a1c-4448-8995-3753c76f4a1e"/>
<textElement verticalAlignment="Middle">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[($P{first_column}.equals("first_column") ? "First Column" : ($P{first_column}.equals("second_column") ? "Second Column" : ""))]]></textFieldExpression>
</textField>