Home  >  Article  >  Web Front-end  >  Runqian Jishu report application development page embedding_html/css_WEB-ITnose

Runqian Jishu report application development page embedding_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:45:192019browse

As a pure JAVA report, Runqian Setsu Report can be easily embedded into J2EE pages. Currently, Setus Report provides a variety of publishing methods for users to use when embedding reports into JSP pages. There are two types of reports in Setshu reports: parameter reports and data reports. Let’s take a look at the page embedding methods of these two types of reports.

Parameter Report

Since most parameter reports publish query data jointly with data reports, here we only introduce the joint usage method (separate publishing is the same as data reports). The tag used when the parameter report is embedded in the page is . The main attributes of the tag are name, paramFileName and params. name specifies the name of the parameter form, paramFileName is the name of the parameter report template file, and params is the parameter report received. Parameters, the format requirements are: parameter name 1 = parameter value 1; parameter name 2 = parameter value 2…. For specific usage, please refer to the following writing method:

name="form1"

paramFileName="demo_arg.rpx"

params =""

/>

Data report

The tag used in the data report embedded page is . Common attributes include name (table name), srcType (source type, which can be file, defineBean or reportBean), funcBarLocation (whether a toolbar is included), needPageMark (whether a page number is required), params (report parameters, the same as params in parameter reports), exceptionPage (error prompt page), etc.

Different values ​​of the srcType attribute specify different report publishing methods to meet the needs of different scenarios. Let’s take a look at them separately.

file mode

When srcType="file", the report is published in file mode, and the report template name is specified through the reportFileName attribute to complete the report publishing. This method is the most commonly used report publishing method. For specific use, please refer to the following writing method:

srcType="file"

name="report1 "

reportFileName="demo.rpx"

funcBarLocation="top"

needPageMark="yes"

params="d_year=2014;u_id =10001"

exceptionPage="/reportJsp/myError2.jsp"

/>

defineBean method

In addition to directly specifying the report file, you can also Publish the report definition (ReportDefine) read by the publishing program. To use this method, you need to specify srcType="defineBean". For specific usage, please refer to the following writing method:

<% //Read the report definition

String reportPath =request.getRealPath("/reportFiles/api/wangge.rpx");

ReportDefine rd =(ReportDefine)ReportUtils.read(reportPath);

request.setAttribute( "reportDefine",rd);

%>

name ="report1"

srcType="defineBean"

beanName="reportDefine"

exceptionPage="/reportJsp/jsp/myError.jsp"

/>

reportBean method

In addition to directly specifying the report template and receiving the report definition, sometimes it is also necessary to directly use the report (IReport) calculated by the program to publish. In this case, you need to specify srcType=" reportBean", you can refer to the following writing when using it:

<% //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);

%> -->

srcType="reportBean"

beanName="report"

exceptionPage=" /reportJsp/jsp/myError.jsp"

/>

context method

In addition to the above three methods, you can also customize the context and pass it to the tag for publishing. Using context, you can pass parameters and macros, and also specify data sources, database connection factories, etc. When using it, you can refer to the following writing:

<%

Context context = newContext();

// Pass parameters, data sources, etc., omitted here

request.setAttribute("myContext", context );

%>

contextName="myContext"

/>

Common attribute configuration effects

1. Function bar

Configuring funcBarLocation="top" and needPageMark="yes" can display the function bar and page turning buttons above the report.

2.Export Print Button

Configure needSaveAsWord="yes" needSaveAsExcel="yes" needSaveAsPdf="yes "needPrint="yes" can display export Word, Excel, Pdf and print buttons.

3.Fixed header

Configure needScroll="yes" scrollWidth="100%"scrollHeight=" 100%" can fix the report header.


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn