PDF File is blank


my problem is, if i compile my project, jasper library create a empty ( blank ) pdf file. Does anyone know, where the problem is?



public static void main(String[] args) throws Throwable {
        JasperReport jasperReport;
        JasperPrint jasperPrint;
        Map<String, Object> parameter = new HashMap<String, Object>();
        parameter.put("aParameter", "hallo");
        try {
            jasperReport = JasperCompileManager
            jasperPrint = JasperFillManager.fillReport(jasperReport, parameter);
        } catch (JRException e) {
<?xml version="1.0" encoding="UTF-8"  ?>
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport name="Example1">
<parameter name="aParameter" class="java.lang.String"/>
  <band height="150">
   <textField >
    <reportElement x="200" y="60" width="200" height="50" />     
    <textElement><font size="36"/></textElement>
    <textFieldExpression class="java.lang.String"><![CDATA[$P{aParameter}]]></textFieldExpression>

I hope anyone can help me :D

Best regards! Chris

kiasu_wc3's picture
Joined: Jul 22 2013 - 8:34am
Last seen: 9 years 8 months ago

1 Answer:

Hi Kiasu,

I think you need to specify somewhere where does your report gets the data.
A sort of connection string.

Have you tested the report in iReport!?

Kind regards,


pssp25's picture
Joined: Feb 28 2013 - 6:58am
Last seen: 9 years 8 months ago