Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Facing problem in counting Yes values in CR colum Post Reply Post New Topic
Author Message
good2zain
Newbie
Newbie


Joined: 22 Oct 2009
Location: Pakistan
Online Status: Offline
Posts: 4
Quote good2zain Replybullet Topic: Facing problem in counting Yes values in CR colum
    Posted: 22 Oct 2009 at 11:49pm
i used datatable as datasource, datatable contains 4 columns having boolean data type

i want to count the no of true values in the column.

i m nt using any group by clause.

i used this formula to count true values for four columns

numberVar Zero=0;
if {viewrptattendance.isPresent} = True then
(Zero:=Zero+1)

bt facing problem in its result as it did nt give right ans or it did nt count correctly.

i have read this type of counting topic here in this forum, i think that my problem is about grouping options

wt do you say?
IP IP Logged
good2zain
Newbie
Newbie


Joined: 22 Oct 2009
Location: Pakistan
Online Status: Offline
Posts: 4
Quote good2zain Replybullet Posted: 22 Oct 2009 at 11:52pm
result of this formula is different for different test case like

case A

A              B        C           D
correct    zero    zero    zero

case B

A              B        C           D
zero    zero    zero      correct

case c

A              B        C           D
zero    correct  zero      correct

IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 23 Oct 2009 at 12:31am
Every time you declare the variable you are resetting it to zero. Just declare it like this:

NumberVar Zero;
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
good2zain
Newbie
Newbie


Joined: 22 Oct 2009
Location: Pakistan
Online Status: Offline
Posts: 4
Quote good2zain Replybullet Posted: 23 Oct 2009 at 5:11am
i changed the declaration variables bt could nt see any effect on result 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.032 seconds.