Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: global variable Post Reply Post New Topic
Author Message
chitz
Newbie
Newbie
Avatar

Joined: 26 Dec 2007
Online Status: Offline
Posts: 32
Quote chitz Replybullet Topic: global variable
     Posted: 26 Dec 2007 at 10:42pm
I want to find the total records displayed in the subreport and i want to pass it to main report plz help me in specifying the name of the variable or parameter and how to access it in main reportCry

Edited by chitz - 26 Dec 2007 at 10:42pm
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 27 Dec 2007 at 12:05am

1. create two formula fields in sub report.

         initalval (declaring shared variable, it conatins following syntax)
         shared stringvar totrec;
 
Put this initval in the page header of subreport
 
Now create 2nd formula field
           totalrec ( this formula has the following  syntax)
           shared stringvar totrec = shared stringvar totrec + 1;
place this totalrec forumula in details section.
 
now in the main report create one more formula
    totrecmain (this formula has the following syntax)
        shared stringvar totrec;
 
i hope this will get the total records displayed in subreport.
 
get back for any more queries........
 
Thanks
Savan
IP IP Logged
chitz
Newbie
Newbie
Avatar

Joined: 26 Dec 2007
Online Status: Offline
Posts: 32
Quote chitz Replybullet Posted: 27 Dec 2007 at 12:13am
Thanks for Ur detailed answer.But i want thses to be not visible in the report so tat i will use this count for some other validation
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 27 Dec 2007 at 12:43am

right click on the variable and select the format option and in that select the common option and check the supress button by this the variable is not visible, but u can still use the shared variableWink

Thanks
Savan
IP IP Logged
chitz
Newbie
Newbie
Avatar

Joined: 26 Dec 2007
Online Status: Offline
Posts: 32
Quote chitz Replybullet Posted: 27 Dec 2007 at 12:50am
Will the total be available in main report?Coz i used the main reprot formula and displayed it is showing the total as 0,but i have 10 records
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 27 Dec 2007 at 1:06am
sorry,  please change the following formula  (put  :=  instead of  =  in 2nd formula)  also instead of stringvar take numbervar the formula would be
 
         2nd formula field
           totalrec ( this formula has the following  syntax)
           shared numbervar totrec := shared numbervar totrec + 1;


Edited by Savan - 27 Dec 2007 at 1:09am
Thanks
Savan
IP IP Logged
chitz
Newbie
Newbie
Avatar

Joined: 26 Dec 2007
Online Status: Offline
Posts: 32
Quote chitz Replybullet Posted: 27 Dec 2007 at 1:10am
Wat is the diffrence in using Colon.
IP IP Logged
chitz
Newbie
Newbie
Avatar

Joined: 26 Dec 2007
Online Status: Offline
Posts: 32
Quote chitz Replybullet Posted: 27 Dec 2007 at 1:17am
Thank u very muchhhhhhhhhhh for ur help its working perfectly............Clap
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 27 Dec 2007 at 1:17am

if use the  colon, the changed value will be assigned to the shared variable  whenever it  changes.

Thanks
Savan
IP IP Logged
chitz
Newbie
Newbie
Avatar

Joined: 26 Dec 2007
Online Status: Offline
Posts: 32
Quote chitz Replybullet Posted: 27 Dec 2007 at 1:19am
ok thank u for ur information....see u with another doubt..
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