当前位置: 首页>>代码示例>>Java>>正文


Java JRTextExporter.setConfiguration方法代码示例

本文整理汇总了Java中net.sf.jasperreports.engine.export.JRTextExporter.setConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java JRTextExporter.setConfiguration方法的具体用法?Java JRTextExporter.setConfiguration怎么用?Java JRTextExporter.setConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.jasperreports.engine.export.JRTextExporter的用法示例。


在下文中一共展示了JRTextExporter.setConfiguration方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: saveTxtReportToFile

import net.sf.jasperreports.engine.export.JRTextExporter; //导入方法依赖的package包/类
/**
 * Generates a plain text report from a pre-compiled report and returns it into a file.
 * 
 * @param jasperPrint
 *          JasperPrint object which contains a compiled report.
 * @param file
 *          The file used to return the report.
 * @throws JRException
 *           In case there is any error generating the report an exception is thrown with the
 *           error message.
 */
private static void saveTxtReportToFile(JasperPrint jasperPrint, File file) throws JRException {
  final JRTextExporter textExporter = new JRTextExporter();
  SimpleExporterInput exporterInput = new SimpleExporterInput(jasperPrint);
  SimpleWriterExporterOutput exporterOutput = new SimpleWriterExporterOutput(file);

  // Default text configuration that can be overridden in the .jrxml template itself
  SimpleTextExporterConfiguration textExporterConfiguration = new SimpleTextExporterConfiguration();
  textExporterConfiguration.setOverrideHints(false);
  textExporter.setConfiguration(textExporterConfiguration);
  // Default item text configuration that can be overridden in the .jrxml template itself
  SimpleTextReportConfiguration textReportConfiguration = new SimpleTextReportConfiguration();
  textReportConfiguration.setCharHeight(new Float(TEXT_CHAR_HEIGHT));
  textReportConfiguration.setCharWidth(new Float(TEXT_CHAR_WIDTH));
  textReportConfiguration.setOverrideHints(false);
  textExporter.setConfiguration(textReportConfiguration);

  textExporter.setExporterInput(exporterInput);
  textExporter.setExporterOutput(exporterOutput);
  textExporter.exportReport();
}
 
开发者ID:mauyr,项目名称:openbravo-brazil,代码行数:32,代码来源:ReportingUtils.java

示例2: saveTxtReportToOutputStream

import net.sf.jasperreports.engine.export.JRTextExporter; //导入方法依赖的package包/类
/**
 * Generates a plain text report from a pre-compiled report and returns it into an output stream.
 * 
 * @param jasperPrint
 *          JasperPrint object which contains a compiled report.
 * @param outputStream
 *          The output stream used to return the report.
 * @throws JRException
 *           In case there is any error generating the report an exception is thrown with the
 *           error message.
 */
private static void saveTxtReportToOutputStream(JasperPrint jasperPrint, OutputStream outputStream)
    throws JRException {
  final JRTextExporter textExporter = new JRTextExporter();
  SimpleExporterInput exporterInput = new SimpleExporterInput(jasperPrint);
  SimpleWriterExporterOutput exporterOutput = new SimpleWriterExporterOutput(outputStream);

  // Default text configuration that can be overridden in the .jrxml template itself
  SimpleTextExporterConfiguration textExporterConfiguration = new SimpleTextExporterConfiguration();
  textExporterConfiguration.setOverrideHints(false);
  textExporter.setConfiguration(textExporterConfiguration);
  // Default item text configuration that can be overridden in the .jrxml template itself
  SimpleTextReportConfiguration textReportConfiguration = new SimpleTextReportConfiguration();
  textReportConfiguration.setCharHeight(new Float(TEXT_CHAR_HEIGHT));
  textReportConfiguration.setCharWidth(new Float(TEXT_CHAR_WIDTH));
  textReportConfiguration.setOverrideHints(false);
  textExporter.setConfiguration(textReportConfiguration);

  textExporter.setExporterInput(exporterInput);
  textExporter.setExporterOutput(exporterOutput);
  textExporter.exportReport();
}
 
开发者ID:mauyr,项目名称:openbravo-brazil,代码行数:33,代码来源:ReportingUtils.java

示例3: getExporter

import net.sf.jasperreports.engine.export.JRTextExporter; //导入方法依赖的package包/类
@Override
protected JRTextExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
	JRTextExporter exp = new JRTextExporter(jContext);
	exp.setExporterOutput(new SimpleWriterExporterOutput(file));

	exp.setConfiguration(new SimpleTextExporterConfiguration());

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

	return exp;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:14,代码来源:ExportAsTextAction.java

示例4: saveTxtReport

import net.sf.jasperreports.engine.export.JRTextExporter; //导入方法依赖的package包/类
/**
 * Generates a plain text report using the SimpleExporterInput, SimpleWriterExporterOutput,
 * SimpleTextExporterConfiguration and SimpleTextReportConfiguration received as parameters.
 * 
 * @param exporterInput
 *          SimpleExporterInput object with the input data.
 * @param exporterOutput
 *          SimpleWriterExporterOutput object with the output data.
 * @param textExporterConfiguration
 *          SimpleTextExporterConfiguration with the configuration data.
 * @param textReportConfiguration
 *          SimpleTextReportConfiguration with the item configuration data.
 * @throws JRException
 *           In case there is any error generating the report an exception is thrown with the
 *           error message.
 */
public static void saveTxtReport(SimpleExporterInput exporterInput,
    SimpleWriterExporterOutput exporterOutput,
    SimpleTextExporterConfiguration textExporterConfiguration,
    SimpleTextReportConfiguration textReportConfiguration) throws JRException {
  final JRTextExporter textExporter = new JRTextExporter();
  textExporter.setExporterInput(exporterInput);
  textExporter.setExporterOutput(exporterOutput);
  textExporter.setConfiguration(textExporterConfiguration);
  textExporter.setConfiguration(textReportConfiguration);
  textExporter.exportReport();
}
 
开发者ID:mauyr,项目名称:openbravo-brazil,代码行数:28,代码来源:ReportingUtils.java


注:本文中的net.sf.jasperreports.engine.export.JRTextExporter.setConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。