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
Solved

Passing value between sub report and Main report

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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. …
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 …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

840 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