Examples of JRFileVirtualizer


Examples of net.sf.jasperreports.engine.fill.JRFileVirtualizer

   *
   */
  public void export() throws JRException
  {
    // creating the virtualizer
    JRFileVirtualizer virtualizer = new JRFileVirtualizer(2, "tmp");

    JasperPrint jasperPrint = fillReport(virtualizer);

    exportPdf(jasperPrint);
    exportXml(jasperPrint, false);
    exportHtml(jasperPrint);
    exportCsv(jasperPrint);
   
    // manually cleaning up
    virtualizer.cleanup();
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.fill.JRFileVirtualizer

 

  private static JasperPrint fillReport() throws JRException
  {
    // creating the virtualizer
    JRFileVirtualizer virtualizer = new JRFileVirtualizer(2, "tmp");
   
    return fillReport(virtualizer);
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.fill.JRFileVirtualizer

        }

        if (report.isVirtualizationEnabled())
        {
          log.debug("Virtualization Enabled");
          virtualizer = new JRFileVirtualizer(2, directoryProvider.getTempDirectory());
          reportParameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);
        }
       
        reportInput.setParameters(reportParameters);
        reportInput.setInlineImages(true);       
View Full Code Here

Examples of net.sf.jasperreports.engine.fill.JRFileVirtualizer

      reportLogProvider.insertReportLog(reportLog);           

      if (report.isVirtualizationEnabled() && exportType != ExportType.IMAGE)
      {
        log.debug("Virtualization Enabled");
        virtualizer = new JRFileVirtualizer(2, directoryProvider.getTempDirectory());
        reportParameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);
      }

      ReportEngineInput reportInput = new ReportEngineInput(report, reportParameters);
      reportInput.setExportType(exportType);
View Full Code Here

Examples of net.sf.jasperreports.engine.fill.JRFileVirtualizer

   * @param tmpDirectory the tmp directory
   *
   * @return the virtualizer
   */
  public JRFileVirtualizer getVirtualizer(int maxNumOfPages, String tmpDirectory) {
    JRFileVirtualizer virtualizer = null;
   
    logger.debug("Max page cached during virtualization process: " + maxNumOfPages);
    logger.debug("Dir used as storing area during virtualization: " + tmpDirectory);
    virtualizer = new JRFileVirtualizer(maxNumOfPages, tmpDirectory);
    virtualizer.setReadOnly(true);
   
    return virtualizer;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.fill.JRFileVirtualizer

     
      int maxNumOfPages = exporterConfig.getMaxNumOfPages();
      logger.debug("Max number of pages is equal to [" + maxNumOfPages + "]");
     
     
      params.put(JRParameter.REPORT_VIRTUALIZER, new JRFileVirtualizer(maxNumOfPages, pagingDir.toString()));
      logger.debug("Virtualizer succesfully created");
    }
   
    return params;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.fill.JRFileVirtualizer

   *
   * @return the virtualizer
   */
  public JRFileVirtualizer getVirtualizer(String tmpDirectory, ServletContext servletContext) {
    logger.debug("IN");
    JRFileVirtualizer virtualizer = null;

    SourceBean config = EnginConf.getInstance().getConfig();
    String maxSizeStr = (String)config.getAttribute("VIRTUALIZER.maxSize");
    int maxSize = 2;
    if(maxSizeStr!=null) maxSize = Integer.parseInt(maxSizeStr);
    String dir = (String)config.getAttribute("VIRTUALIZER.dir");
    if(dir == null){
      dir = tmpDirectory;
    } else {
      if(!dir.startsWith("/")) {
        String contRealPath = servletContext.getRealPath("/");
        if(contRealPath.endsWith("\\")||contRealPath.endsWith("/")) {
          contRealPath = contRealPath.substring(0, contRealPath.length()-1);
        }
        dir = contRealPath + "/" + dir;
      }
    }
    dir = dir + System.getProperty("file.separator") + "jrcache";
    File file = new File(dir);
    file.mkdirs();
    logger.debug("Max page cached during virtualization process: " + maxSize);
    logger.debug("Dir used as storing area during virtualization: " + dir);
    virtualizer = new JRFileVirtualizer(maxSize, dir);
    virtualizer.setReadOnly(false);
    logger.debug("OUT");
    return virtualizer;
  }
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.