I have a table in iReport which generates to a PDF correctly:
<componentElement>
<reportElement key="server vendor table" style="table" x="272" y="437" width="150" height="115"/>
<jr:table>
<jr:column width="50">
<jr:columnHeader style="table_CH" height="15" rowSpan="1">
<staticText>
<reportElement x="5" y="0" width="45" height="15"/>
<textElement/>
<text><![CDATA[Server Vendor]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="18" rowSpan="1">
<textField>
<reportElement x="5" y="0" width="45" height="15"/>
<textElement/>
<textFieldExpression><![CDATA[$F{vendor}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50">
<jr:columnHeader style="table_CH" height="15" rowSpan="1">
<staticText>
<reportElement x="5" y="0" width="45" height="15"/>
<textElement/>
<text><![CDATA[# Hosts]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="18" rowSpan="1">
<textField>
<reportElement x="5" y="0" width="45" height="15"/>
<textElement/>
<textFieldExpression><![CDATA[$F{count}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50">
<jr:columnHeader style="table_CH" height="15" rowSpan="1">
<staticText>
<reportElement x="5" y="0" width="45" height="15"/>
<textElement/>
<text><![CDATA[Host %]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="18" rowSpan="1">
<textField>
<reportElement x="5" y="0" width="45" height="15"/>
<textElement/>
<textFieldExpression><![CDATA[$F{pc}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
When generating the report from iReport, the PDF is generated correctly, the result is:

But when generated using Java the text entry for “HP” in the first column is split across multiple lines:

Note that only the “HP” text is split – longer text with a space in it (e.g. “Dell inc.”) is not split.
I’m guessing that I need to set some properties, but I can’t see figure out which property I need to set.
Class.forName("org.postgresql.Driver");
Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5432/hardwaredata","???","???");
InputStream input = new FileInputStream(new File("/reports/hardware_report.jrxml"));
JasperDesign design = JRXmlLoader.load(input);
input.close();
Map<String, Object> param_map = new HashMap<String, Object>();
JasperReport jReport = JasperCompileManager.compileReport(design);
JasperPrint jPrint = JasperFillManager.fillReport(jReport, param_map, conn);
String path = application.getRealPath("/") + "/"+"static_report.pdf";
JasperExportManager.exportReportToPdfFile(jPrint, path);
I have seen this before. I don’t recall finding the true cause. Equally strangely (but happily) I found that strings like “HP ” don’t exhibit this behavior.
Try changing your text field to display this:
$F{Vendor} + " "Be sure to also log a bug! But that might be good enough to solve immediate problems.