Process | Control the whole process of using Chi Island Grid control in ASP
--------------------------------------------------------------------------------
Chi Island Grid Control as the presentation layer of data, it can be very convenient for currency style, RMB case, Chinese case, a variety of logical style, percentage style, thousand division, such as style settings, you can freeze, lock ranks, the input data validation, you can set formulas for the field, easy to quickly statistics, summary data. Chi Island Grid control for its rich and diverse manifestations, easy-to-use operation has won the vast number of software developers alike. Here to share with you the wisdom of the island Grid control in the application of ASP experience:
Figure 1 Style settings
Figure 2 Picture Management
Figure 3 Multi-layer headings
Figure 4 Rollup Mode
Figure 5 Frozen Lock
Figure 6 Merge Mode
A, registered Chi Island Grid Control
When you download the Chi Island Grid control (with its file name Ogrid.ocx), register the control as follows:
Click "Start" → "run"; In the Run dialog box, enter the following command:
regsvr32 < ogrid.ocx file absolute path > registered Chi Island Grid Control control
regsvr32/u < ogrid.ocx file absolute path > lifting Chi Island Grid Control registration
Add the Smart Island Grid control to the page
Add the following code to the page to insert the Chi Island Grid control:
<object classid= "clsid:79b00e6b-6110-46ae-891c-97773022c958" width= "0" height= "0" id= "OGrid" CODEBASE= "http://" Www.oapro.com/ostarocx/download/OGrid.ocx "></object>
which
Width and Height: The display widths and heights of the accused pieces;
ID: The name of the accusation object that implements the operation of the control by that name;
CODEBASE: Refers to a client that does not have the Smart Island Grid control installed automatically to download the 刂 of the installed control when it runs the page?lt;/p>
Third, the use of Intelligent Island Grid Control performance XML Format data
1. XML Document Format
Chi Island Grid Control using an XML document as a data storage interchange format, the following is an XML document format:
<?xml version= "1.0" encoding= "GB2312"?>
<Table>
<TableInfo><!--Table Information-->
<TableName> Personnel table </TableName><!--data table name-->
<FieldInfoArray>
<FieldInfo><!--xml--> of record field information
<FieldName> name </FieldName><!--field name-->
<DataType>10</DataType><!--field Data Type 3: Logical type 7: Numeric 10: Character Type 12: Memo Type 23: Date type-->
<CellType>0</CellType><!--type 0: Text box, 1: Combo box, 2: check box, 3: Date time, 7: RMB Small column amount control-->
</FieldInfo>
...
</FieldInfoArray>
</TableInfo>
<Rows><!--Multi-line data-->
<Row><!--Single-line data-->
<name> John </name>
<sex> male </sex>
...
</Row>
...
</Rows>
</Table>
2. Code implementation
Notify the Smart Island Grid control to open an XML document by following this statement:
Ogrid.opentablexml ("")
The absolute path of the XML document within quotation marks, for example:
http://www.oapro.com/ostarocx/sample/OGrid/xml/style settings. xml
Or
C:\ style settings. xml
Four, use the Chi Island Grid control performance data from the database
1. XML Document Format
Chi Island Grid control using XML documents as the Exchange format, but more data sources are databases, how to represent data from the database? We can dynamically convert the database data into XML format. The following code implements the conversion of the contents of a specified datasheet in an Access database into an XML document format. You can change the Db.mdb file in your code to your own database name. The specified data table name is from the parameter value passed to the file: table_name.
<%
Dim sql,rs
Dim table_name
<!--get data table name-->
Table_name=request. QueryString ("table_name")
Set rs= Server.CreateObject ("ADODB.") Recordset ")
Const adSchemaTables = 20
adSchemaColumns = 4
Strconn= "dbq=" +server.mappath ("Db.mdb") + ";D efaultdir=;D river={microsoft Access DRIVER (*.mdb)};"
Set oconn = Server.CreateObject ("ADODB. Connection ")
oConn.Open strconn
Set Rstschema = Oconn.openschema (adSchemaColumns)
Set rsttable = Oconn.openschema (adSchemaTables)
I=0
%><?xml version= "1.0" encoding= "gb2312"?>
<Table>
<TableInfo>
<TableName><%=Table_name%></TableName>
<FieldInfoArray>
<%
Generate XML File headers
Do Until rstschema.eof
If Rstschema ("table_name") = table_name Then
If Rstschema ("column_name") <> "Orowinfo" or Rstschema ("column_name") <> "Osysmachineid" Then
%> <FieldInfo>
<fieldname><%=rstschema ("column_name")%></fieldname> <colname><%=rstschema ("Column_ Name ")%></colname>
<%select case Rstschema ("Data_type")
Case "130"
If Rstschema ("character_maximum_length") = 1073741823 then%> <DataType>12</DataType>
<CellType>0</CellType>
<%else%> <DataType>10</DataType>
<CellType>0</CellType>
<%end if
Case 135%> <DataType>23</DataType>
<CellType>3</CellType>
<%case 3%> <DataType>7</DataType>
<CellType>0</CellType>
<%case 11%> <DataType>3</DataType>
<CellType>2</CellType>
<%case 131%> <DataType>10</DataType>
<CellType>0</CellType>
<%case 5%> <DataType&