Java 类net.sf.jasperreports.engine.export.JRCsvMetadataExporter 实例源码

项目:jasperstarter    文件:Report.java   
public void exportCsvMeta() throws JRException {
    JRCsvMetadataExporter exporter = new JRCsvMetadataExporter();
    SimpleCsvMetadataExporterConfiguration configuration = new SimpleCsvMetadataExporterConfiguration();
    configuration.setFieldDelimiter(config.getOutFieldDel());
    exporter.setConfiguration(configuration);
      exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleWriterExporterOutput(
        this.output.getAbsolutePath() + ".csv", config.getOutCharset()));
      exporter.exportReport();
  }
项目:PDFReporter-Studio    文件:ExportAsCsvMetadataAction.java   
@Override
protected JRCsvMetadataExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor,
        File file) {
    JRCsvMetadataExporter exp = new JRCsvMetadataExporter(jContext);
    exp.setExporterOutput(new SimpleWriterExporterOutput(file));

    SimpleCsvMetadataReportConfiguration rconf = new SimpleCsvMetadataReportConfiguration();
    setupReportConfiguration(rconf, monitor);
    exp.setConfiguration(rconf);

    return exp;
}
项目:jasperreports    文件:JasperApp.java   
/**
 *
 */
public void csvMetadata() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/FirstJasper.jrprint");

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

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

    JRCsvMetadataExporter exporter = new JRCsvMetadataExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("CSV creation time : " + (System.currentTimeMillis() - start));
}