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

BackColor of element covers text not cell?


Recommended Posts

By: apenrose - apenrose

BackColor of element covers text not cell?

2006-02-28 02:53

Hi there,

Wondering if someone has any idea why when I change the backcolor of a reportElement that is a textElement that the backcolor in this case #FFFFFF only covers the text to the textElement. The underlying page color is visible in the rest of the cell. I have attached the detail section of my jrxml file.

 

Note that when exporting in the htmlExporter I have the following set:

 

htmlExporter.setParameter(JRHtmlExporterParameter.IS_WHITE_PAGE_BACKGROUND,Boolean.FALSE);

 

Any help greatly appreciated, very stuck on this one...which I think is something small I am missing.

Thanks,

Andrew

 

 

<detail>

<band height="16">

<textField pattern="" bookmarkLevel="2">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="0" y="0" width="93" height="15" backcolor="#FFFFFF"/>

<box topBorder="None" topBorderColor="#0" leftBorder="Thin" leftBorderColor="#0" leftPadding="10" bottomBorder="Thin" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0" rightPadding="10"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{device}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" pattern="">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="153" y="0" width="221" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="Thin" leftBorderColor="#0" leftPadding="10" bottomBorder="Thin" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0" rightPadding="10"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{description}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" pattern="">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="374" y="0" width="127" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="Thin" leftBorderColor="#0" leftPadding="10" bottomBorder="Thin" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0" rightPadding="10"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{source}]]></textFieldExpression>

</textField>

<textField pattern="">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="501" y="0" width="164" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{destination}]]></textFieldExpression>

</textField>

<textField pattern="" hyperlinkType="Reference" hyperlinkTarget="Blank">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="781" y="0" width="40" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{minimum}]]></textFieldExpression>

<hyperlinkReferenceExpression><![CDATA[$F{url}]]></hyperlinkReferenceExpression>

</textField>

<textField pattern="" hyperlinkType="Reference" hyperlinkTarget="Blank">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="821" y="0" width="40" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{average}]]></textFieldExpression>

<hyperlinkReferenceExpression><![CDATA[$F{url}]]></hyperlinkReferenceExpression>

</textField>

<textField pattern="" hyperlinkType="Reference" hyperlinkTarget="Blank">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="861" y="0" width="40" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="1Point" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{maximum}]]></textFieldExpression>

<hyperlinkReferenceExpression><![CDATA[$F{url}]]></hyperlinkReferenceExpression>

</textField>

<textField pattern="" bookmarkLevel="2">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="93" y="0" width="60" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="Thin" leftBorderColor="#0" leftPadding="10" bottomBorder="Thin" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0" rightPadding="10"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{testType}]]></textFieldExpression>

</textField>

<textField pattern="" bookmarkLevel="2">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="665" y="0" width="57" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="Thin" leftBorderColor="#0" leftPadding="10" bottomBorder="Thin" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0" rightPadding="10"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{compliancePercentage}]]></textFieldExpression>

</textField>

<textField pattern="" bookmarkLevel="2">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="722" y="0" width="59" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="Thin" leftBorderColor="#0" leftPadding="10" bottomBorder="Thin" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0" rightPadding="10"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{breachCount}]]></textFieldExpression>

</textField>

</band>

</detail>

 

 

 

 

 

By: Teodor Danciu - teodord

RE: BackColor of element covers text not cell

2006-02-28 03:10

 

Hi,

 

What version of JasperReports are you using?

I took your JRXML snippet and tested inside a sample.

It worked as expected and the white background

was applied to the <td> cell, not only the text.

 

Thank you,

Teodor

 

 

 

 

 

By: apenrose - apenrose

RE: BackColor of element covers text not cell

2006-02-28 03:15

Hi Teodord,

Thanks for the prompt reply. I am using Jasper Reports 1.0.1 (02 September 2005) with a single user licence of Jasper Assistant 2.0.2. Attached is my entire jrxml file, if you have a minute to look at it.

Many thanks, it's confusing me totally as to why its not working.

 

<?xml version="1.0" encoding="UTF-8"?>

<!-- Created using JasperAssistant (http://www.jasperassistant.com) -->

<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

 

<jasperReport name="ResponseTimes" language="java" pageWidth="900" pageHeight="400" whenNoDataType="AllSectionsNoDetail" columnWidth="900" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" isFloatColumnFooter="true" whenResourceMissingType="Empty">

<property name="com.jasperassistant.designer.GridWidth" value="12"/>

<property name="com.jasperassistant.designer.GridHeight" value="12"/>

<property name="com.jasperassistant.designer.Rulers" value="true"/>

<property name="com.jasperassistant.designer.SnapToGrid" value="false"/>

<property name="com.jasperassistant.designer.Margins" value="true"/>

<property name="ireport.scriptlethandling" value="0"/>

<property name="com.jasperassistant.designer.Grid" value="true"/>

<property name="com.jasperassistant.designer.VGuides.Detail" value="11"/>

<property name="ireport.encoding" value="UTF-8"/>

<property name="com.jasperassistant.designer.SnapToGuides" value="true"/>

<import value="java.util.*"/>

<import value="net.sf.jasperreports.engine.*"/>

<import value="net.sf.jasperreports.engine.data.*"/>

<reportFont name="Arial_Normal" isDefault="true" fontName="Arial" size="12" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<reportFont name="Arial_Bold" isDefault="false" fontName="Arial" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<reportFont name="Arial_Italic" isDefault="false" fontName="Arial" size="12" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<parameter name="ReportTitle" class="java.lang.String">

</parameter>

<parameter name="DevicesSelected" class="java.lang.String">

</parameter>

<parameter name="TimeScales" class="java.lang.String">

</parameter>

<parameter name="LatencyAverage" class="java.lang.String">

</parameter>

<parameter name="DeviceColumn" class="java.lang.String">

</parameter>

<parameter name="TestTypeColumn" class="java.lang.String">

</parameter>

<parameter name="DescriptionColumn" class="java.lang.String">

</parameter>

<parameter name="SourceColumn" class="java.lang.String">

</parameter>

<parameter name="DestinationColumn" class="java.lang.String">

</parameter>

<parameter name="CompliancePercentageColumn" class="java.lang.String">

</parameter>

<parameter name="BreachCountColumn" class="java.lang.String">

</parameter>

<parameter name="MinColumn" class="java.lang.String">

</parameter>

<parameter name="AvgColumn" class="java.lang.String">

</parameter>

<parameter name="MaxColumn" class="java.lang.String">

</parameter>

<parameter name="DeviceColumnUrl" class="java.lang.String">

</parameter>

<parameter name="DescriptionColumnUrl" class="java.lang.String">

</parameter>

<parameter name="SourceColumnUrl" class="java.lang.String">

</parameter>

<parameter name="DestinationColumnUrl" class="java.lang.String">

</parameter>

<parameter name="MinColumnUrl" class="java.lang.String">

</parameter>

<parameter name="AvgColumnUrl" class="java.lang.String">

</parameter>

<parameter name="MaxColumnUrl" class="java.lang.String">

</parameter>

<field name="device" class="java.lang.String">

</field>

<field name="testType" class="java.lang.String">

</field>

<field name="description" class="java.lang.String">

</field>

<field name="source" class="java.lang.String">

</field>

<field name="destination" class="java.lang.String">

</field>

<field name="compliancePercentage" class="java.lang.String">

</field>

<field name="breachCount" class="java.lang.String">

</field>

<field name="minimum" class="java.lang.String">

</field>

<field name="average" class="java.lang.String">

</field>

<field name="maximum" class="java.lang.String">

</field>

<field name="url" class="java.lang.String">

</field>

<title>

<band>

</band>

</title>

<pageHeader>

<band height="50">

<textField pattern="">

<reportElement key="textField" positionType="Float" mode="Opaque" x="0" y="26" width="901" height="24" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#ffffff" backcolor="#cc9966"/>

<box topBorder="None" topBorderColor="#0" leftBorder="None" leftBorderColor="#0" bottomBorder="None" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font reportFont="Arial_Normal" size="14" isBold="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{TimeScales}]]></textFieldExpression>

</textField>

<textField pattern="">

<reportElement key="textField" positionType="Float" mode="Opaque" x="0" y="0" width="901" height="26" isRemoveLineWhenBlank="true" forecolor="#ffffff" backcolor="#cc9966"/>

<box topBorder="None" topBorderColor="#0" leftBorder="None" leftBorderColor="#0" bottomBorder="None" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle" isStyledText="true">

<font reportFont="Arial_Normal" size="14" isBold="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{ReportTitle}]]></textFieldExpression>

</textField>

</band>

</pageHeader>

<columnHeader>

<band height="35">

<staticText>

<reportElement key="staticText" positionType="Float" mode="Opaque" x="781" y="0" width="120" height="19" backcolor="#c0c0c0"/>

<box topBorder="1Point" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="None" bottomBorderColor="#0" rightBorder="1Point" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="11" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<text><![CDATA[Response Times (ms)]]></text>

</staticText>

<textField pattern="">

<reportElement key="textField" positionType="Float" mode="Opaque" x="0" y="0" width="93" height="35" backcolor="#c0c0c0"/>

<box topBorder="1Point" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="13" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{DeviceColumn}]]></textFieldExpression>

</textField>

<textField pattern="">

<reportElement key="textField" positionType="Float" mode="Opaque" x="374" y="0" width="127" height="35" backcolor="#c0c0c0"/>

<box topBorder="1Point" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="13" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{SourceColumn}]]></textFieldExpression>

</textField>

<textField pattern="">

<reportElement key="textField" positionType="Float" mode="Opaque" x="153" y="0" width="221" height="35" backcolor="#c0c0c0"/>

<box topBorder="1Point" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="13" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{DescriptionColumn}]]></textFieldExpression>

</textField>

<textField pattern="">

<reportElement key="textField" positionType="Float" mode="Opaque" x="501" y="0" width="164" height="35" backcolor="#c0c0c0"/>

<box topBorder="1Point" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="13" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{DestinationColumn}]]></textFieldExpression>

</textField>

<textField pattern="" hyperlinkType="Reference">

<reportElement key="textField" positionType="Float" mode="Opaque" x="781" y="19" width="40" height="16" backcolor="#c0c0c0"/>

<box topBorder="1Point" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="13" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{MinColumn}]]></textFieldExpression>

<hyperlinkReferenceExpression><![CDATA[$P{MinColumnUrl}]]></hyperlinkReferenceExpression>

</textField>

<textField pattern="" hyperlinkType="Reference">

<reportElement key="textField" positionType="Float" mode="Opaque" x="821" y="19" width="40" height="16" backcolor="#c0c0c0"/>

<box topBorder="1Point" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="13" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{AvgColumn}]]></textFieldExpression>

<hyperlinkReferenceExpression><![CDATA[$P{AvgColumnUrl}]]></hyperlinkReferenceExpression>

</textField>

<textField pattern="" hyperlinkType="Reference">

<reportElement key="textField" positionType="Float" mode="Opaque" x="861" y="19" width="40" height="16" backcolor="#c0c0c0"/>

<box topBorder="1Point" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="1Point" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="13" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{MaxColumn}]]></textFieldExpression>

<hyperlinkReferenceExpression><![CDATA[$P{MaxColumnUrl}]]></hyperlinkReferenceExpression>

</textField>

<textField pattern="">

<reportElement key="textField" positionType="Float" mode="Opaque" x="93" y="0" width="60" height="35" backcolor="#c0c0c0"/>

<box topBorder="1Point" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="13" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{TestTypeColumn}]]></textFieldExpression>

</textField>

<textField pattern="">

<reportElement key="textField" positionType="Float" mode="Opaque" x="665" y="0" width="57" height="35" backcolor="#c0c0c0"/>

<box topBorder="1Point" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="13" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{CompliancePercentageColumn}]]></textFieldExpression>

</textField>

<textField pattern="">

<reportElement key="textField" positionType="Float" mode="Opaque" x="722" y="0" width="59" height="35" backcolor="#c0c0c0"/>

<box topBorder="1Point" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="1Point" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="13" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{BreachCountColumn}]]></textFieldExpression>

</textField>

</band>

</columnHeader>

<detail>

<band height="16">

<textField pattern="" bookmarkLevel="2">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="0" y="0" width="93" height="15" backcolor="#FFFFFF"/>

<box topBorder="None" topBorderColor="#0" leftBorder="Thin" leftBorderColor="#0" leftPadding="10" bottomBorder="Thin" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0" rightPadding="10"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{device}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" pattern="">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="153" y="0" width="221" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="Thin" leftBorderColor="#0" leftPadding="10" bottomBorder="Thin" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0" rightPadding="10"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{description}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" pattern="">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="374" y="0" width="127" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="Thin" leftBorderColor="#0" leftPadding="10" bottomBorder="Thin" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0" rightPadding="10"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{source}]]></textFieldExpression>

</textField>

<textField pattern="">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="501" y="0" width="164" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{destination}]]></textFieldExpression>

</textField>

<textField pattern="" hyperlinkType="Reference" hyperlinkTarget="Blank">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="781" y="0" width="40" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{minimum}]]></textFieldExpression>

<hyperlinkReferenceExpression><![CDATA[$F{url}]]></hyperlinkReferenceExpression>

</textField>

<textField pattern="" hyperlinkType="Reference" hyperlinkTarget="Blank">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="821" y="0" width="40" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{average}]]></textFieldExpression>

<hyperlinkReferenceExpression><![CDATA[$F{url}]]></hyperlinkReferenceExpression>

</textField>

<textField pattern="" hyperlinkType="Reference" hyperlinkTarget="Blank">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="861" y="0" width="40" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="1Point" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{maximum}]]></textFieldExpression>

<hyperlinkReferenceExpression><![CDATA[$F{url}]]></hyperlinkReferenceExpression>

</textField>

<textField pattern="" bookmarkLevel="2">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="93" y="0" width="60" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="Thin" leftBorderColor="#0" leftPadding="10" bottomBorder="Thin" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0" rightPadding="10"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{testType}]]></textFieldExpression>

</textField>

<textField pattern="" bookmarkLevel="2">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="665" y="0" width="57" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="Thin" leftBorderColor="#0" leftPadding="10" bottomBorder="Thin" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0" rightPadding="10"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{compliancePercentage}]]></textFieldExpression>

</textField>

<textField pattern="" bookmarkLevel="2">

<reportElement key="textField" stretchType="RelativeToTallestObject" mode="Opaque" x="722" y="0" width="59" height="15"/>

<box topBorder="None" topBorderColor="#0" leftBorder="Thin" leftBorderColor="#0" leftPadding="10" bottomBorder="Thin" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#0" rightPadding="10"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{breachCount}]]></textFieldExpression>

</textField>

</band>

</detail>

<columnFooter>

<band>

</band>

</columnFooter>

<pageFooter>

<band>

</band>

</pageFooter>

<summary>

<band height="19">

<staticText>

<reportElement key="staticText" positionType="Float" mode="Opaque" x="591" y="-1" width="190" height="20" forecolor="#ffffff" backcolor="#cc9966"/>

<box topBorder="None" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="1Point" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font reportFont="Arial_Normal" size="14" isBold="true"/>

</textElement>

<text><![CDATA[Response Time Average]]></text>

</staticText>

<textField pattern="">

<reportElement key="textField" positionType="Float" x="821" y="-1" width="40" height="20"/>

<box topBorder="None" topBorderColor="#0" leftBorder="1Point" leftBorderColor="#0" bottomBorder="1Point" bottomBorderColor="#0" rightBorder="1Point" rightBorderColor="#0"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{LatencyAverage}]]></textFieldExpression>

</textField>

</band>

</summary>

</jasperReport>

 

 

 

 

 

 

 

By: Lucian Chirita - lucianc

RE: BackColor of element covers text not cell

2006-02-28 04:43

Hi

 

This issue was fixed in 1.1.0.

 

If you don't want to upgrade, use this patch against 1.0.1:

 

Index: JRHtmlExporter.java

===================================================================

RCS file: /cvsroot/jasperreports/jasperreports/src/net/sf/jasperreports/engine/export/JRHtmlExporter.java,v

retrieving revision 1.48

diff -u -r1.48 JRHtmlExporter.java

--- JRHtmlExporter.java 25 Aug 2005 14:33:59 -0000 1.48

+++ JRHtmlExporter.java 28 Feb 2006 12:40:03 -0000

@@ -872,7 +872,7 @@

 

StringBuffer styleBuffer = new StringBuffer();

 

- if (text.getBackcolor().getRGB() != Color.white.getRGB() && text.getMode() == JRElement.MODE_OPAQUE)

+ if ((!isWhitePageBackground || text.getBackcolor().getRGB() != Color.white.getRGB()) && text.getMode() == JRElement.MODE_OPAQUE)

{

styleBuffer.append("background-color: #");

String hexa = Integer.toHexString(text.getBackcolor().getRGB() & colorMask).toUpperCase();

 

Note that this will only fix the issue for text elements, if you have the same problem with other elements you can use a similar fix.

 

HTH,

Lucian

 

 

 

 

By: apenrose - apenrose

RE: BackColor of element covers text not cell?

2006-02-28 13:56

Hi Lucian,

Thanks for the information.

I will upgrade to 1.2.0 to correct this.

Changing background to 254 254 254 ( ever so slightly off white) is another option for anyone not wanting to upgrade. Although why you wouldn't want to is a mystery. ;-)

Andrew

Link to comment
Share on other sites

  • 2 months later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

By: apenrose - apenrose

RE: BackColor of element covers text not cell?

2006-02-28 13:56

Hi Lucian,

Thanks for the information.

I will upgrade to 1.2.0 to correct this.

Changing background to 254 254 254 ( ever so slightly off white) is another option for anyone not wanting to upgrade. Although why you wouldn't want to is a mystery.

Andrew

 

:huh: Sure that it has been updated?

 

Take a look at this topic:

http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&id=17415&catid=9

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

These are two different issues.

The mentioned fix was indeed fixed, but it was not related to styled text.

 

The backcolor property of styled text covers only the text. Why? Because in the same styled text field I can have two words having different back colors. And furthermore, those back colors could be different from the text field back color altogether.

 

The styled text backcolor property refers only to text, by definition, and has nothing to do with the overall text field element backcolor.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...