Package net.sf.jasperreports.engine.export

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


  public static void exportReportToHtmlFile(
    JasperPrint jasperPrint,
    String destFileName
    ) throws JRException
  {
    JRHtmlExporter exporter = new JRHtmlExporter();
   
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFileName);
   
    exporter.exportReport();
  }
View Full Code Here


          getBundleString("save"),
          JOptionPane.OK_CANCEL_OPTION
          )
      )
    {
      JRHtmlExporter exporter = new JRHtmlExporter();
      exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
      exporter.setParameter(JRExporterParameter.OUTPUT_FILE, file);
      exporter.exportReport();
    }
  }
View Full Code Here

    JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);

    File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".html");

    JRHtmlExporter exporter = new JRHtmlExporter();

    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString());

    exporter.exportReport();

    System.err.println("HTML creation time : " + (System.currentTimeMillis() - start));
  }
View Full Code Here

          jasperReport,
          parameters,
          new WebappDataSource()
          );
           
      JRHtmlExporter exporter = new JRHtmlExporter();
   
      request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, jasperPrint);
     
      exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
      exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out);
      exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?image=");
     
      exporter.exportReport();
    }
    catch (JRException e)
    {
      out.println("<html>");
      out.println("<head>");
View Full Code Here

    JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);

    File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".html");
   
    JRHtmlExporter exporter = new JRHtmlExporter();
   
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString());
    exporter.setParameter(JRHtmlExporterParameter.BETWEEN_PAGES_HTML, "");
    exporter.setParameter(JRHtmlExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);
   
    exporter.exportReport();

    System.err.println("HTML creation time : " + (System.currentTimeMillis() - start));
  }
View Full Code Here

    List jasperPrintList = new ArrayList();
    jasperPrintList.add(JRLoader.loadObjectFromLocation("build/reports/Report1.jrprint"));
    jasperPrintList.add(JRLoader.loadObjectFromLocation("build/reports/Report2.jrprint"));
    jasperPrintList.add(JRLoader.loadObjectFromLocation("build/reports/Report3.jrprint"));
   
    JRHtmlExporter exporter = new JRHtmlExporter();
   
    exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST, jasperPrintList);
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "build/reports/BatchExportReport.html");
   
    exporter.exportReport();
   
    System.err.println("HTML creation time : " + (System.currentTimeMillis() - start));
  }
View Full Code Here

                // 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

      }
      else
      {
        engineOutput.setContentType(ReportEngineOutput.CONTENT_TYPE_HTML);
       
        exporter = new JRHtmlExporter();

        exporter.setParameter(
            JRHtmlExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,
            new Boolean(exportOptions.isHtmlRemoveEmptySpaceBetweenRows()));
View Full Code Here

        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        if (jasperPrint == null) {
            throw new ReportingException("jasperPrint null, can't convert to HTML report");
        }
        try {
            JRHtmlExporter jrHtmlExporter = new JRHtmlExporter();
            jrHtmlExporter.setParameter(JRHtmlExporterParameter.JASPER_PRINT, jasperPrint);
            jrHtmlExporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, true);
            // To generate a HTML report we want configure ImageServlet in component.xml file of reporting UI bundle
            // Then want to set the  IMAGES_URI parameter
            jrHtmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "../servlets/image?image=");
            //  remove empty spaces
            jrHtmlExporter.setParameter(JRHtmlExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);
            jrHtmlExporter.setParameter(JRHtmlExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.TRUE);
            jrHtmlExporter.setParameter(JRHtmlExporterParameter.OUTPUT_STREAM, outputStream);
            jrHtmlExporter.exportReport();

        } catch (JRException e) {
            throw new JRException("Error occurred exporting HTML report ", e);
        }
        return outputStream;
View Full Code Here

                        // 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);
                        request.getSession().setAttribute("net.sf.jasperreports.j2ee.jasper_print", jasperPrint);
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.export.JRHtmlExporter$StringProvider

Copyright © 2018 www.massapicom. 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.