dblayout
|
| Posted: 07/01/2003, 1:59 PM |
|
How do I display the # of records that are displayed in the grid? I am trying to show at the bottom of the window 'xxx records out of zzz results'. I have it showing the total record count but I can figure out how to show (or retrieve) the # of records in the grid. My max # of records in the grid is 200 but there may only be 50 matching the search criteria so I my count would be '50 of 50'.
Thanks
|
|
|
 |
Oper
|
| Posted: 07/01/2003, 8:30 PM |
|
i dont kow if there is a function for that but i did this:.
.
.
Public CounterRgrid
CounterRgrid=0
CHoose any Field for Before showevent (1 of the column)
.
.
CounterRgrid=CounterRgrid+1
.
.
And assign this value to the field you create on th etop of thje Bottom!
|
|
|
 |
GreggB
|
| Posted: 07/02/2003, 4:46 AM |
|
CC or CCS
What programming language?
For CCS:
First, if your using ASP, the Property is "RecordCount (ASP)" and PHP is "RecordsCount(PHP)".
The way I use "RecordCount" is as follows:
ASP
1. Open the page with the form you wish to have a total record count. This form is usually a grid. Within that page I sometimes create a separate form to display just the record count.
2. Select a place on the grid form where you would like the record count to be displayed; I like the lower left hand corner. Using the Toolbox, select the Forms Tab, Select "Label" to insert a new label. Optional: Rename the label to “count” or “total_count” your choice of course.
3. Select the Label Properties and set the following:
a. Control Type = "Code Expression"
b. Control Source = Recordset.RecordCount
c. Data Type = Integer
(PHP)
1.In the Grid, select the Label Properties which will display the record count. Under the Data Tab set the following:
a. Control Type = Code Expression
b. Control Source = $This->ds->RecordsCount
c. Data Type = Integer
For CC
I use the following method as it will display the record count based on the current query from a search page.
Add the following code in the “BeforeShow Event of the Forms Gird” that you want to display the records count.
fResult = dResult * iRecordsPerPage
SetVar "total_count", fResult
Now in the same page under Forms create a “Menu” form and in “Fields” add a field type “Label”. In the “Caption” add the following code.
<p><b>Total Records {total_count}</b></p>
Hope this is what you are looking for. This will display the total matched records in your query in a form.
GreggB
|
|
|
 |
GreggB
|
| Posted: 07/02/2003, 11:36 AM |
|
Is this what you are looking for displayed at the bottom a grid?
77 of 108 (matching records) Yes?
CCS using ASP
Note the change in (b.) on the “First displayed Label." Not a calculated result but a twist using CCS built in parameters.
ASP
1. Open the page with the form (grid) you wish to have a total record count. This form is usually a grid.
2. Select a place on the grid form where you would like the record count to be displayed; I like the lower left hand corner. Using the Toolbox, select the Forms Tab, Select "Label" to insert a new label. Optional: Rename the label to “count” or “total_count” your choice of course.
First displayed Label (running total)
3. Select the Label Properties and set the following:
a. Control Type = "Code Expression"
b. Control Source = iif(recordset.pagecount<>pagenumber, pagesize*pagenumber, recordset.recordcount)
c. Data Type = Integer
of
Second displayed Label (total records)
4. Select the Label Properties and set the following:
a. Control Type = "Code Expression"
b. Control Source = Recordset.RecordCount
c. Data Type = Integer
Quick and Dirty but should work. Let me know.
You got me thinking
GreggB
|
|
|
 |
dblayout
|
| Posted: 07/04/2003, 10:20 AM |
|
Thanks to all. I got it working!!!
|
|
|
 |
|