Jump to content
Changes to the Jaspersoft community edition download ×

Change background colour on HTML report

Recommended Posts

By: Paul Kearney - paulkearney

Change background colour on HTML report

2006-03-10 03:35



(JasperReports 1.2.0)


I am looking to change the background colour of a one-page HTML report for presentation reasons.


I want to construct a report and have it displayed on top of a solid background colour.


So far I have tried:


<?xml version="1.0"?><!DOCTYPE jasperReport

PUBLIC "-//JasperReports//DTD Report Design//EN"



<jasperReport name="SummaryReport">





<band height="300">


<reportElement x="0" y="0" width="300" height="300" backcolor="darkGray" mode="Opaque" />






<band height="80">


<reportElement x="0" y="0" width="400" height="20" />


<font reportFont="ArialBold" />


<textFieldExpression class="java.lang.String">$P{reportTitle}</textFieldExpression>








<band height="220">


<reportElement x="0" y="20" width="199" height="20" mode="Transparent" />

<text><![CDATA[Number of elements:]]></text>



<reportElement x="200" y="20" width="99" height="20" mode="Transparent" />

<textElement textAlignment="Right" />

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










Where I expect the <background> element to provide a solid background element and the report <title> and <detail> sections to be displayed over the top of it. The block colour being visible as the other elements are set to mode="Transparent".


Instead what happens is that background colour is ignored and the other elements render as they would normally have (i.e. on a white background).


Hope someone can help.





Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...