Solved

Passing value between sub report and Main report

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

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

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 …
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 is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

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

12 Experts available now in Live!

Get 1:1 Help Now