Java 类net.sf.jasperreports.engine.fill.JRFileVirtualizer 实例源码

项目:jasperreports    文件:VirtualizerApp.java   
private static JasperPrint fillReport(JRFileVirtualizer virtualizer) throws JRException
{
    long start = System.currentTimeMillis();

    // Virtualization works only with in memory JasperPrint objects.
    // All the operations will first fill the report and then export
    // the filled object.

    // creating the data source
    JRDataSource dataSource = new JREmptyDataSource(1000);

    // Preparing parameters
    Map<String, Object> parameters = new HashMap<String, Object>();
    parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);

    // filling the report
    JasperPrint jasperPrint = JasperFillManager.fillReport("build/reports/VirtualizerReport.jasper", parameters, dataSource);

    virtualizer.setReadOnly(true);

    System.err.println("Filling time : " + (System.currentTimeMillis() - start));
    return jasperPrint;
}
项目:PDFReporter-Studio    文件:ReportExecutionPreferencePage.java   
public static void getDefaults(IPreferenceStore store) {
    store.setDefault(NSF_FILES_DELETE_ONEXIT, "true"); //$NON-NLS-1$
    store.setDefault(JSS_VIRTUALIZER_USE, "false"); //$NON-NLS-1$
    store.setDefault(JSS_VIRTUALIZER_TYPE, JRFileVirtualizer.class.getName());
    store.setDefault(JSS_VIRTUALIZER_MAX_SIZE, 100);
    store.setDefault(JSS_VIRTUALIZER_TMP, ""); //$NON-NLS-1$
    store.setDefault(JSS_VIRTUALIZER_BLOCK_SIZE, 100);
    store.setDefault(JSS_VIRTUALIZER_MIN_GROW_COUNT, 100);
    store.setDefault(JSS_VIRTUALIZER_PAGE_ELEMENT_SIZE, 1);

    store.setDefault(JSS_LIMIT_RECORDS, "false");//$NON-NLS-1$
    store.setDefault(JSS_MAX_RECORDS, -1);//$NON-NLS-1$
    store.setDefault(JSS_IGNOREPAGINATION, "false");//$NON-NLS-1$
    store.setDefault(JSS_REPORT_LOCALE, Locale.getDefault().toString());//$NON-NLS-1$
    store.setDefault(JSS_REPORT_TIMEZONE, TimeZone.getDefault().getID());//$NON-NLS-1$ 
}
项目:dynamicreports-jasper    文件:VirtualizerReport.java   
private void build() {
    TextColumnBuilder<String>     itemColumn     = col.column("Item",       "item",      type.stringType());
    TextColumnBuilder<Integer>    quantityColumn = col.column("Quantity",   "quantity",  type.integerType());
    TextColumnBuilder<BigDecimal> priceColumn    = col.column("Unit price", "unitprice", type.bigDecimalType());

    try {
        report()
          .setTemplate(Templates.reportTemplate)
          .columns(
            itemColumn, quantityColumn, priceColumn)
          .title(Templates.createTitleComponent("Virtualizer"))
          .pageFooter(Templates.footerComponent)
          .setDataSource(createDataSource())
          .setVirtualizer(new JRFileVirtualizer(2))
          .show();
    } catch (DRException e) {
        e.printStackTrace();
    }
}
项目:jasperreports    文件:VirtualizerApp.java   
/**
 *
 */
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();
}
项目:jasperreports    文件:VirtualizerApp.java   
private static JasperPrint fillReport() throws JRException
{
    // creating the virtualizer
    JRFileVirtualizer virtualizer = new JRFileVirtualizer(2, "tmp");

    return fillReport(virtualizer);
}
项目:gnvc-ims    文件:ReportGenerator.java   
/**
 * @return the jrVirtualizer
 */
public JRFileVirtualizer getJrVirtualizer() {
    return jrVirtualizer;
}
项目:gnvc-ims    文件:ReportGenerator.java   
/**
 * @param jrVirtualizer the jrVirtualizer to set
 */
public void setJrVirtualizer(JRFileVirtualizer jrVirtualizer) {
    this.jrVirtualizer = jrVirtualizer;
}
项目:dynamicreports-jasper    文件:VirtualizerTest.java   
@Override
protected void configureReport(JasperReportBuilder rb) {
    rb.title(cmp.text("title"))
      .setVirtualizer(new JRFileVirtualizer(2));
}