In Crystal report I designed 2 sub reports; and then doing distinct count in each sub report for a string value. I like to add both sub count and display at main report footer
In Crystal report I designed 2 sub reports; and then doing distinct count in each sub report for a string value. I like to add both sub count and display at main report footer, the main report does not display any data except parameter values. I need to pass shared variable in both sub report for distinct count and then add together to display in main report.
This should be able to be done with one Shared Variable (I'm unsure of the "Global" type).
In Main Report Header (Or a section above the 1st Sub-Report): @VariableReset_DCount:
whileprintingrecords;
Shared NumberVar DCount:=0;
In Footer of Subreports (one forula field in each) @VariableSet_DCount:
whileprintingrecords;
Shared NumberVar DCount;
DCount:=DCount + DistinctCount({user_pce_detail.client};
In the Main Report Footer: @VariableDisplay_DCount:
whileprintingrecords;
Shared NumberVar DCount;
In the future, please use a more descriptive Thread Heading and include the version of Crystal Reports & the type of Database you are using, as this can sometime affect the solution to your question.
Hope this helps!
Mike
-------------------------- "To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure, in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
Author R.A. Salvatore via "Drizz't"
If you changed "global" to "shared" in all formulas, then your method should work, as long as the subreports are in RH_a and the calculation formula is in RH_b.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.