Complex multi-source report

  • Last update:  2022-01-26
  • I. Overview

    1. Version

    Rreport server version
    10.0

    2. Expected effect

    In the previous section, we introduced a  Simple multi-source report , and in practical applications, it is also common for the rows and columns and summary calculation data in the crosstab to come from different databases.

    As shown in the figure below, in this report, the total number of projects, the number of financial arrangements required, the unit self-raised, and other funds all come from different data sets.

    截屏2021-01-19 下午5.06.00.png

    3. Implementation ideas

    The data in this report comes from 5 different datasets. The data association of different data sets can be displayed in a table through the data column association method in the report.

    This avoids the situation of combining five data sets into a single source through complex SQL statements in the traditional report processing method, which greatly reduces the difficulty of report production and the requirements for the SQL level of report designers.

    II. Examples

    1 Report making

    1 Create a new dataset

    The data table of the database is a separate table of project ID and project name. There are also four lists of project number, financial fund, unit self financing and other funds.

    Each table establishes a relationship with the project name table through the ID field. Here are five built-in datasets:

    Note: click the Add button in the data set panel and select the built-in dataset to create a new built-in dataset and add data directly. Please check the built-in dataset for details.

    截屏2021-01-19 下午5.13.12.png

     Project name (ID, ProjectName) - project

    截屏2021-01-19 下午5.14.54.png

    Total number of items (ID, Num) - totalNum

    截屏2021-01-19 下午5.15.02.png

     Financial allocation (ID, Amount) - Financial

    截屏2021-01-19 下午5.14.40.png

    Unit self financing (ID, Amount) - Company

    5) Other funds (ID, Amount) - Other


    2) Report style

    The report style is as follows:

    截屏2021-01-19 下午5.19.19.png


    2. Data setting and filtering setting

    Drag the data column to the cell in turn, and the settings are as follows:

    Cell

    Dataset

      Column

      Setting

    B4projectproject name

    data set grouping and vertical expansion from top to bottom, other default

    C4totalNumNumdata set summary and summation, no expansion, filter condition is "data column": ID equals project.ID , other defaults
    E4FinancialAmountdata set summary and summation, no expansion, filter condition is "data column": ID equals project.ID , other defaults
    F4CompanyAmountdata set summary and summation, no expansion, filter condition is "data column": ID equals project.ID , other defaults
    G4OtherAmountdata set summary and summation, no expansion, filter condition is "data column": ID equals project.ID , other defaults

    Take C4 as an example:

    Other cells are similar and will not be explained in detail.


    3. Numbering and formula

    Write the formula in the grid where you need to add number and calculate summary, as shown in the following table:

    Cell  Formula  Other settings
      A4  =&B4in the right-click extension attribute, define its left parent as B4
      D4  =sum(E4:G4)none
      C5  =sum(C4)none
      D5  =sum(D4)none
      E5  =sum(E4)none
      F5  =sum(F4)none
      G5  =sum(G4)none

    Note: the data in this report comes from five different datasets. Through the data column association method in the report, the data association of different data sets is displayed in a table.

    In order to avoid the traditional report processing method, through the complex SQL statements, the five data sets are put together into a single source, which greatly reduces the difficulty of report making and the requirement of SQL level for report designers.


    4. Effect preview

    1) PC terminal

    Save the template and select pagination preview. The effect is as shown in I. Overview.

    2) Mobile terinal

    APP:

    6.png

    HTML5:

    7.png

    III. Template download

    For completed templates, see %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\BasicApplication\ComplexMulti.cpt

    Click download template: 

    ComplexMulti.cpt

    Attachment List


    Theme: Report Application
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy