Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Accumulate a numeric variable in same footer Post Reply Post New Topic
Author Message
nix1016
Groupie
Groupie


Joined: 07 Jun 2010
Online Status: Offline
Posts: 40
Quote nix1016 Replybullet Topic: Accumulate a numeric variable in same footer
    Posted: 28 May 2013 at 2:21am
This might be an easy one but I cannot for the life of me work out how to get it to work. Basically I have a couple of sections under group footer 1 which gets suppressed or shown depending on certain situations. I need a variable to increment and display on the sections that are not suppressed.

E.g.

Section                 Suppressed              Variable displayed
GF1a                    No                              1
GF1b                    Yes                             N/A
GF1c                     No                              2
GF1d                    Yes                             N/A
GF1e                    Yes                             N/A
GF1d                    No                              3

I'm using the following formula on each of the sections to display the variable:
shared numbervar v-number;
v-number := v-number + 1;
v-number;

But they all just show 1 - how do i get it to show as per above? I tried using whileprintingrecords but that doesn't seem to work either... Help!


Edited by nix1016 - 28 May 2013 at 2:27am
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 29 May 2013 at 1:14am
Hi

It is displaying always 1 just because your group is getting processed only once. In order to get the desired results you need to write formulas for each row based on your suppress condition.

Ex: 1st line formula.
numbervar x;
If Suppressed = 'Yes' Then
x:=x+0;
Else
x:=x+1

2nd line formula :

numbervar x;
numbervar y;
If Suppressed = 'Yes' Then
y:=0;
Else
y:=y+1;
x:=x+y;


Thanks,
Sastry
IP IP Logged
nix1016
Groupie
Groupie


Joined: 07 Jun 2010
Online Status: Offline
Posts: 40
Quote nix1016 Replybullet Posted: 29 May 2013 at 5:01am
Hi Thanks for that. I wanted to get around creating a formula for each row as there are quite a few rows and the suppression conditions on each row is different. This means that the formular for the later rows get quite big. Is there any other way around this? I had thought that whileprintingrecords would work for such situations?
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.016 seconds.