【问题标题】:Create generic file for DynamicReports为 DynamicReports 创建通用文件
【发布时间】:2016-08-09 12:58:29
【问题描述】:

我有一个包含许多目录(超过 200 个)的 Web 应用程序,我想为它们创建 PDFXSL 报告。用户只有按表参数过滤。 要创建报告,我正在考虑使用DynamicReports 库。通过网站中的示例,我看到以下代码:

JasperReportBuilder report = DynamicReports.report();//a new report
report
  .columns(
      Columns.column("Customer Id", "id", DataTypes.integerType()),
      Columns.column("First Name", "first_name", DataTypes.stringType()),
      Columns.column("Last Name", "last_name", DataTypes.stringType()),
      Columns.column("Date", "date", DataTypes.dateType()))
  .title(//title of the report
      Components.text("SimpleReportExample")
      .setHorizontalAlignment(HorizontalAlignment.CENTER))
      .pageFooter(Components.pageXofY())//show page number on the page footer
      .setDataSource("SELECT id, first_name, last_name, date FROM customers",
                              connection);

所以,我之前说过,我有很多目录,我不想手动列出每个表的所有表参数。

如何创建通用类,它将自动创建字段或建议我一些有用的提示。 帮助我进行应用程序设计。谢谢

【问题讨论】:

    标签: java report reporting dynamic-reports


    【解决方案1】:

    我也使用相同的动态报告来生成报告。在这里我要做的是,我将上传包含报告信息的 json 文件,如查询 id、应显示的列及其样式等。通过解析 json,我将获得所有详细信息,通过执行查询,我将获得数据。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多