on 2009 Jan 29 4:24 AM
Hi All,
I have created a crystal report in that i have used 4 sub forms in the same form. In each form i have created a grand total field. I am having grand total in each sub forms and i have to display the grand totals in another sub form. Is it possible if means please tell me how to do it?
Regards,
Madhavi
Hi,
You can use a Share formula assigning to each variables you created.
Dim or Local u2013 Dim (Basic syntax only) or Local variables are only recognized within the formula in which they are declared.
u2022 Global u2013 Global variables use the same memory block to store a value for access throughout a single report object, whether that is the main report or a subreport.
u2022 Shared u2013 Shared variables are recognized in all report objects within a single Crystal Reports file. Shared variables are frequently used to pass data from subreports to the main report.
Crystal syntax
Variable scope is declared first, then variable type,
then variable name
Local CurrencyVar C;
Global NumberVar N;
Shared StringVar S;
regards,
Clint
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Clint pow,
I have select the Crystal Syntax in the formula screen of the subreport and used the following code:-
Shared StringVar VarVal =cstr(({@VarVal}/{@PlanTime}) * 100) + "%"
but it is not coming in the main report. What should i do to get the formala of the subreport in the main report.
Regards,
Madhavi
Hi Clint,
I have shared formula name as "VarVal%" in one subform i manually typed this name in the text in the main form but its not showing the value is only displaying "VarVal". And i am having 4 subreports in the same form each subreport has the formula in same name how can i differentiate the formula for each subreport and display in the main report?. If all the subreport has the formula in same name will ambiguity arise?
Regards,
Madhavi
hi,
dont connect the 4 subreports first, let try only one subreport for now so that we can determine whats the cause, using shared variable with the same variable will create ambiguity, each much have distinct variable.
take a sample first, from the subreport one, try to show or pass the the Valval from the Main Report.
You can paste your code here so that I can go with the flow. Paste the code for Main and subreport.
Heres a link to solve your problem page no. 15.
http://www.bobjects.com/crystalsecrets/20_Secrets_v6.pdf
Regards,
Clint
Edited by: clint pow on Jan 30, 2009 12:59 PM
Hi Clint,
I tried as in the document. In subreport i used the code follows for the formula named MPPlnValS:-
WhilePrintingRecords;
Shared StringVar MPVarValS :=Cstr(Sum({@Planval}))
In Main report i used the code follows for the formula named MPPlnValS:-
WhilePrintingRecords;
Shared Stringvar MPVarValS;
MPVarValS
Here i displayed the formula in the subreport it shows the correct value. But when i tried to display the formula in the main report Page footer it is displaying empty. What is the wrong in it?.
Regards,
Madhavi
Edited by: Madhavi on Jan 30, 2009 7:56 AM
User | Count |
---|---|
98 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.