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>