Data from excel to ASP - range issue|
new_learner | Posted 1:09am 5. February 2010 Server Time |
I am able to get the data from excel to an asp page, however i am facing an issue here...any help would be appreciated truly.
Here is what i do...
I am extracting the data from excel to asp in the table format with the table border =1. When i view the data on the asp page i see blank rows (thats because there are is no data) Issue here is that i do not want the border to be visible where there is no data...that is: I have a data of about 100 rows but have given range upto 200 rows for future use. what i want is that as and when i enter the new data(in the excel file) in the next row, the table should show it with the border and border should not be visible for the next row where is no data...i hope i am clear..
Here is my code:
<!-- Begin ASP Source Code -->
<%@ LANGUAGE="VBSCRIPT" %>
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.ActiveConnection = objConn
objRS.CursorType = 3 'Static cursor.
objRS.LockType = 2 'Pessimistic Lock.
objRS.Source = "Select * from new1"
If objRS.Open=0 then
'Printing out original spreadsheet headings and values.
'Note that the first recordset does not have a "value" property
'just a "name" property. This will spit out the column headings.
For X = 0 To 8
Response.Write("<TD>" & objRS.Fields.Item(X).Name & "</TD>")
While Not objRS.EOF
For X = 0 To objRS.Fields.Count - 1
Response.write("<TD>" & objRS.Fields.Item(X).value)
katy8439 | Posted 6:08am 5. February 2010 Server Time ||
Have a look at the following example, you can do what you're after apply CSS to the table - empty cells are hidden:
new_learner | Posted 7:32pm 9. February 2010 Server Time |
Thank You Katy, it worked perfectly fine. Will come back with some more queries...till then have a great day. Thank You once again.
Reply to Post Data from excel to ASP - range issue