Solved

Passing value between sub report and Main report

Posted on 2014-12-20
4
168 Views
Last Modified: 2014-12-29
In sub report I have accumulating formula in detail line with shared variable, I concatenate  values from this field and then I want to  pass that value in main report . When I check value of formula on detail line is showing right value.
But when I pass shared variable in main report it show last value from sub report detail line twice?
(Sub report is running in main report in section above where shared variable is used.)
I assume that is something with re setting shared variable but not sure I tried to re set it in sub report Header the same, in sub report GH2 not good It show empty in main report.


I have two grouping in Sub report  G1 Student ID  this is connecting field between Main and sub report.
Next Group is Activity Type and then detail line.

So I have something like this.

RH
GH1(StudentID)-----
WhilePrintingRecords;
Shared StringVar DescAcum:="";

GH2(ActivityType)
DL-Here is formula------
WhilePrintingRecords;
Shared StringVar DescAcum;
If {tableA.ActivityType} = "Soccer"  And  {?Semester} = "1" And Month ({TableA.Dateto})= 1.00 then
DescAcum:= DescAcum + {TableA.Description} + ";  ";
0
Comment
Question by:Taras
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
James0628 earned 500 total points
ID: 40512055
The subreport is run for one StudentID at a time?  You have a group on that in the subreport, but you wouldn't really need a group unless the subreport was being run for more than one StudentID at a time, so I wanted to check.

 That last formula is in a detail section?  I'm guessing that's what "DL" meant.

 You don't have any other formulas that set that variable, and you don't include the formulas that you posted anywhere else in the subreport?

 You could create a formula in the main report that was similar to the first one in the subreport, to declare the variable in the main report, before the subreport is run.  Put that formula in the report header in the main report.  I don't think that's normally necessary, but it would be simple enough to try.

 Other than that, I don't see anything wrong with what you posted.  It might help if you could post the report, so that we could see everything for ourselves.

 James
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40512278
I am not sure what your issue is.

Can you provide a screen shot or a sample?

If your subreport has multiple records you will get several descriptions concatenated.

mlmcc
0
 

Author Closing Comment

by:Taras
ID: 40522254
thanks a lot.
0
 
LVL 35

Expert Comment

by:James0628
ID: 40522429
If you've fixed the problem, can you tell us what the fix was?  It might help someone else, but, aside from that, I'm just curious.

 James
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

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. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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