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


Java JREmptyDataSource类代码示例

本文整理汇总了Java中net.sf.jasperreports.engine.JREmptyDataSource的典型用法代码示例。如果您正苦于以下问题:Java JREmptyDataSource类的具体用法?Java JREmptyDataSource怎么用?Java JREmptyDataSource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: fillReport

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
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;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:24,代码来源:VirtualizerApp.java

示例2: getPinCard

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
private JPanel getPinCard(){
  try {
    Map<String, Object> params = new HashMap<String, Object>(3);
    params.put("library", BisisApp.getINIFile().getString("pincode", "library")); //$NON-NLS-1$
    params.put("userid", mmbrship.getUserID()); //$NON-NLS-1$
    params.put("name", userData.getFirstName() + " " + userData.getLastName());//$NON-NLS-1$
    params.put("pincode", userData.getPinCode()); //$NON-NLS-1$
    
    
    JasperPrint jp = JasperFillManager.fillReport(User.class.getResource(
          "/com/gint/app/bisis4/client/circ/jaspers/pincode.jasper").openStream(),  //$NON-NLS-1$
          params, new JREmptyDataSource());
    JRViewer jr = new JRViewer(jp);
    return jr;
  } catch (Exception e) {
    e.printStackTrace();
    log.error(e);
    return null;
  }
}
 
开发者ID:unsftn,项目名称:bisis-v4,代码行数:21,代码来源:User.java

示例3: fill

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
/**
 *
 */
public void fill() throws JRException
{
	long start = System.currentTimeMillis();
	Map<String, Object> parameters = new HashMap<String, Object>();
	try
	{
		JRCsvDataSource xyds = new JRCsvDataSource(JRLoader.getLocationInputStream("data/xyDatasource.csv"), "UTF-8");
		xyds.setRecordDelimiter("\r\n");
		xyds.setUseFirstRowAsHeader(true);
		parameters.put("xyDatasource", xyds);
	}
	catch (Exception e)
	{
		throw new JRException(e);
	}
	JasperFillManager.fillReportToFile("build/reports/XYChart.jasper", new HashMap<String, Object>(parameters), new JREmptyDataSource());
	System.err.println("Filling time : " + (System.currentTimeMillis() - start));
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:XChartApp.java

示例4: fill

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
/**
 *
 */
public void fill() throws JRException
{
	long start = System.currentTimeMillis();
	JasperFillManager.fillReportToFile(
		"build/reports/Report1.jasper",
		null, 
		new JREmptyDataSource(2)
		);
	JasperFillManager.fillReportToFile(
		"build/reports/Report2.jasper",
		null, 
		new JREmptyDataSource(2)
		);
	JasperFillManager.fillReportToFile(
		"build/reports/Report3.jasper",
		null, 
		new JREmptyDataSource(2)
		);
	System.err.println("Filling time : " + (System.currentTimeMillis() - start));
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:24,代码来源:BatchExportApp.java

示例5: fill

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
/**
	 *
	 */
	public void fill() throws JRException
	{
		long start = System.currentTimeMillis();
		Locale locale = chooseLocale();
		if (locale != null)
		{
//					Object[] aw = new Object[] {new Double(1000000.45), "$", "Ferrari", new Integer(20),new Integer(88)};
			Map<String, Object> parameters = new HashMap<String, Object>();
			parameters.put("number", new Double(1234567 + Math.random()));
//					parameters.put("array", aw);
			parameters.put(JRParameter.REPORT_LOCALE, locale);
			JasperFillManager.fillReportToFile("build/reports/I18nReport.jasper", parameters, new JREmptyDataSource());
			System.err.println("Filling time : " + (System.currentTimeMillis() - start));
		}
	}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:I18nApp.java

示例6: generateReport

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
/**
 * @deprecated user
 *             {@link #generateReport(boolean, boolean, Map, String, Map, List)}
 */
@Deprecated
@Override
public void generateReport(boolean dataSource, Map<String, Object> params,
		String type, Map<String, Object> listFilters, List<String> listOrder)
		throws ReportException {

	if (!dataSource) {
		this.exportReport.exportAvancedReport(
				this.builReport(params, listFilters, listOrder),
				new JREmptyDataSource(), params, type);
	} else {
		this.exportReport.exportAvancedReport(
				this.builReport(params, listFilters, listOrder),
				this.getDataSourceCustom(listFilters, listOrder), params,
				type);
	}

}
 
开发者ID:fpuna-cia,项目名称:karaku,代码行数:23,代码来源:KarakuBaseReportAdvanced.java

示例7: createSubreport1

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
private JasperReportBuilder createSubreport1() {
	TextFieldBuilder<String> textField2 = cmp.text("text2");
	labelExpression2 = textField2.getComponent().getValueExpression();
	TextFieldBuilder<String> textField4 = cmp.text("text4");
	labelExpression4 = textField4.getComponent().getValueExpression();

	JasperReportBuilder report = report();
	report.title(textField2.setTableOfContentsHeading(tableOfContentsHeading()));
	report.title(cmp.subreport(createSubreport2()));
	report.title(textField4.setTableOfContentsHeading(tableOfContentsHeading()));
	report.detailHeader(cmp.verticalGap(10));
	report.setDataSource(new JREmptyDataSource(50));
	return report;
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:15,代码来源:TableOfContents3Test.java

示例8: build

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
private void build() {
	try {
		report()
		  .setTemplate(Templates.reportTemplate)
		  .setPageColumnsPerPage(2)
		  .setPageColumnSpace(10)
		  .columns(
		  	col.reportRowNumberColumn("Report row"),
		  	col.pageRowNumberColumn("Page row"),
		  	col.columnRowNumberColumn("Page column row"))
		  .title(Templates.createTitleComponent("RowNumberColumns"))
		  .pageFooter(Templates.footerComponent)
		  .setDataSource(new JREmptyDataSource(150))
		  .show();
	} catch (DRException e) {
		e.printStackTrace();
	}
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:19,代码来源:RowNumberColumnsReport.java

示例9: build

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
protected JasperPrint build() throws ProcessingException {
  if (content == null) {
    throw new IllegalArgumentException("content must be set");
  }
  if (headerFooterTemplatePath == null) {
    throw new IllegalArgumentException("Default Header/Footer Template is missing");
  }
  try {
    String reportDir = IOUtility.getFilePath(headerFooterTemplatePath);
    TemplateStylesBuilder styles = DynamicReports.stl.loadStyles(reportDir + FMilaUtility.FILE_SEPARATOR + "styles.jrtx");
    tableLeft = styles.getStyle("table.left");
    tableRight = styles.getStyle("table.right");
    int size = content.size();

    SubreportBuilder tableSubreport = cmp.subreport(new TableSubreportExpression()).setDataSource(new TableSubreportDataSourceExpression(content));

    JasperReportBuilder report = DynamicReports.report().setTemplate(DynamicTemplate.reportTemplate).setParameters(parameters).detail(tableSubreport, cmp.verticalGap(20)).setDataSource(new JREmptyDataSource(size));

    // Header Footer
    InputStream headerFooterTemplate = new FileInputStream(headerFooterTemplatePath);
    report.setTemplateDesign(headerFooterTemplate);

    return report.toJasperPrint();
  }
  catch (DRException | FileNotFoundException e) {
    throw new ProcessingException("Failed creating Report", e);
  }
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:29,代码来源:GenericTableDynamicReport.java

示例10: getPrint

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
private JPanel getPrint(){
	
    try{
	    JasperPrint jp = JasperFillManager.fillReport(
	              User.class.getResource(
	                "/com/gint/app/bisis4/client/circ/jaspers/empty.jasper").openStream(), 
	                null, new JREmptyDataSource());
	    jr = new JRViewer(jp);
	    return jr;
    }catch (Exception e){
    	e.printStackTrace();
    	return null;
    }
}
 
开发者ID:unsftn,项目名称:bisis-v4,代码行数:15,代码来源:ReportResults.java

示例11: setPrint

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
public static JasperPrint setPrint(Date start, Date end)
		throws IOException {
	
	Map<String, Object> params = new HashMap<String, Object>(5);
	
	if (start == null) {
		end = Utils.setMaxDate(end);
		start = Utils.setMinDate(end);
	} else if (end == null) {
		end = Utils.setMaxDate(start);
		start = Utils.setMinDate(start);
	} else {
		start = Utils.setMinDate(start);
		end = Utils.setMaxDate(end);
	}
	
	params.put("begdate", Utils.toLocaleDate(start));
	params.put("enddate", Utils.toLocaleDate(end));
	
	PictureBooksReportCommand pictureBooks = new PictureBooksReportCommand(start, end);
	pictureBooks = (PictureBooksReportCommand)Cirkulacija.getApp().getService().executeCommand(pictureBooks);
	List l= pictureBooks.getList();
	Object[] row = (Object[])l.get(0);
	params.put("users", ((Long)row[0]).toString());
	params.put("lend", ((Long)row[1]).toString());
	params.put("return", ((Long)row[2]).toString());
	
	try {

		JasperPrint jp = JasperFillManager.fillReport(Picturebooks.class.getResource(
										"/com/gint/app/bisis4/client/circ/jaspers/picturebooks.jasper")
								.openStream(), params, new JREmptyDataSource());
		return jp;
	} catch (JRException e) {
		e.printStackTrace();
		return null;
	}
}
 
开发者ID:unsftn,项目名称:bisis-v4,代码行数:39,代码来源:Picturebooks.java

示例12: fill

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
/**
 *
 */
public void fill() throws JRException
{
	long start = System.currentTimeMillis();
	JasperFillManager.fillReportToFile("build/reports/UnicodeReport.jasper", null, new JREmptyDataSource());
	System.err.println("Filling time : " + (System.currentTimeMillis() - start));
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:UnicodeApp.java

示例13: fill

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
/**
 *
 */
public void fill() throws JRException
{
	long start = System.currentTimeMillis();
	JasperFillManager.fillReportToFile("build/reports/Barcode4JReport.jasper", null, new JREmptyDataSource());
	System.err.println("Filling time : " + (System.currentTimeMillis() - start));
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:Barcode4JApp.java

示例14: fill

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
/**
 *
 */
public void fill() throws JRException
{
	long start = System.currentTimeMillis();
	JasperFillManager.fillReportToFile("build/reports/PdfEncryptReport.jasper", null, new JREmptyDataSource());
	System.err.println("Filling time : " + (System.currentTimeMillis() - start));
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:PdfEncryptApp.java

示例15: fill

import net.sf.jasperreports.engine.JREmptyDataSource; //导入依赖的package包/类
/**
 *
 */
public void fill() throws JRException
{
	long start = System.currentTimeMillis();
	JasperFillManager.fillReportToFile("build/reports/FormsReport.jasper", null, new JREmptyDataSource());
	System.err.println("Filling time : " + (System.currentTimeMillis() - start));
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:FormsApp.java


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