In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use ireport data tables and reports, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
If there is a problem that ireport can not be opened, it is usually because the JDK version is too high, how simple it is under Baidu, it is very easy.
First: file-> new, select Blank A4 famous Open this template
2. Choose a name, select the saved location, and click finish.
3. Now that the new template has been opened, let's start to introduce what the various parts of the template are.
4. Set the connection driver
Step 1: select new
Part II: selected Datebase JDBC Connection
Step 3:
All right, click save, and the data source you just built will be automatically selected. Then write a SQL statement to get the data of the database.
5. Write sql statements
6. Report page
7. How to draw a report template
Here are the components you need to draw the table.
Rectangle draws borders for tables. If you don't use this, then the table has no inner and outer borders.
Static Text is static text, and it will be displayed as you write it.
Text Field can be understood as a dynamic text box that can specify to display all values of a column in a database table.
Next, let's start drawing one.
1. Select the Static Text component, drag to the title section of the template, and drag the border of the component to make it as big as title, as shown in the figure
Write "user information" in it, as shown in the figure
At this point, the font is small and left, so find the right-user information-properties column, as shown in the figure
Find the column below, set size to the appropriate size, and set H (horizontal position) and V (vertical position) to center and middle. The effect is as follows
Then drag the Rectangle to the template to get the Column Headere section, select to copy two copies, so that the three average Page Headere parts, you can drag the line below the Page Header to make its height smaller, as shown in the figure
Then drag Static Text to the above three boxes, the size is the same as each box, fill in the content, font size and position are set as above, the effect is as shown in the figure
Click the Preview a little bit above the template to preview what the report table looks like, as shown in the figure
At present, there is no data in the table. I will add data to the table (obtained from the database). First of all, add the inner and outer borders to the main part of the table as shown in the following figure, and then drag the line marked below to make it highly consistent with the border of the table, as shown in the figure.
Then find the Text Field of the component panel and drag it to the corresponding border. The size is the same as the border size. The effect is as follows.
Next, give each Text Field dynamic settings. Select the Text Field under the user id, the property bar on the right, find the properties in the following figure, and click three dots to open it.
The effect is as shown in the figure:
Then delete the expression in the input box first. In the user ID column, we will use the number, and the value is the number of rows in the current line. Select the two shown in the red box below to represent the number of statistical rows, and click OK, as shown in the figure.
The last two Text Filed are similar to the above, except that the last two correspond to the user name and password in the database, so we select Fields, name and password, respectively, as shown below
User name column:
The column of user password
At this point, our table is ready for you to preview, but before previewing, there is one more thing to pay attention to. In the template, Chinese characters are displayed when we preview, and we haven't set them, but if we don't set them, it will be unrealistic to generate documents in pdf or other formats, so we need to modify the font format in the template. First check the boxes of all Chinese characters (hold down the ALT left button and click)
Find the two attributes marked in my picture below, and modify the attribute values in the picture: song style, simplified Chinese
All right, this time you can preview the HD no code and no watermark table, as shown in the picture.
The above is all the contents of the article "how to use ireport data tables and reports". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.