jmbaker Posted January 17, 2008 Share Posted January 17, 2008 Hello, I am running a report that does little more than execute a subreport producing a table (the subreport executes an SQL query). When rendered as HTML, some rows in the table are blank - the data is not missing, but the blanks are inserted for no obvious reason. Re-running report produces the same blank rows in the same positions. Yet if I export as CSV, the blank rows disappear. I guess this is a bug in the HTML renderer, but how can it be cured? John Link to comment Share on other sites More sharing options...
itchytoes Posted January 18, 2008 Share Posted January 18, 2008 Hi -- Take a look at the FAQ page on the section about making HTML friendly pages. It's tricky in the sense that all your various cells have to line up correctly. Betty Link to comment Share on other sites More sharing options...
jmbaker Posted January 18, 2008 Author Share Posted January 18, 2008 Betty, Thanks. I've read the FAQ but am still at a loss to what is wrong. Here's my report - any chance you could take a look? With no page header/footer and cells aligned, there seems to be little else I can do (and the bug remains!). The HTML renderer needs an awful lot of work - I wish I had time to rewrite it! <?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="inactiveUsers_sub1" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="530" pageHeight="842" columnWidth="530" columnSpacing="0" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" whenNoDataType="AllSectionsNoDetail" isFloatColumnFooter="true" 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.*" /> <parameter name="APPLICATION" isForPrompting="true" class="java.lang.String"/> <parameter name="DATE_SINCE" isForPrompting="true" class="java.lang.Long"/> <parameter name="DATE_TIME_FORMATTER" isForPrompting="false" class="java.text.DateFormat"> <defaultValueExpression ><![CDATA[DateFormat.getDateTimeInstance()]]></defaultValueExpression> </parameter> <queryString><![CDATA[select u.logintime, u.mail, a.namefrom Application a, Application_Access au, SSOLDAPUsers uwhere a.applicationId=au.applicationId and au.accesskey=u.attribute and a.name=$P{APPLICATION} and (u.logintime < $P{DATE_SINCE} or u.logintime is null)group by u.mail, a.name, u.logintimeorder by u.logintime asc]]></queryString> <field name="LOGINTIME" class="java.math.BigDecimal"/> <field name="MAIL" class="java.lang.String"/> <field name="NAME" class="java.lang.String"/> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="0" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="0" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="19" isSplitAllowed="true" > <staticText> <reportElement x="0" y="1" width="120" height="17" forecolor="#000000" key="staticText-1" isPrintInFirstWholeBand="true"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement verticalAlignment="Top"> <font pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <text><![CDATA[Time (UTC)]]></text> </staticText> <staticText> <reportElement x="120" y="1" width="200" height="17" forecolor="#000000" key="staticText-2" isPrintInFirstWholeBand="true"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement verticalAlignment="Top"> <font pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <text><![CDATA[user]]></text> </staticText> <staticText> <reportElement x="320" y="1" width="210" height="17" forecolor="#000000" key="staticText-3" isPrintInFirstWholeBand="true"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement verticalAlignment="Top"> <font pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <text><![CDATA[Application]]></text> </staticText> <line direction="BottomUp"> <reportElement x="0" y="18" width="530" height="0" forecolor="#000000" key="line-1"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> </band> </columnHeader> <detail> <band height="19" isSplitAllowed="true" > <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="1" width="120" height="16" key="textField"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font fontName="Times-Roman" size="12"/> </textElement> <textFieldExpression class="java.util.Date"><![CDATA[new Date($F{LOGINTIME}.longValue())]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="120" y="1" width="200" height="16" key="textField"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font fontName="Times-Roman" size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{MAIL}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="320" y="1" width="210" height="16" key="textField"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font fontName="Times-Roman" size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{NAME}]]></textFieldExpression> </textField> </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> Link to comment Share on other sites More sharing options...
itchytoes Posted January 19, 2008 Share Posted January 19, 2008 Hi -- I was curious enough to give the jrxml file a try. I created a few rows of dummy data. It looked fine to me, but my report only shows 4 rows. I've attached an html output file. I am using JasperReports2.0.1.So, I guess I cannot duplicate your problem easily. I did not specify a DATE_FORMAT. Betty [file name=tester.html size=3845]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/tester.html[/file] Link to comment Share on other sites More sharing options...
jmbaker Posted January 21, 2008 Author Share Posted January 21, 2008 Hi, Thanks for giving it a try. Could you try with 50 rows of data? John Link to comment Share on other sites More sharing options...
itchytoes Posted January 22, 2008 Share Posted January 22, 2008 Hi -Okay, I tried with more data, but it still looks fine to me. I'm at a loss, except to ask if the blank rows are always on particular data values, or is it always in the same row positions? You do have isBlankWhenNull="true" set. Are there null data rows being returned? Maybe the blank value rows behave differently in html than for csv files? Betty Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now