title: JasperReports API: How to pass multiple parameters to report
body: <p>I am using <em>JasperReports API</em> to print from my <em>Java</em> application. I am printing a report like this:</p>
  
  <pre><code>public void prints(String billNo, String fileName, String outFileName, String perameterName) {
      HashMap hm = new HashMap();
      hm.put(perameterName, billNo);
      //Here parameterName is the parameter in JasperReport.
      // billNo is the value from my java application.
  
      try {
          conn = new connection().db();
          PrinterJob job = PrinterJob.getPrinterJob();
          /* Create an array of PrintServices */
          PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
          PrintService default_service = PrintServiceLookup.lookupDefaultPrintService();
          int selectedService = 0;
          /* Scan found services to see if anyone suits our needs */
          for (int i = 0; i &lt; services.length; i++) {
              if (services[i].getName().toUpperCase().equals(default_service.getName().toUpperCase())) {
                  selectedService = i;
              }
          }
          job.setPrintService(services[selectedService]);
          PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet();
          printRequestAttributeSet.add(MediaSizeName.ISO_A4);
          printRequestAttributeSet.add(new Copies(1));
          JRPrintServiceExporter exporter;
          exporter = new JRPrintServiceExporter();
  
          JasperPrint print = JasperFillManager.fillReport(fileName, hm, conn);
          JRExporter exporterr = new JRPdfExporter();
          exporterr.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outFileName);
          exporterr.setParameter(JRExporterParameter.JASPER_PRINT, print);
  
          exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
          exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE, services[selectedService]);
          exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, services[selectedService].getAttributes());
          exporter.setParameter(JRPrintServiceExporterParameter.PRINT_REQUEST_ATTRIBUTE_SET, printRequestAttributeSet);
          exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE);
          exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.FALSE);
          exporter.exportReport();
          exporterr.exportReport();
      } catch (JRException e) {
          JOptionPane.showMessageDialog(null, e);
      } catch (Exception e) {
          JOptionPane.showMessageDialog(null, "Printer not connected. Check power cable.");
      }
  } 
  </code></pre>
  
  <p>I use to invoke this method in other classes.<br/>
  But how can I pass multiple Parameters and multiple values to report?
  for example query:</p>
  
  <pre><code>"select * from table1 where date&gt;"+thisDate+" and date&lt;"+thatDate+" "
  </code></pre>
  
  <p>How can I send <em>thisDate</em> and <em>thatDate</em> from my <em>Java</em> application?</p>