Detailed description of reports generated on the JSP report page
1. Ideas
2. Implementation instance
1. Ideas
First, the user clicks the "generate" button to send the request to the background processing controller. The controller queries the database to obtain the data in the report, and then sends the Request dispatch to the real report page, on the report page, first obtain the data object obtained through the request (generally in the form of a bean), and then bring the data in the object to the page.
2. Implement the instance 2.1 report page
If the original word document of the report exists, there is a simple method to convert the word report to HTML: Compile.
2.2 instance spring + extjs
{Text: 'xxx', iconcls: 'icon-Refresh ', Handler: printtable },
Function printtable () {<br/> window. Open (<br/> 'url', <br/> '_ print' <br/>); <br/>}
The controller sends parameters to the report page:
Request. setattribute ("xxxbeanname", bean); <br/> request. getrequestdispatcher ("print. jsp"). Forward (request, response );
Report page: Get Bean object
Bean = (bean) request. getattribute ("xxxbeanname ");
Real bean attributes:
<% = Ocom. getsubjectname () %>