Getting started with grid ++ report -asp.net

Source: Internet
Author: User

Grid ++ report consists of three types of files: HTML files, GRF files, and aspx files. To put it simply, the aspx file is used as the data source, and the data source is merged into the GRF file through the HTML file. GRF can be graphically designed by the grid ++ report designer.

Set Oracle database connection, modify oraclereportdata. CS, and set database connection mode

Public class oraclereportdata {// design database connection public const string oracleconnstr = "Data Source = lch2003; persist Security info = true; user id = HR; Password = HR; Unicode = true; ";}

In the aspx file, set the data source

<% @ Page Language = "C #" %> <SCRIPT runat = "server"> protected void page_load (Object sender, eventargs E) {// different databases should use different report XML data generation classes. SQL Server databases use sqlreportdata, and Oracle databases use oraclereportdata // oledbreportdata for access and other local databases. For ease of demonstration, here, we obtain report data from the access example database of grid ++ report. // The third parameter is false, indicating that the data is not compressed. In actual projects, we should change it to true to compress the data. Here, false is mainly used to // test the correctness of the report data webpage, so that XML text data can be seen when you view the original file of the response. Oledbreportdata. gennodexmldata (this, "select * from MERs order by region, city", false) ;}</SCRIPT>

Set data merging in HTML files

<Body style = "margin: 0"> <SCRIPT type = "text/JavaScript"> // use the query display control to display the report. /GRF/1a. GRF "gets the report template definition from URL" .. /data/xmlcustomer. aspx "to obtain report data in XML format, createdisplayviewer (".. /GRF/1a. GRF ",".. /data/xmlcustomer. aspx "); </SCRIPT> </body>

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.