Run dry set report as a pure JAVA reports can be easily embedded in the EE page, and the current set of reports provides a variety of publishing methods for users to use when embedding reports into JSP pages. There are two kinds of reports in a set report, such as parameter report and data report, and look at how to embed the two kinds of reports in the page.
Parameter Report
Because most of the parameter reports publish query data jointly with the data report, only the federated usage is described here (as with the data report alone). A parameter report embeds a page with a label that is <report:param> name paramfilename and params name Specifies the name of the Parameter form, paramfilename 1= 2= parameter value 2 ...
<report:param
Name= "Form1"
Paramfilename= "Demo_arg.rpx"
Params= ""
/>
Data Reports
The Data report embedded page uses the label <report:html> Name file or reportbean Needpagemark Params (Error prompt page), etc.
Different values for property srctype Specify different ways to publish reports to meet the needs of different scenarios. Let's take a look at each.
file mode
when srctype= "File" when the report is published as file , the report template name is specified by the Reportfilename property to complete the report publication. This method is the most commonly used report publishing method, the specific use can refer to the following writing methods:
<report:html
Srctype= "File"
Name= "Report1"
Reportfilename= "Demo.rpx"
funcbarlocation= "Top"
needpagemark= "Yes"
Params= "d_year=2014;u_id=10001"
Exceptionpage= "/reportjsp/myerror2.jsp"
/>
Definebean Way
In addition to specifying the report file directly, you can also publish a report definition that the program reads into ( Reportdefine), use this method to specify the srctype= "Definebean", the specific use can refer to the following writing methods:
<% // read-in report definition
String Reportpath =request.getrealpath ("/reportfiles/api/wangge.rpx");
Reportdefine rd = (reportdefine) reportutils.read (Reportpath);
Request.setattribute ("Reportdefine", RD);
%>
<!- Publish a report -
<report:html
Name= "Report1"
Srctype= "Definebean"
Beanname= "Reportdefine"
Exceptionpage= "/reportjsp/jsp/myerror.jsp"
/>
Reportbean Way
In addition to specifying report templates and receiving report definitions directly, you sometimes need to work directly with the program's calculated reports ( IReport) for publishing, you need to specify srctype= "Reportbean", when used, you can refer to the following wording:
<% // Program Calculation report
String Reportpath =request.getrealpath ("/reportfiles/api/wangge.rpx");
Reportdefine rd = (reportdefine) reportutils.read (Reportpath);
Context cxt = Newcontext ();
Engine engine = newengine (rd, CXT);
IReport IReport =engine.calc ();
Request.setattribute ("Report", IReport);
%>
<!- Publish a report -
<report:htmlname= "Report1"
Srctype= "Reportbean"
Beanname= "Report"
Exceptionpage= "/reportjsp/jsp/myerror.jsp"
/>
context mode
In addition to the above three ways, you can also customize the context passed to tag to publish, using the context, you can pass parameters and macros, you can also specify the data source, database connection factory and so on. You can refer to the following wording when using:
<%
Context context = Newcontext ();
// passing parameters, data sources, etc., omitted here
Request.setattribute ("mycontext", context);
%>
<report:html .....
Contextname= "Mycontext"
/>
Common property Configuration Effects
1. function Bar
Configure funcbarlocation= "Top" and needpagemark= "yes" to display the function bar and page Flip button on top of the report.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6C/19/wKioL1VAOw6S2tz5AADEy1-OAJU500.jpg "style=" float: none; "title=" report5_application_page_embed_1.jpg "alt=" Wkiol1vaow6s2tz5aadey1-oaju500.jpg "/>
2. Export Print button
Configure needsaveasword= "yes" needsaveasexcel= "yes" needsaveaspdf= "yes" needprint= "yes" to show export Word, Excel, PDF, and Print buttons.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6C/1D/wKiom1VAOajhTuGZAADTWvymA-k380.jpg "style=" float: none; "title=" report5_application_page_embed_2.jpg "alt=" Wkiom1vaoajhtugzaadtwvyma-k380.jpg "/>
3. Fixed header
Configure needscroll= "yes" scrollwidth= "100%" scrollheight= "100%" to pin the report header.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6C/19/wKioL1VAOxDTqUfXAADxUVt_dv4874.jpg "style=" float: none; "title=" report5_application_page_embed_3.jpg "alt=" Wkiol1vaoxdtqufxaadxuvt_dv4874.jpg "/>
This article is from the High performance report data calculation blog, so be sure to keep this source http://report5.blog.51cto.com/8028595/1640175
Run-Dry Set Calculation Report Application Development page embedding