Skip to Content
0

Crystal wont let me pass a variable from subreport to main report

Oct 04, 2017 at 01:18 PM

28

avatar image
Former Member

In Crystal reports, I have a summary field in a subreport, (not a formula only a simple database field) that i´ll have to pass from a subreport to the main report . I have declared the same numberVar at both ends as:

whileprintingrecords;
Shared numberVar tot := {@RemUnconsumedAdvance};
tot

_______

whileprintingrecords;
Shared numberVar tot;
tot

But i can never get the right value (154 in example ) through, i only get 0 . I I Believe the value is passed through, its not null, but it seems it have to be on a certain (right)position since the value exists on one single database row. But shouldnt a formula like this just capture the value right off when Printing not disregarding the position?

Thank you

10 |10000 characters needed characters left characters exceeded
Former Member

namnlos.png and here a screenshot

namnlos.png (11.0 kB)
0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Ian Waterman Oct 04, 2017 at 04:09 PM
0

Please show section details where Subreport is relative to the Main report.

If no grouping then SR should be in Report Header and Main Report display formula should be in Report Footer.

If data grouped then SR in relevant Group Header and Main Report display in Group footer

Ian

Show 1 Share
10 |10000 characters needed characters left characters exceeded

If it relates to detail data then split details into two sections and place SR in top section and display formula in lower section

0
avatar image
Former Member Oct 05, 2017 at 10:26 AM
0

Hello Ian, I have 3 Groups in the main report, the main report requires the sub report to print after the main information therefore positioned in GF#1d. I need the var that is passed right after the SR is printed, therefore it is pos in GF#1e.

But my problem as it seems is the passed value Changes according to which Group it is placed under in the MR, and the data is from a whole different db-view than the SR. Shouldnt this variable simply show the value that was passed at the time it showed in the SR and nothing else?

Thanks in advance!

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Without seeing layout its difficult to assess

Create a main report formula which simply displays the Variable

Place multiple instances in each Group Footer and Details and see how and where it is changing. That will give you some clues as to what is happening.

Where is Var being reset? You might need a reset in main report.

Ian

0