index | search | no replies | posting guidelines | help | login | register |
Index » Products » ASP DataGrid |
| |||||||
May 21 2004, 2:21 PM |
| ||||||
thomasgroup from: Omaha | Hello, We are testing the Free Version. Great Product! When we click on CSV, Excel or the other formats. We do not get an error, but the file never downloads like the demos. Are you doing something wrong? Our Code: <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% 'declare variables Dim objGrid Dim strConn Dim strSQL 'Build a connection string to the Northwind database strConn = "Provider=MSDASQL;Driver={SQL Server};Server=xxx.xx.xxxx;Database=idxAnalyzer;User ID=xxxx;Password=xxxx;" 'Build an SQL command statement strSQL = "select * from users" ' Create an instance of DataGrid Set objGrid = Server.CreateObject("AspWebSolution.DataGrid") With objGrid 'Set your command statement .Command = strSQL 'Set your desired font colors & style .GridStyle = "background-color:gray;" .HeaderStyle = "background-color:#666699;" .HeaderTextStyle = "color:white;font-family:verdana;font-size:8pt;" .ItemStyle = "background-color:#d2d1de;color:000000;font-family:verdana;font-size:8pt;" .AltItemStyle = "background-color:#f5f5f5;color:000000;font-family:verdana;font-size:8pt;" .FooterStyle="font-family:verdana;font-size:8pt;" 'Create a databse connection .CreateConnection (strConn) 'Display the data grid .Display End With 'distroy objects Set objGrid = Nothing %> </body> Thanks | ||||||
May 21 2004, 6:32 PM |
| ||||||
ghost from: Washington, DC | Make sure that you create your object before adding any HTML tags as follows: <% LANGUAGE= "VBSCRIPT" %> <% 'declare variables Dim objGrid Dim strConn Dim strSQL 'Build a connection string to the Northwind database strConn = "Provider=MSDASQL;Driver={SQL Server};Server=xxx.xx.xxxx;Database=idxAnalyzer;User ID=xxxx;Password=xxxx;" 'Build an SQL command statement strSQL = "select * from users" ' Create an instance of DataGrid Set objGrid = Server .CreateObject("AspWebSolution.DataGrid" ) With objGrid 'Set your command statement .Command = strSQL 'Set your desired font colors & style .GridStyle = "background-color:gray;" .HeaderStyle = "background-color:#666699;" .HeaderTextStyle = "color:red;" .ItemStyle = "font-size:8pt;" .AltItemStyle = "font-size:8pt;" .FooterStyle= "font-family:8pt;" 'Create a databse connection .CreateConnection (strConn) End With %> <html> <head><title>My Title</title></head> <body> <h1>Whatever</h1> Add some HTML text If you need <% 'Display the data grid pbjGrid.Display 'distroy objects Set objGrid = Nothing %> My foot notes </body> </html> Let me know if this helps... ------------------------- Ghost | ||||||
May 21 2004, 6:53 PM |
| ||||||
thomasgroup from: Omaha | Not quite. Here is the error: Error Type: Microsoft VBScript runtime (0x800A01F9) Invalid or unqualified reference /umarm/grid/test.asp, line 41 Here is the code: <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% 'declare variables Dim objGrid Dim strConn Dim strSQL 'Build a connection string to the Northwind database strConn = "Provider=MSDASQL;Driver={SQL Server};Server=xxx.xx.xxxx;Database=xxxx;User ID=xxxx;Password=xxxx;" 'Build an SQL command statement strSQL = "select * from users" ' Create an instance of DataGrid Set objGrid = Server.CreateObject("AspWebSolution.DataGrid") With objGrid 'Set your command statement .Command = strSQL 'Set your desired font colors & style .GridStyle = "background-color:gray;" .HeaderStyle = "background-color:#666699;" .HeaderTextStyle = "color:white;font-family:verdana;font-size:8pt;" .ItemStyle = "background-color:#d2d1de;color:000000;font-family:verdana;font-size:8pt;" .AltItemStyle = "background-color:#f5f5f5;color:000000;font-family:verdana;font-size:8pt;" .FooterStyle="font-family:verdana;font-size:8pt;" 'Create a databse connection .CreateConnection (strConn) End With %> <html> <head><title>My Title</title></head> <body> <h1>Hello World</h1> <% 'Display the data grid .Display 'distroy objects Set objGrid = Nothing %> </body> </html> | ||||||
May 21 2004, 7:06 PM |
| ||||||
thomasgroup from: Omaha | Quck note. When I created the same report with the wizard. The download feature worked fine... Hope you can get it to work ont the other too. Thx | ||||||
May 22 2004, 10:23 AM |
| ||||||
ghost from: Washington, DC | Make sure you set the procedure Display to the datagrid as follows: objGrid.Display The code below is the one I used to test and it works fine: <% @LANGUAGE= "VBSCRIPT" CODEPAGE= "1252" %> <% 'declare variables Dim objGrid Dim strConn Dim strSQL 'Build a connection string to the Northwind database strConn = "Provider=MSDASQL;Driver={SQL Server};Server=(local);Database=NOrthwind;User ID=sa;Password=sa;" 'Build an SQL command statement strSQL = "select * from customers" ' Create an instance of DataGrid Set objGrid = Server .CreateObject("AspWebSolution.DataGrid" ) With objGrid 'Set your command statement .Command = strSQL 'Set your desired font colors & style .GridStyle = "background-color:gray;" .HeaderStyle = "background-color:#666699; color:white;" .HeaderTextStyle = "color:white; font-size:8pt;" .ItemStyle = "background-color:#cccccc; font-size:8pt;" .AltItemStyle = "background-color:white; font-size:8pt;" .FooterStyle= "font-size:8pt;" 'Create a databse connection .CreateConnection (strConn) End With %> <html> <head><title>My Title</title></head> <body> <h1>Hello World</h1> <% 'Display the data grid objGrid.Display 'distroy objects Set objGrid = Nothing %> </body> </html> Let me know if this helps... ------------------------- Ghost | ||||||
Pages: (1) [1] |