Thursday, 6 March 2014

Share value between main report, multi sub reports

How to shared value between multi crystal report sub report?
1.       Create two sub reports

2.       Define Formula Field (defineGlobalPersonName)  in subReport1

3.       Tricky: This formula field (defineGlobalPersonName) must use in somewhere in sub report (subReport1) where inject value into the shared variable. Otherwise, other sub report where reference the shared value (personName)  can’t get the value when printing records.

4.       Used shared variable in other sub report (subReport2)
(a)    Declare another “formula field (retreiveBackPersonName)” to retrieve value from above shared variable (personName)

(b)   Use this formula field (retreiveBackPersonName)  in your sub report (subReport2)
5.       Preview final report

6.       If you want shared value to main report as well.  You just only declare one “formula field (sharedValue)”  in main report. Then you can use it