Solved

using shared variable in crystal report 8.5

Posted on 2004-03-23
6
1,149 Views
Last Modified: 2007-12-19
I am trying to pass a boolean value from detail page to the Report header for checking a field in the detail section,i have wriiten the following code  in the detail section

//detail section Formula
whileprintingrecords;
shared booleanVar ispresent := false ;
if({Lines.cdeitem} = "B900") then ispresent = true
else ispresent = false;
and i wrote

//Header sectoin formula

whileprintingrecords;
shared booleanVar ispresent := false ;
if(ispresent = true) then "Y"
else "N"

when i am going to preview it is showing Broken link error
can any one suggest me ,what is solution for it ..or is there any other approac to do it.
I am calling this report from Vb6.0
0
Comment
Question by:tilu_padhi
  • 3
  • 2
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 10662706
I am not sure of this but I believe SHARED variables are for passing informationbetween the main and subreports.  Try using GLOBAL instead of SHARED

mlmcc
0
 
LVL 13

Expert Comment

by:EwaldL
ID: 10662866
also, in the second formula change this line
global booleanVar ispresent := false ;
to global booleanVar ispresent;

otherwise you will always overwrite the value from the main report

most likely the broken link error has nothing to do with this though. do you get the same error having removed these formulas or are you also using these formulas for linking the main and subreport?
0
 

Author Comment

by:tilu_padhi
ID: 10662881
Thanks But it is not working ...can you please give me some sample code you have,for how to use this global..
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 100

Accepted Solution

by:
mlmcc earned 25 total points
ID: 10664313
//detail section Formula
whileprintingrecords;
GLOBAL booleanVar ispresent;
if({Lines.cdeitem} = "B900") then ispresent := true
else ispresent := false;

//Header section formula
whileprintingrecords;
GLOBAL booleanVar ispresent ;
if(ispresent = true) then "Y"
else "N"

Does the detail section have multiple records?  If so I think you may need to try it this way
//Report header
GLOBAL booleanVar ispresent := FALSE;

//detail section Formula
whileprintingrecords;
GLOBAL booleanVar ispresent;
if({Lines.cdeitem} = "B900") then ispresent := true;

//Header section formula
whileprintingrecords;
GLOBAL booleanVar ispresent ;
if(ispresent = true) then
  ispresent := false;
  "Y"
else
  ispresent := false;
  "N"

mlmcc


0
 

Author Comment

by:tilu_padhi
ID: 11324939
Thanks
it worked..
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 11331181
Glad I could help

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal Report fractions 4 69
Insert timestamp data field of max summary 8 39
New and Previous Value in Crystal Report 8 53
Help with a Crystal Report Formula 8 43
Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now