Print Page | Close Window

Facing problem in counting Yes values in CR colum

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=8101
Printed Date: 29 Apr 2024 at 6:43pm


Topic: Facing problem in counting Yes values in CR colum
Posted By: good2zain
Subject: Facing problem in counting Yes values in CR colum
Date 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?



Replies:
Posted By: good2zain
Date 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



Posted By: BrianBischof
Date 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>


Posted By: good2zain
Date Posted: 23 Oct 2009 at 5:11am
i changed the declaration variables bt could nt see any effect on result 



Print Page | Close Window