[Original] Web report development technology Topic 2: report tool core-dataset Transformation

Source: Internet
Author: User
The last time I started the Web report development technology topic from a small serial number, I will talk about the core of the Web report development tool-dataset transformation.

1Why is dataset transformation the core of Web report development tools?

Transform a dataset, that is, the ability to perform data operation and transformation on a report.

A report consists of two parts: Data and style. Data generally comes from datasets. Style is nothing more than static text line images. For a Web report development tool, the implementation style is relatively simple. In terms of data, there are great opportunities. The data flow on a report is generally obtained by an SQL statement or a program first, and then the data in the dataset is displayed to a report file containing a static style to obtain a real report. How to Design and display the data in the transformed dataset to a report file containing a static style is a problem that must be considered first by every Web report development tool. This is the main framework of Web report development tools. The design will directly affect the development efficiency of Web report tools. Therefore, the core of the Web report development tool is dataset transformation.

2Questions about dataset Transformation:

Whether to set the association between multiple data sets in

Generally, multiple datasets are required for a report. Do you need to set the associations between multiple datasets when a report has multiple datasets, if you need to set the association relationship, you can do it in the internal program of the Web report development tool, you only need to display data in multiple sub-datasets to report files with static styles Based on the association relationship. This is not good because when the report content is significantly different from the data in the physical table of the database, it is often necessary to write complex SQL statements or programming to prepare data in the dataset. If you do not need to set the association relationship between these datasets, you need the Web report development tool to coordinate the presentation of many datasets on the report.

Can the data in the B dataset be transformed (sorted and filtered) When expanded in the report)

Whether the data in a dataset can be sorted again when it is expanded on the report, and the conditional filtering is set, and whether the data in a dataset can be expanded multiple times in the report (of course, in different locations ).

Calculation functions of the C dataset (sum with conditions, etc)

Generally, you must provide a comprehensive dataset computing function. For example, you can add conditions to sum a field.

D. is the main flow of report calculation calculated cyclically Based on records in the dataset or by formulas on cells?

Everyone who has written a report development tool knows that the report calculation process must be identified first. This is also the most important factor in judging the capabilities of a Web report tool. The advantage of using records in a dataset for cyclic computing is that it is easy to implement and report computing is fast. However, the disadvantage is that it sacrifices the flexibility of report computing, the burden of coping with complex reports is completely reduced to the data in the generated dataset. It is complicated to use formulas on cells for cyclic calculation. The reference relationship and calculation order of cells must be processed. However, this computing mode is conducive to coping with complicated Chinese-style reports.

How do I place data in the E dataset on the report?

It is clear that the data in the dataset can be stored on the report as needed. However, to achieve this, the Web report tool requires a lot of internal coordination work. Naturally, we want to limit the data in a dataset to some areas. In fact, we want to divide the report into detail areas, grouping areas, and title areas, however, this clearly limits the development capability of Web report tools.

The order of data in the f dataset in the report.

One way is to identify which is the primary dataset (that is, the first dataset to be expanded )? Which is a subdataset (that is, it is expanded with the primary dataset ). This is a common practice of bar report tools. Another approach is to expand the data in the dataset with the cell where it is located. Set the primary cell and subcell on the cell. This is a new generation of Web report development tools-runxi report finereport (for Java) and E table (for. Net) practices.

3Existing Report tools

Early reporting tools have a simple data processing method. Generally, they rely on SQL statements or stored procedures to return required data to the reporting system, the report system can only perform some simple four arithmetic operations, or use a fixed function to obtain the maximum and minimum values.

In recent years, some report development tools have made some improvements in dataset transformation. For example, the data microengine technology is added to several massive reports to cope with complicated Chinese-style reports. This approach adds an operational layer to the dataset to improve data flexibility. The essence is to improve the traditional reporting tools.

The finereport (for Java) and E table (for. net) of the image rundry report adopt a new data processing mode. The following describes in detail the report operation principles of Table E.

 

The following shows an extension process of a simple list. For convenience, remove the synchronization of the cell style section:

A:

 

B calculates the ds1.get (semployeeid) formula.

 

The value of semployeeid is calculated and multiple rows are copied at the same time.

C calculates the ds1.semployeename formula.

 

D and so on until the entire table is computed.

The following shows the scaling process of a group report. For convenience, remove the synchronization of the cell style section:

A:

 

 

B calculates the ds1.group (sarea, false) formula.

 

The value of cell B3 is calculated, and a pointer to the current group is retained in cell B3 to obtain the data of the entire group. For example, the first is the Shanghai group, that is, the data in the ds1 Data Set sarea = Shanghai. (Note: The data in a group refers to the data in a two-dimensional table, not just a row of data.Multiple rows are also copied.

C after calculating a ds1.get (ID) Formula

 

The first ds1.get (ID) is calculated. The calculation process is the same as that of the get function in the example of a simple data list, it only refers to expansion by using the contract number of the sarea = Shanghai group. When the vertical expansion is performed, the left cell is enlarged.

D. The following report is obtained.

 

From the above, we can see that the main flow of report operations in Table E is calculated cyclically Based on formulas in cells, rather than records in datasets. It uses the idea of freely expanding multiple cells to obtain reports, greatly enhancing the transformation capability of datasets. The flexibility of report operations has reached a new level.

4.

The above are some design issues in terms of report calculation principles. Let's take a look at two examples!

 

This is a horizontal sharding report example combining dynamic and static data. It requires the Web report development tool to support sharding. That is, a report can be divided into multiple parts for processing, the workload of reports with the increase in the number of slices cannot increase exponentially.

 


If this employee resume is removed from the main work experience below, it is a standard master-slave table. But now, because two tables are repeating at the same time. This requires that the dataset can be processed again when it is expanded on the report.

If you want to take a closer look at these two examples, you can go to Beijing Fangcheng's website to try them online or download them to your local device.

5A dream

For example, if you get a report, you should first look at the data sources of each piece and the relationship between blocks. You can set report files, define datasets, and set simple formulas like the human brain. Only such report development tools can truly free programmers.

6Summary

This topic describes the data operation principle of the Web report development tool, that is, dataset transformation. It is inevitable that things like general principles are big and empty. However, it is indeed the core of a Web report development tool. According to my personal feeling, the Bar-based report development tools will gradually exit the Chinese market.

Related Links:

Web report development technology Topic 1: Sequence Number

Web report development technology Topic 3: irregular grouping and cross-row group operations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.