|
| |
|
|
samsquared
Posts: 4 Joined: 2/27/2002 From: Status: offline
|
Wrapping columns of database results - 2/27/2002 21:35:24
I want to display only the names from an employee database, but I'd like to have it display as 4 columns instead of 1 long column (or drop-down). For example, if there are 120 employees, I'd like the first 30 to be in the first column, the next 30 to be in the second column, etc. Thanks
|
|
|
|
William Lee
Posts: 1041 Joined: 1/25/2002 From: Singapore Status: offline
|
RE: Wrapping columns of database results - 2/28/2002 0:30:12
A simple alternative is to display the records in group and you can specify how many 30. You can do this in Step 5 of 5 of the DRW. The DRW will provide a set of Navbars for you to page the returned records. William Lee
|
|
|
|
samsquared
Posts: 4 Joined: 2/27/2002 From: Status: offline
|
RE: Wrapping columns of database results - 3/11/2002 13:43:29
I found a way to do this that does not use database results wizard. It's fairly easy to do using ASP. Go to this URL: http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=178 I used the code in the last example. NOTE - there is a bug. The line that reads rec = startRec + col * COLUMN_COUNT should be changed to rec = startRec + col * rowCount Otherwise, it works fine!
|
|
|
|
evansforsyth
Posts: 277 Joined: 12/11/2001 From: Grande Prairie, Alberta, Canada Status: offline
|
RE: Wrapping columns of database results - 9/13/2003 22:45:01
Well, got this far . . . I'm sure someone with a bit of ASP knowledge will see the problem right away--unfortunately that someone is not me! Here is the code: ----------------------------- <% Const COLUMN_COUNT = 4 ' or 2 or 4 or ... column = 0 ' initialize counter Do While Not fp_rs.EOF ' put in <TR> at beginning of group: If column = 0 Then Response.Write "<TR>" Response.Write "<TD>" & _ FP_FieldVal(fp_rs,"MN") & "</TD>" column = column + 1 If column = COLUMN_COUNT Then Response.Write "</TR>" & vbNewLine column = 0 ' start over! End If fp_rs.MoveNext ' this seems to be where the problem is! Loop ' clean up last row, if needed! If column <> 0 Then For c = column To COLUMN_COUNT Response.Write "<TD></TD>" Next Response.Write "</TR>" & vbNewLine End If %> ------------------------ Here is the problem: After working very well, and showing the data appropriately, this error message shows up: "Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. " Sure appreciate the help!
< Message edited by evansforsyth -- 9/14/2003 1:43:05 AM >
|
|
|
|
evansforsyth
Posts: 277 Joined: 12/11/2001 From: Grande Prairie, Alberta, Canada Status: offline
|
RE: Wrapping columns of database results - 9/14/2003 12:37:43
Added the following line at top of the code: On Error Resume Next This got rid of the error message (Seems that the line "Do While Not fp_rs.EOF" requires that it be open on a current record)! Is this dangerous? Will "On Error Resume Next" turn itself off at the end of that section of code--or at the end of the page? Thanks Evans
< Message edited by evansforsyth -- 9/14/2003 12:38:09 PM >
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|