Solved

Passing value between sub report and Main report

Posted on 2014-12-20
4
159 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 34

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 34

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
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 …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

17 Experts available now in Live!

Get 1:1 Help Now