CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Proper row counting

Print topic Send  topic

Author Message
ryan

Posts: 41
Posted: 12/28/2004, 10:29 PM

Is there any idea to count the row numbers in beforeshow event of a grid for example this is easy

--- select statement 1 on grid ---- A
1.---------------------------
2.---------------------------
3.---------------------------
4.---------------------------

--- select statement 2 on grid ---- B
5.---------------------------
6.---------------------------
7.---------------------------
8.---------------------------

--- select statement 3 on grid ---- C
9.---------------------------
10.---------------------------
11.---------------------------
12.---------------------------

--- select statement 4 on grid ---- D
14.---------------------------
15.---------------------------
16.---------------------------
17.---------------------------


But I need an output similar to this

--- select statement 1 on grid ---- A
1.---------------------------
2.---------------------------
3.---------------------------
4.---------------------------

--- select statement 2 on grid ----B
no records (no beforeshow event)

--- select statement 3 on grid ----C
5.---------------------------
6.---------------------------
7.---------------------------
8.---------------------------

--- select statement 4 on grid ----D
no records (no beforeshow event)

1,2,3,4,5,6.... I assigned an ItemCount label therefore for four grids i have four beforeshowevent but I get stuck when there are no records

BeforeShowEventA
A.ItemCount.Value = A.ItemCount.Value+1
B.ItemCountValue = A.ItemCount.Value

BeforeShowEventB
B.ItemCount.Value = B.ItemCount.Value+1
C.ItemCountValue = B.ItemCount.Value

BeforeShowEventC
C.ItemCount.Value = C.ItemCount.Value+1
D.ItemCountValue = C.ItemCount.Value

BeforeShowEventD
D.ItemCount.Value = D.ItemCount.Value+1

What I'm getting is

--- select statement 1 on grid ---- A
1.---------------------------
2.---------------------------
3.---------------------------
4.---------------------------

--- select statement 2 on grid ----B
no records (no beforeshow event)

--- select statement 3 on grid ----C
1.---------------------------
2.---------------------------
3.---------------------------
4.---------------------------

--- select statement 4 on grid ----D
no records (no beforeshow event)

HELP!!! I hope this is very concise!!!
_________________
(\__/)
(='.'=)
(")_(")
View profile  Send private message
Tuong Do
Posted: 01/13/2005, 9:52 PM

Hi Ryan,
Your problem can be solved by declaring a variable at the near the begining
of the page
ie

' End Include Common Files
Dim counter
Counter = 0

Then

BeforeShowrowEventA
Counter = Counter + 1
A.ItemCount.Value = Counter

BeforeShowrowEventB
Counter = Counter + 1
B.ItemCount.Value = Counter

In this model If there are no row the counter variable still preserve its
value


"ryan" <ryan@forum.codecharge> wrote in message
news:641d24ec7c3de0@news.codecharge.com...
> Is there any idea to count the row numbers in beforeshow event of a grid
> for
> example this is easy
>
> --- select statement 1 on grid ---- A
> 1.---------------------------
> 2.---------------------------
> 3.---------------------------
> 4.---------------------------
>
> --- select statement 2 on grid ---- B
> 5.---------------------------
> 6.---------------------------
> 7.---------------------------
> 8.---------------------------
>
> --- select statement 3 on grid ---- C
> 9.---------------------------
> 10.---------------------------
> 11.---------------------------
> 12.---------------------------
>
> --- select statement 4 on grid ---- D
> 14.---------------------------
> 15.---------------------------
> 16.---------------------------
> 17.---------------------------
>
>
> But I need an output similar to this
>
> --- select statement 1 on grid ---- A
> 1.---------------------------
> 2.---------------------------
> 3.---------------------------
> 4.---------------------------
>
> --- select statement 2 on grid ----B
> no records (no beforeshow event)
>
> --- select statement 3 on grid ----C
> 5.---------------------------
> 6.---------------------------
> 7.---------------------------
> 8.---------------------------
>
> --- select statement 4 on grid ----D
> no records (no beforeshow event)
>
> 1,2,3,4,5,6.... I assigned an ItemCount label therefore for four grids i
> have
> four beforeshowevent but I get stuck when there are no records
>
> BeforeShowEventA
> A.ItemCount.Value = A.ItemCount.Value+1
> B.ItemCountValue = A.ItemCount.Value
>
> BeforeShowEventB
> B.ItemCount.Value = B.ItemCount.Value+1
> C.ItemCountValue = B.ItemCount.Value
>
> BeforeShowEventC
> C.ItemCount.Value = C.ItemCount.Value+1
> D.ItemCountValue = C.ItemCount.Value
>
> BeforeShowEventD
> D.ItemCount.Value = D.ItemCount.Value+1
>
> What I'm getting is
>
> --- select statement 1 on grid ---- A
> 1.---------------------------
> 2.---------------------------
> 3.---------------------------
> 4.---------------------------
>
> --- select statement 2 on grid ----B
> no records (no beforeshow event)
>
> --- select statement 3 on grid ----C
> 1.---------------------------
> 2.---------------------------
> 3.---------------------------
> 4.---------------------------
>
> --- select statement 4 on grid ----D
> no records (no beforeshow event)
>
> HELP!!! I hope this is very concise!!!
> _________________
> (\__/)
> (='.'=)
> (")_(")
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

:-@ Suzuki
Posted: 01/13/2005, 11:43 PM

:-@

Can someone please send me a Bookstore sample of CodeCharge with good connection to a password protected MS Access database of the sample database.

Thanks a bunch,
tan_n@sbcglobal.net

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.