Solved

using shared variable in crystal report 8.5

Posted on 2004-03-23
6
1,158 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Formula to get month and year from date 5 60
Crystal Reports Groups need Hand Cursor on Hover 4 77
Conditional Text in Crystal 4 48
Crystal Reports Subreport details 16 57
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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

813 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

13 Experts available now in Live!

Get 1:1 Help Now