title: how to print jasper report without preview in java
body: <p>I'm generating receipt using <em>JasperReports</em> but i want to print it automatically or just program the attributes without previewing its output. What could be the possible codes.</p>
  
  <pre><code>try {
      String get1 = lblORNum.getText();
      String get2 = lblInfoID.getText();
      JasperDesign jd = JRXmlLoader.load("directory");
      String sql = "select * from student, transaction, cashier where transaction.orNum=" + get1 + " AND student.id='" + get2 + "'";
      JRDesignQuery query = new JRDesignQuery();
      query.setText(sql);
      jd.setQuery(query);
      JasperReport jr = JasperCompileManager.compileReport(jd);
      JasperPrint jp = JasperFillManager.fillReport(jr, null, conn);
      JasperViewer.viewReport(jp, false);
  } catch (Exception e) {
      System.out.println(e.toString());
  }
  </code></pre>