Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Passing value between sub report and Main report

Posted on 2014-12-20
4
Medium Priority
?
180 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
[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
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
James0628 earned 2000 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 101

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

636 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