本文整理汇总了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;
}
示例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;
}
}
示例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));
}
示例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));
}
示例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));
}
}
示例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);
}
}
示例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;
}
示例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();
}
}
示例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);
}
}
示例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;
}
}
示例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;
}
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}