Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Shared variable skipping a line Post Reply Post New Topic
Author Message
sanur13
Newbie
Newbie


Joined: 25 Apr 2016
Location: France
Online Status: Offline
Posts: 18
Quote sanur13 Replybullet Topic: Shared variable skipping a line
    Posted: 15 Jun 2017 at 3:59am
Hi everyone,

I'm using a shared variable on my report. The problem is that the variable at the main report skips a line.

Example:

Cost (subreport)      Cost (main report)
1                     0
0.5                   1
0.7                   0.5
10                    0.7
50                    10
.6                    50


So as you can see, instead of displaying 1 at the first line, the variable displays 0, and in all lines following it will display the previous record. And the last record (.6) will never show on my report. So when I add up everything, the sum is wrong.


Formulas I'm using :

Subvariable formula :

Shared NumberVar coutreel := {@Cout_reel}


Main variable formula :

Shared NumberVar coutreel;
coutreel


Any help is very apreciated,
Santiago.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 15 Jun 2017 at 7:04am
Question: Is the sub-report in a section before the main variable formula?  If not, it needs to be because of how CR processes information.
IP IP Logged
sanur13
Newbie
Newbie


Joined: 25 Apr 2016
Location: France
Online Status: Offline
Posts: 18
Quote sanur13 Replybullet Posted: 15 Jun 2017 at 9:34pm
No, it was in the same section. I placed it in a section before the main variable formula as you told me and it worked perfectly.

Thanks a lot kevlray!

Edited by sanur13 - 15 Jun 2017 at 9:35pm
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.