0

DynamicJasper doesn't apply conditional styling if the column type is Image. This bug is true for setPrintBackgroundOnOddRows and addConditionalStyle()

If you print out jrxml file the style for image column is missing the conditionalStyle tag.

Style oddRowStyle = new Style();
oddRowStyle.setBackgroundColor(Color.LIGHT_GRAY);

oddRowStyle.setTransparency(Transparency.OPAQUE);

FastReportBuilder reportTemplate = new FastReportBuilder();
reportTemplate.setPrintBackgroundOnOddRows(true)
.setPageSizeAndOrientation(Page.Page_A4_Landscape())
.setOddRowBackgroundStyle(oddRowStyle);

AbstractColumn columnSqlServer = ColumnBuilder.getNew().setColumnProperty(columnProperty.getKey(), Object.class.getName())
                .setColumnType(ColumnBuilder.COLUMN_TYPE_IMAGE)
                .setImageScaleMode(ImageScaleMode.NO_RESIZE)
                //.addConditionalStyle(new ConditionalStyle(new FetchCondition(), columnStyle1)) 
                .setStyle(columnStyle)
                .setHeaderStyle(headerStyle).build();

from the generated jxml file

<style name="dj_style_3_" mode="Transparent" forecolor="#000000" backcolor="#FFFFFF" radius="0" hAlign="Center" vAlign="Middle" rotation="None" isBlankWhenNull="true" fontName="Verdana" fontSize="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded="false">
    <box padding="2">
        <pen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
    </box>
</style>
<style name="dj_style_4_" mode="Transparent" forecolor="#000000" backcolor="#FFFFFF" radius="0" hAlign="Left" vAlign="Middle" rotation="None" isBlankWhenNull="true" fontName="Verdana" fontSize="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded="false">
    <box padding="2">
        <pen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
    </box>
</style>

column with even odd set

<style name="Verdana_for_column_DJR_3169_COLUMN_1_" mode="Transparent" forecolor="#000000" backcolor="#FFFFFF" radius="0" hAlign="Left" vAlign="Middle" rotation="None" isBlankWhenNull="true" fontName="Verdana" fontSize="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded="false">
    <box padding="2">
        <pen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
    </box>
    <conditionalStyle>
        <conditionExpression><![CDATA[new java.lang.Boolean(((Number)$V{REPORT_COUNT}).doubleValue() % 2 == 0)]]></conditionExpression>
        <style mode="Opaque" backcolor="#C0C0C0"/>
    </conditionalStyle>
</style>

it's missing the tag

Alex K
  • 22,315
  • 19
  • 108
  • 236
adevroy
  • 1
  • 1
  • And what is your question? – Alex K Mar 05 '14 at 04:26
  • I was wondering if there is a work around for this ? I am going to submit this as a bug to Dynamicjasper but in the mean while i was wondering if there is a work around. Sorry for not being clear – adevroy Mar 05 '14 at 19:13

0 Answers0