In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Big data report how to add dynamic text watermark, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
Watermarking is to embed some identification information into the information carrier, which does not affect the use of the original carrier content, but also provides a means of identification for the original author, so as to prevent it from being tampered with again. it is an effective way to protect information security and knowledge copyright.
When it comes to watermarks, it is common to see paper files, which are usually printed after editing by Word or pdf, and offie or pdf software also has the function of directly adding watermarks.
For example, adding a watermark in Word is very simple: menu bar "Design"-"Watermark" (select "Custom Watermark"), you can set picture or text watermark.
But the same word can only set one watermark content, that is, can only be static watermark, can not be generated dynamically, such as the above text watermark "text" inside the "I am word watermark", the word can only provide this fixed watermark information, unless you edit the word to modify.
Statistical reports, which are often used in data presentation, also need watermark support when displaying, exporting and printing. But the difference is that watermarking through report tools can be dynamic in addition to static watermarking.
For example, the report is generated dynamically based on the same report template, and the query results of different users need different watermark content to protect. Dynamic watermarking is an urgently needed function.
For example, when "Zhang San" visits, the report watermark generated by the template is "Zhang San's report"
When "Li Si" visits, it is "Li Si's report".
First of all, the static text watermark text content is the information fixed when making the report, which can only be changed by modifying the report template.
Secondly, dynamic watermarking
For each visit to the same report, you can pass the watermark information to be displayed to dynamically add the watermark content. Another way:
(1) set dynamically through report parameters and watermark content expressions
(2) display the label by filling in the report (watermark attribute)
For example, generateWaterMark= "watermark information".
Next, let's introduce the specific operation process with an example:
Add a static watermark
1. Open and edit the Web format report template
Menu-report-report Properties-background image, select "Watermark"
2. Define the watermark information to be displayed
Enter the watermark content to be displayed in the report in the text input box, such as "copyright in this report belongs to moistening Company"
3. Save the template and preview the watermark effect in the browser
When you need to change the display, you can only repeat the above steps based on the report template. In addition, the styles that can be adjusted by the watermark include horizontal or tilted mode, font color, spacing, and so on. The watermark is also retained when exporting and printing.
Second, add dynamic watermark
1. Method 1: parameter + watermark content expression
(1) add report parameters
The definition parameter is userID, which is used to receive the current user ID
(2) Editing watermark content expression
Edit "Web format report", menu bar "report"-"report Properties"-"background Picture"-Watermark
"Source"-"expression"
The expression is: @ userID+ "report"
(3) Preview the result
When Zhang San visited, userID was "Zhang San", and the result
Li Si visits
2. Method 2: the value of the watermark attribute through the report label
(1) Open and edit the Jsp file displayed in the report.
Add a method to receive watermark content parameter values:
String waterMark = request.getParameter ("waterMark")
(2) add generateWaterMark attribute to the tag
Add attributes and define the received watermark parameters:
(3) access the report and set waterMark parameters
Change the waterMark value to "the copyright of this report belongs to"
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.