title: how to generate a .jasper from a .jrxml in java?
body: <p>I've 1 <em>mainreport.xrml</em> and this report has a <em>subreport.xrml</em>.</p>
  
  <p>So when I compile my report without giving the report any reference to my <em>subreport</em> it generates my report fine, but when I give the reference inside the <em>report.xrml</em> to my <em>subreport</em>, it asks me for my <em>subreport.jasper</em></p>
  
  <p>Here is my java code to do the compiling:</p>
  
  <pre><code>JasperReport report = null;
  JasperReport report2 = null;
  JasperPrint jasperPrint = null;
  StringBuilder pathReport = new StringBuilder();
  try {
      name = config.getProperty(Constants.PATH_JRXML) + name + SUFFIX;
      String name2 = "";
      if (tipoReporte.equals("mensual")) {
  
      } else {
          int a = 0;
          name2 = "C:\\mail\\reporteIncidenciasDiarias.jrxml";
          report2 = JasperCompileManager.compileReport(name2);
      }
  
      report = JasperCompileManager.compileReport(name);
  
      jasperPrint = JasperFillManager.fillReport(report, mapParams,
              new JRBeanCollectionDataSource(params));
  
      pathReport.append(config.getKeyValue(Constants.PATH_REPORT));
  
      String nombreReporte = config.getKeyValue(Constants.NAME_REPORT);
      if (tipoReporte.equals("mensual")) {
          nombreReporte += "Mensual";
      } else {
          nombreReporte += "Diario";
      }
  
      pathReport.append(nombreReporte);
      pathReport.append(DateUtils.formatear(new Date(), Constants.PATTERN_DATE_2));
      pathReport.append(Constants.FILE_EXT);
  
      JasperExportManager.exportReportToPdfFile(jasperPrint, pathReport.toString());
      logger.info("Reporte generado " + pathReport);
  
  } catch (JRException e) {
      logger.error(e);
      throw new Exception(e);
  } catch (Exception ex) {
      logger.error(ex);
      throw new Exception(ex);
  }
  return pathReport.toString();
  </code></pre>
  
  <p>What should I do so it doesn't ask me for my <em>subreport.jasper</em> or how can I get my <em>subreport.jasper</em>?</p>