Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Please help creating variables... Post Reply Post New Topic
Author Message
tedjop
Newbie
Newbie


Joined: 17 Jul 2008
Location: Canada
Online Status: Offline
Posts: 18
Quote tedjop Replybullet Topic: Please help creating variables...
     Posted: 17 Jul 2008 at 11:06am
Hello:
I am designing Crystal Reports version 11, where the report is reading an XML data. I need to create a global variable (lets assume it is NumberVar x;)

So, I created a formula and put the Global variable in the formula. Then I put the formula in the Group Header section, so that it will be executed:

Global NumberVar x;
if (condition) then x := x+(data)

BUT this results in printing the value of x in the Group Header. I do not want this, but to print x in the Report Footer later on.

Secondly, the result of x is a wrong number. So, where to put Global Variable in Crystal Reports such that I can add value to it to get the desired result?
IP IP Logged
venkatesha
Newbie
Newbie


Joined: 29 Jun 2008
Online Status: Offline
Posts: 35
Quote venkatesha Replybullet Posted: 17 Jul 2008 at 10:01pm
Have 3 formulas

Formula 1 -  Initailize the formula
    Global    NumberVar x:=0;
    Place it in page header and suppress the same

Formula 2-

    WhilePrintingRecords;
    Global NumberVar x;
    if (condition) then x := x+(data)
Place this in detail section and suppress the same.

Formula 3
    WhilePrintingRecords;
        Global NumberVar x;
    x;
Place this formula in footer section. Which will give the correct value
   


IP IP Logged
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