In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Today, the editor will show you how to add catalogs to the report data in big data. The knowledge points in the article are introduced in great detail. Friends who feel helpful can browse the content of the article together with the editor, hoping to help more friends who want to solve this problem to find the answer to the problem. Let's follow the editor to learn more about "how to add a catalog to the report data in big data".
Requirements description:
When doing some reports similar to word report format, in order to have a better reading effect, it is often necessary to add a directory navigation page on the front page, so that you can quickly know which page of the data you care about, but the report is different from word documents, the format in word documents is fixed, so you can easily and quickly generate directory pages, the data in the report are dynamic, and usually involve dynamic expansion This is difficult to fix the directory items, and due to the dynamic expansion of the data, the corresponding page number is also difficult to obtain accurately, let's take a look at an example, if you dynamically add the directory in the report.
Solution:
Report data is dynamic, so the design can not use a fixed directory, need to be calculated after the report to know which page of the data, dry report provides a report calculation listening class, in the java program can dynamically obtain the results of the report calculation, and can dynamically change the value of the cell in the program.
First, take a look at the report template design interface:
This report summarizes and analyzes the order data by region, and shows the detailed data, which requires that the directory be set by region as navigation. The first five lines of the report are catalog pages, and in the third line, the summary analysis is generally fixed. Here, a fixed line is written, and the page number is set to 2.
A4:=ds1.group (shipper area; shipper area: 1), the expression is grouped by region, that is, the catalog area is displayed by region, and the corresponding E4 cell will be set to the catalog page later, which is temporarily empty.
A5: the table of contents is usually on the first page, so set up a post-line paging here
A7: a fixed summary description in which fixed text and dynamic data can be spliced together by string concatenation.
A8:=ds1.group (shipper area; shipper area: 1), grouped by region
A9: make a summary of the data in the area
A10:=ds1.select (order ID), take the order data, B10, and so on.
Set the left nominative of the cell A9 and A10 to A8, and expand the data vertically according to A8, so that the report shows the result as follows:
Here you can see that the corresponding area is listed at the directory entry, and then take a look at if you add the corresponding page number to the area.
From the report results, you can see that the name of the directory on the first page is the same as the name of the region in the report, so that you can match according to these two names and judge that if the name is the same, you can get the page number where the name of the data area is located. Just put it in the corresponding directory row, such as the "northeast" of the data area on page 2, then the page number of the northeast in the directory should be 2, and then look at how to set a dynamic page number for the directory.
Here is the use of the report listening class mentioned earlier. The source code is as follows:
Import com.raqsoft.common.Area;import com.raqsoft.report.usermodel.Context;import com.raqsoft.report.usermodel.IPagerListener;import com.raqsoft.report.usermodel.IReport;import com.raqsoft.report.usermodel.IReportListener;import com.raqsoft.report.usermodel.PageBuilder;import com.raqsoft.report.util.ReportUtils;public class createmulu implements IReportListener {public void afterCalc (Context arg0, IReport arg2) {PageBuilder arg1 = null Try {arg1 = new PageBuilder (arg2);} catch (Throwable E1) {/ / TODO Auto-generated catch block e1.printStackTrace ();} System.out.println ("report Total pages" + arg1.getPageCount ()) IReport p1; try {p1=arg1.getPage (1); / / the directory is usually on the first page, so get the first page to set the data initial loop page for the catalog page int page=2;//, usually the second page for (int item3) I
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.