Textfield border is not visible when rendering empty string using html exporterWhen drawing table in JasperReports i'm not using lines, but placing text or static fields with borders set on them. Problem occures when there is empty string. Border is not rendered then. I think it is common problem to html, because in html tables you need to place & n b s p ; . In JasperReports nbsp will be rendered as nbsp in pdf exporter as well in html. If cell is empty you can place space instead of empty string. But what in case BigDecimal, Date or some other type?
The source causing this problem is in net.sf.jasperreports.engine.export.JRHtmlExporter .
emptyCellStringProvider =
new StringProvider()
{
public String getStringForCollapsedTD(Object value, int width, int height, String sizeUnit)
{
return " style=\"width: " + width + sizeUnit + "; height: " + height + sizeUnit + ";\">";
}
public String getStringForEmptyTD(Object value)
{
return "";
}
};
It is not possible to specify other emptyCellStringProvider. At least in 1.3.4 and 2.0.4 versions.
I think the line returning empty string should look as follows:
public String getStringForEmptyTD(Object value)
{
return " ";
}
Unfortunately i was unable to findout other way than to download sources, fix problem and make jar by myself.
Labels: JasperReports