Java Development Report--grid++report Report Designer

Source: Internet
Author: User

in order to make the data display more vivid, the report is almost very common in the project , but can be divided into two categories :


         a,Graphics: Displaying data in a graphical form,like a bar chart .,Line Chart,pie chart, etc.,here are a lot of tools for this.,likeJfreeCharts (UseJavalanguage implementation, relatively not too beautiful), Funsionchartsfree(usingXml+flash+jsimplementation. Relatively good), to be able to participate in my previous article:Graphics Generation tool (Funsionchartsfree and Ifreechart); second, there areHighcharts(http://www.hcharts.cn/demo/index.php) andEcharts (Official website: http://echarts.baidu.com/doc/example.html), both are throughJSto achieve. is recommended for use. The official website is rich in information.

Two. Is the table, one is the ability to export data into Excel tables. We are able to get through the POI ( more powerful, but complex ) and JXL(easy to use, but some of the complex features are not implemented); Some statistical tables. Used to count important information for printing.

JavaCommonly used in the Jasperreport+ireport, this online information is much more, our project usesGrid++report,this Report Designer. Support C/S development: VB.net, C #, VB, VC, Delphi and so on, b/S development: ASP, PHP, JSP, etc., support all webserver. Once inC/Sof theVBused in development (report from unfamiliar to use), this time inJava Webused in, mainly through the user manual, and the officialDemobe designed.

Designing a report with Report Designer no more repeating it here. No care about header footer. Report Header report end, detail grid and the use of various parts.

Below is a simple example of a report.


1 , first of all, you need to design GRF the report is placed under a path in the project, JSP page, refer to:

<script type= "Text/javascript" >//var installed = Install_detect (); Createdisplayviewerex ("100%", "80%", "${CONTEXTPATH}/ASSETS/GRIDREPORT/GRF/SELFGETNUMBER.GRF", "", True, ""); </ Script

This code needs to be inside the body . the default container for grid++report is in the body .


2 . Access to Data with AJAX:

<script type= "Text/javascript" >function Getgriddata () {Ajaxreportviewerstart (ReportViewer, "${contextpath}/ Log/logregistration/griddata?starttime= ' 2014-10-12 ' &endtime= ' 2014-10-09 ');} </script>

3. AJAXThe data transmission format specifies:

<report><xml><row><CustomerID>BLONP</CustomerID><CompanyName> National Hao </ Companyname><contactname> Ann </contactname></row><row><customerid>cactu</ Customerid><companyname> Cargo Co., Ltd. </CompanyName><ContactName> Mr. Liu </contactname></ Row><row><customerid>centc</customerid><companyname> Industrial </CompanyName>< Contactname> Mr. Wang </ContactName></row><row><CustomerID>HUNGC</CustomerID>< Companyname> Hardware Machinery </CompanyName><ContactName> Mr. SU </ContactName></row><row>< customerid>merep</customerid><companyname> hua ke </CompanyName><ContactName> wu </ contactname></row></xml><_grparam><parameter1>value1</parameter1>< parameter2>value2</parameter2><staticbox1>text1</staticbox1><memobox1>text2</ Memobox1></_grparam></report> 

where row is the field in the Schedule table. _grparam is the number of references.

It is important to note that the name of the field corresponds. just want us to write with PrintWriter in the background, we can put together a good XML string.

Of course I'm just a simple example here. In fact, report development is almost identical. We need to look at the documentation more. Look at the official example and it's much better.




Java Development Report--grid++report Report Designer

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.