In the main report, Create a formula in which you want to use the variable:
WhilePrintingRecords;
shared numbervar test;
test;
This will return the value. The variable can be used like any other field, ie it can be added to other numberfields etc and used in formulas as necessary.
you will need to be aware that the variable will need to be reset if groups etc are involved. The best way to do this (I find) is to creat the same groups in the subreport and the main report and reset the value in the subreport. You will also need to beware that the positioning of the formula calling the variable from the subreport to the main report will effect the output and can also effect the totals. You may need to play around with group headers and footers (and the whereabouts of any reset formulas in the main report) if your report is complicated.
If you need to pass a parameter value (ie - Crystal reports prompt) you need to create an exact copy of the prompt from the main report in the subreport and then link the 2 fields in the "subreport Links" in the main report.
Thank U very much. Wt I am trying to do is I want
to send 2 dates as startdate and endate from
Sub report.. As U told in Sub report I hd
1. I hd created formula field SDate
whileprintingrecords;
shared datevar Edate1:={?EndDate};
Edate1;
2. Similary for EDate
3. I hd creatd 2 parameters for Sdate and Edate
4. I hd gone to main report and created a
formula field as MSdate
whileprintingrecords;
Shared datevar Sdate1;
Sdate1;
5. similary for end date..
6. Next what I hv to do..
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.