Examples of JRHtmlExporter


Examples of net.sf.jasperreports.engine.export.JRHtmlExporter

                // IMAGES_MAPS seems to be only supported as "backward compatible" from JasperReports 1.1.0

                Map imagesMap = new HashMap();
                request.getSession(true).setAttribute("IMAGES_MAP", imagesMap);

                exporter = new JRHtmlExporter();
                exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap);
                exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, request.getContextPath() + imageServletUrl);

                // Needed to support chart images:
                exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRHtmlExporter

                // IMAGES_MAPS seems to be only supported as "backward compatible" from JasperReports 1.1.0

                Map imagesMap = new HashMap();
                request.getSession(true).setAttribute("IMAGES_MAP", imagesMap);

                exporter = new JRHtmlExporter();
                exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap);
                exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, request.getContextPath() + imageServletUrl);

                // Needed to support chart images:
                exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRHtmlExporter

   * @param writer local para gravação do arquivo
   * @param request requisição
   */
  public void geraHTML(Writer writer, HttpServletRequest request) {
    try {
      JRHtmlExporter exporter = getHtmlExporter(request);
      exporter.setParameter(JRHtmlExporterParameter.OUTPUT_WRITER, writer);
      exporter.exportReport()
    } catch (JRException e) {
      throw new GeracaoBoletoException(e);
    }
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRHtmlExporter

                // IMAGES_MAPS seems to be only supported as "backward compatible" from JasperReports 1.1.0

                Map imagesMap = new HashMap();
                request.getSession(true).setAttribute("IMAGES_MAP", imagesMap);

                exporter = new JRHtmlExporter();
                exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap);
                exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, request.getContextPath() + imageServletUrl);

                // Needed to support chart images:
                exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRHtmlExporter

                // IMAGES_MAPS seems to be only supported as "backward compatible" from JasperReports 1.1.0

                Map imagesMap = new HashMap();
                request.getSession(true).setAttribute("IMAGES_MAP", imagesMap);

                exporter = new JRHtmlExporter();
                exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap);
                exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, request.getContextPath() + imageServletUrl);

                // Needed to support chart images:
                exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRHtmlExporter

    setContentType("text/html");
  }

  @Override
  protected JRExporter createExporter() {
    return new JRHtmlExporter();
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRHtmlExporter

  public static void createHTMLReport(InputStream reportFile, GridReportVO gridReportVO,
      String path, String fileName) throws JRException, IOException {
    gridReportVO.setPagination(false);
    JasperPrint jasperPrint = createJasperPrint(reportFile, gridReportVO);
    JRHtmlExporter exporter = new JRHtmlExporter();
    Map<JRExporterParameter, Object> p = new HashMap<JRExporterParameter, Object>();
    p.put(JRHtmlExporterParameter.JASPER_PRINT, jasperPrint);
    p.put(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE);
    p.put(JRHtmlExporterParameter.OUTPUT_FILE_NAME, path + "/" + fileName);
    exporter.setParameters(p);
    exporter.exportReport();

  }
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRHtmlExporter

      if (strOutputType.equals("html")) {
        if (log4j.isDebugEnabled())
          log4j.debug("JR: Print HTML");
        // response.setHeader( "Content-disposition", "inline" +
        // "; filename=" + strFileName + "." +strOutputType);
        JRHtmlExporter exporter = new JRHtmlExporter();
        exportParameters.put(JRHtmlExporterParameter.JASPER_PRINT, jasperPrint);
        exportParameters.put(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE);
        exportParameters.put(JRHtmlExporterParameter.SIZE_UNIT,
            JRHtmlExporterParameter.SIZE_UNIT_POINT);
        exportParameters.put(JRHtmlExporterParameter.OUTPUT_STREAM, os);
        exporter.setParameters(exportParameters);
        exporter.exportReport();

      } else if (strOutputType.equals("pdf")) {
        // response.setContentType("application/pdf");
        // response.setHeader( "Content-disposition", "attachment" +
        // "; filename=" + strFileName + "." +strOutputType);
        JasperExportManager.exportReportToPdfStream(jasperPrint, os);

      } else if (strOutputType.equals("xls")) {
        // response.setContentType("application/vnd.ms-excel");
        // response.setHeader( "Content-disposition", "attachment" +
        // "; filename=" + strFileName + "." +strOutputType);
        JExcelApiExporter exporter = new JExcelApiExporter();
        exportParameters.put(JRExporterParameter.JASPER_PRINT, jasperPrint);
        exportParameters.put(JRExporterParameter.OUTPUT_STREAM, os);
        exportParameters.put(JExcelApiExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);
        exportParameters.put(JExcelApiExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,
            Boolean.TRUE);

        exporter.setParameters(exportParameters);
        exporter.exportReport();

      } else {
        throw new ServletException("Output format no supported");
      }
    } catch (JRException e) {
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRHtmlExporter

      if (strOutputType.equals("html")) {
        if (log4j.isDebugEnabled())
          log4j.debug("JR: Print HTML");
        response.setHeader("Content-disposition", "inline" + "; filename=" + strFileName + "."
            + strOutputType);
        final JRHtmlExporter exporter = new JRHtmlExporter();
        exportParameters.put(JRHtmlExporterParameter.JASPER_PRINT, jasperPrint);
        exportParameters.put(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE);
        exportParameters.put(JRHtmlExporterParameter.SIZE_UNIT,
            JRHtmlExporterParameter.SIZE_UNIT_POINT);
        exportParameters.put(JRHtmlExporterParameter.OUTPUT_STREAM, os);
        exporter.setParameters(exportParameters);
        exporter.exportReport();
      } else if (strOutputType.equals("pdf") || strOutputType.equalsIgnoreCase("xls")) {
        reportId = UUID.randomUUID();
        saveReport(variables, jasperPrint, exportParameters, strFileName + "-" + (reportId) + "."
            + strOutputType);
        response.setContentType("text/html;charset=UTF-8");
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRHtmlExporter

  @Test
  public void testRenderWithWriter() throws Exception {
    StringWriter writer = new StringWriter();
    JasperPrint print = JasperFillManager.fillReport(getReport(), getParameters(), getDataSource());
    JasperReportsUtils.render(new JRHtmlExporter(), print, writer);
    String output = writer.getBuffer().toString();
    assertHtmlOutputCorrect(output);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.