Jump to content
We've recently updated our Privacy Statement, available here ×

Recommended Posts

Hey:D

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

 

Main.java

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                    .compileReport("C:/Users/CKaus/Desktop/helloworld.jrxml");            jasperPrint = JasperFillManager.fillReport(jasperReport, parameter);            JasperExportManager.exportReportToPdfFile(jasperPrint,                    "C:/Users/CKaus/Desktop/helloworld.pdf");                   } catch (JRException e) {            e.printStackTrace();        }    }[/code]
<?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"/><detail>  <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>   </textField>  </band></detail></jasperReport>[/code]

I hope anyone can help me :D

Best regards! Chris

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...