title: Simple Jasper report without a database
body: <p>I'm totally new in jasperforge || jasperreports and I wish to generate a simple pdf report using only an ireport empty template and <strong>no database connections</strong>.</p>
  
  <p>I tried to adapt some simple program to just export the PDF without no data and tried the following code:</p>
  
  <pre><code>import java.io.File;
  import java.util.HashMap;
  import net.sf.jasperreports.engine.JREmptyDataSource;
  import net.sf.jasperreports.engine.JRException;
  import net.sf.jasperreports.engine.JRExporter;
  import net.sf.jasperreports.engine.JRExporterParameter;
  import net.sf.jasperreports.engine.export.JRPdfExporter;
  import net.sf.jasperreports.engine.JasperExportManager;
  import net.sf.jasperreports.engine.JasperFillManager;
  import net.sf.jasperreports.engine.JasperPrint;
  import net.sf.jasperreports.engine.JasperPrintManager;
  import net.sf.jasperreports.engine.util.JRLoader;
  
  
  public class JasperTest {
  
      public void generateReport() throws ClassNotFoundException, InstantiationException, IllegalAccessException, JRException {
          System.out.println("Filling report...");
          JasperPrint print = JasperFillManager.fillReport(jasper_filename, hm);
          JRExporter exporter = new JRPdfExporter();
          exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, pdf_filename);
          exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
          exporter.exportReport();
          System.out.println("Created file: " + pdf_filename);
          System.out.println("Done!");
      }
      String jasper_filename = "/blue_template.jasper";
      String pdf_filename = "/pdf_out.pdf";
      HashMap hm = new HashMap();
  
      public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, JRException {
          System.out.println("Hello World!");
          new JasperTest().generateReport();
      }
  }
  </code></pre>
  
  <p>,...but it didn't work. I needed to add the following libraries to the project:</p>
  
  <ul>
  <li>commons-logging</li>
  <li>commons-digester</li>
  <li>commons-collections</li>
  </ul>
  
  <p>When I tried to run the executable I've got the following error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException
  </code></pre>
  
  <p>I thought that's not related to .jasper file, that was compiled without errors in ireports, but I don't have any clue of whats happening.</p>