Solved

using shared variable in crystal report 8.5

Posted on 2004-03-23
6
1,187 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 101

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
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

 
LVL 101

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 101

Expert Comment

by:mlmcc
ID: 11331181
Glad I could help

mlmcc
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

623 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