Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to declare a global variable in crystal report

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hey all ,
How to declare a global variable in crystal report,
Any idea

 
The variables are global by default (at least in 8.5) but there is a difference between 'global' and 'shared', and I think that 'shared' is what I envision when I speak of a 'global' variable. So if I want the variable to be used throughout the report, I always declare it like this:

Shared NumberVar x;
...

If I declare it as 'global' (or don't declare one way or the other, which should default to 'global'), it doesn't pass properly, and a more experienced user will probably be able to tell us why. So try 'shared' and see if it works as you hope... -rodbac
 
Hai rodbac,

Thank U somuch ,it works out ,And i am happy very much.
One more rodbac ,when the variable has negative value
it prints the value in bracket ,but if it is possitive it prints normally,
Why like that ,do u have any solution for it.

Thank U,
Aniz.
 
I believe that is a preference (option) that you can modify. Poke around in file -> options and in the format editor for places where you can set custom options for number fields. Also, go to help -> crystal reports help and search for "negative numbers parentheses" (or something like that) and see where it directs you... There seems to be a myriad of places in CR where preferences like these can be set, so I apologize for not being more specific.

Hope this helps! -rodbac
 
Local - scope of the variable is the formula in which it is used
Global - scope of the variable is the report
Shared - scope of the variable is the report and any subreports contained within the report

The default scope for Crystal syntax formulas is "Global".
The default scope for Basic syntax formulas is "Local".

Search the Crystal Help under "scope" for a summary of this type of information. Malcolm Wynden
Authorized Crystal Engineer
malcolm@wynden.net
 
Thanks for the info, Malcolm.

The odd thing here is: 'Global' doesn't seem to be able to be accessed report-wide, but 'Shared' does.

I am sure there is something causing the difference in behavior in our cases, but whatever that is remains a mystery. -rodbac
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top