Report Design
 Crystal Reports Forum : Crystal Reports 9, X, XI, 2008, 2011 : Report Design
Message Icon Topic: Global vrs Shared variables Post Reply Post New Topic
Author Message
Cordellv
Newbie
Newbie
Avatar

Joined: 14 Jan 2009
Location: United States
Online Status: Offline
Posts: 35
Quote Cordellv Replybullet Topic: Global vrs Shared variables
    Posted: 07 Oct 2009 at 9:26am
I thought you used Global variables when you wanted to share a variable between formulas through out the report and only used Shared Variables when you were using a Sub-report. Some one told me that you should always use Shared Variables and never use Global Variables.  Do you agree?  If that is the case why would Crystal Reports default to Global instead of Shared when you dont declare the scope?
Cvail


Edited by Cordellv - 07 Oct 2009 at 9:26am
Making Things Better One Day At A time
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2459
Quote BrianBischof Replybullet Posted: 07 Oct 2009 at 10:18pm
I never heard that Shared takes priority over Global. Did this person give you a reason for it? From a management standpoint, I would think it's takes less resources to manage variables within a single report than across multiple reports. Thus, Global would be the best choice as the default scope declaration. But this is just a guess b/c I never saw anything comparing the performance of the two against each other.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Cordellv
Newbie
Newbie
Avatar

Joined: 14 Jan 2009
Location: United States
Online Status: Offline
Posts: 35
Quote Cordellv Replybullet Posted: 08 Oct 2009 at 6:43am
Brian,
 
Thanks for your reply.  That was what this person said that GLOBAL can be used across multiple reports.  I have never seen any where that could be the case, even if you use the Repository.  Is that what you are saying that GLOBAL variables can be used between two different reports? 
 
"takes less resources to manage variables within a single report than across multiple reports"
 
I dont see how that could be possible.
 
As for resources, I will have to create a couple of reports, one with GLOBAL variables and one with SHARED variables and see if there is any resource difference.  I will let you know what I find out.
 
Cv
Making Things Better One Day At A time
IP IP Logged
Cordellv
Newbie
Newbie
Avatar

Joined: 14 Jan 2009
Location: United States
Online Status: Offline
Posts: 35
Quote Cordellv Replybullet Posted: 08 Oct 2009 at 10:00am

Brian,

I got out my SAP CR class book for Report Design III and found you are right (of course).  You can share a variable between reports by using custom functions and saving them to the repository. 

 

Page 5-3

 

"Custom functions can be shared between reports by storing them to the Business Objects Enterprise repository and adding them to reports as needed"
 

But we donít use the repository so I was not aware of that.  So there is at least one way a variable could be shared between reports (and I assume that means the actual variable name and the value assigned to it in the custom function).

Cv

 

Making Things Better One Day At A time
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.047 seconds.

FREE ADVANCED
Crystal Reports Training!

Plus, free bonus PDF cheat sheet! Advanced Crystal Reports Training Give Me Advanced Training!