| Author |
Jasper Report. Problem in html print preview of graphical element
|
krishanveer singh
Greenhorn
Joined: Jun 16, 2008
Posts: 1
|
|
Hi Folks, I am facing one unique problem with Jasper Reports. I am trying to use horizontal/vertical lines to create logical sections in my report. It renders the lines in Internet Explorer when I have an HTML preview but it does not render the lines when I select Print Preview.It is also not showing on printed copy.I am using image servlet also. Unlike this when I select PDF Preview it not only renders lines properly but also renders them on printed copy as well. I have attached the sample JRXML code. ----------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="ShapesReport" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="555" columnSpacing="0" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" whenNoDataType="AllSectionsNoDetail" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="0" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="782" isSplitAllowed="true" > <line direction="TopDown"> <reportElement x="0" y="50" width="200" height="1" key="line"/> <graphicElement stretchType="NoStretch"/> </line> <staticText> <reportElement x="210" y="50" width="340" height="40" key="staticText"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[<line><reportElement x="0" y="50" width="200" height="0"/><graphicElement pen="1Point"/></line>]]></text> </staticText> <line direction="TopDown"> <reportElement x="0" y="100" width="200" height="40" key="line"/> <graphicElement stretchType="NoStretch" pen="2Point"/> </line> <staticText> <reportElement x="210" y="100" width="340" height="40" key="staticText"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[<line direction="TopDown"><reportElement x="0" y="100" width="200" height="40"/><graphicElement pen="2Point"/></line>]]></text> </staticText> <line direction="BottomUp"> <reportElement x="0" y="150" width="200" height="40" forecolor="#00FF00" key="line"/> <graphicElement stretchType="NoStretch" pen="4Point"/> </line> <staticText> <reportElement x="210" y="150" width="340" height="40" key="staticText"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[<line direction="BottomUp"><reportElement x="0" y="150" width="200" height="40" forecolor="green"/><graphicElement pen="4Point"/></line>]]></text> </staticText> <line direction="TopDown"> <reportElement x="100" y="200" width="1" height="40" forecolor="#0000FF" key="line"/> <graphicElement stretchType="NoStretch" pen="Dotted"/> </line> <staticText> <reportElement x="210" y="200" width="340" height="40" key="staticText"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[<line><reportElement x="100" y="200" width="0" height="40" forecolor="blue"/><graphicElement pen="Dotted"/></line>]]></text> </staticText> <rectangle> <reportElement x="0" y="250" width="200" height="40" backcolor="#FFFF99" key="rectangle"/> <graphicElement stretchType="NoStretch" pen="None"/> </rectangle> <staticText> <reportElement x="210" y="250" width="340" height="40" key="staticText"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[<rectangle><reportElement x="0" y="250" width="200" height="40" backcolor="#FFFF99"/><graphicElement pen="None"/></rectangle>]]></text> </staticText> <rectangle> <reportElement x="0" y="300" width="200" height="40" key="rectangle"/> <graphicElement stretchType="NoStretch"/> </rectangle> <staticText> <reportElement x="210" y="300" width="340" height="40" key="staticText"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[<rectangle><reportElement x="0" y="300" width="200" height="40"/><graphicElement pen="1Point"/></rectangle>]]></text> </staticText> <rectangle radius="15" > <reportElement x="0" y="350" width="200" height="40" backcolor="#FFFF00" key="rectangle"/> <graphicElement stretchType="NoStretch" pen="2Point"/> </rectangle> <staticText> <reportElement x="210" y="350" width="340" height="40" key="staticText"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[<rectangle radius="15"><reportElement x="0" y="350" width="200" height="40" backcolor="#FFFF00"/><graphicElement pen="2Point"/></rectangle>]]></text> </staticText> <rectangle> <reportElement x="0" y="400" width="200" height="40" forecolor="#FF0000" backcolor="#00FFFF" key="rectangle"/> <graphicElement stretchType="NoStretch" pen="4Point"/> </rectangle> <staticText> <reportElement x="210" y="400" width="340" height="40" key="staticText"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[<rectangle><reportElement x="0" y="400" width="200" height="40" forecolor="red" backcolor="#00FFFF"/><graphicElement pen="4Point"/></rectangle>]]></text> </staticText> <rectangle> <reportElement x="0" y="450" width="200" height="40" forecolor="#FF00FF" backcolor="#C0C0C0" key="rectangle"/> <graphicElement stretchType="NoStretch" pen="Dotted"/> </rectangle> <staticText> <reportElement x="210" y="450" width="340" height="40" key="staticText"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[<rectangle><reportElement x="0" y="450" width="200" height="40" forecolor="#FF00FF" backcolor="#C0C0C0"/><graphicElement pen="Dotted"/></rectangle>]]></text> </staticText> <rectangle> <reportElement x="0" y="500" width="150" height="30" backcolor="#FFAABB" key="rectangle"/> <graphicElement stretchType="NoStretch" pen="2Point"/> </rectangle> <rectangle> <reportElement x="50" y="510" width="150" height="30" forecolor="#0000FF" key="rectangle"/> <graphicElement stretchType="NoStretch" pen="2Point"/> </rectangle> <staticText> <reportElement x="210" y="500" width="340" height="40" key="staticText"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[<rectangle><reportElement x="50" y="510" width="150" height="30" forecolor="blue" mode="Opaque"/><graphicElement pen="2Point"/></rectangle>]]></text> </staticText> <rectangle> <reportElement x="0" y="550" width="150" height="30" backcolor="#FFAABB" key="rectangle"/> <graphicElement stretchType="NoStretch" pen="2Point"/> </rectangle> <rectangle> <reportElement mode="Transparent" x="50" y="560" width="150" height="30" forecolor="#0000FF" key="rectangle"/> <graphicElement stretchType="NoStretch" pen="2Point"/> </rectangle> <staticText> <reportElement x="210" y="550" width="340" height="40" key="staticText"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[<rectangle><reportElement x="50" y="560" width="150" height="30" forecolor="blue" mode="Transparent"/><graphicElement pen="2Point"/></rectangle>]]></text> </staticText> <ellipse> <reportElement x="0" y="600" width="200" height="40" forecolor="#FF0000" backcolor="#FFFF99" key="ellipse"/> <graphicElement stretchType="NoStretch" pen="2Point"/> </ellipse> <staticText> <reportElement x="210" y="600" width="340" height="40" key="staticText"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[<ellipse><reportElement x="0" y="600" width="200" height="40" forecolor="red" backcolor="#FFFF99"/><graphicElement pen="2Point"/></ellipse>]]></text> </staticText> <ellipse> <reportElement x="80" y="650" width="40" height="40" forecolor="#009900" backcolor="#99FFFF" key="ellipse"/> <graphicElement stretchType="NoStretch" pen="2Point"/> </ellipse> <staticText> <reportElement x="210" y="650" width="340" height="40" key="staticText"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[<ellipse><reportElement x="80" y="650" width="40" height="40" forecolor="#009900" backcolor="#99FFFF"/><graphicElement pen="2Point"/></ellipse>]]></text> </staticText> </band> </title> <pageHeader> <band height="0" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="0" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="0" isSplitAllowed="true" > </band> </detail> <columnFooter> <band height="0" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="0" isSplitAllowed="true" > </band> </pageFooter> <summary> <band height="0" isSplitAllowed="true" > </band> </summary> </jasperReport>
|
 |
 |
|
|
subject: Jasper Report. Problem in html print preview of graphical element
|
|
|