cancel
Showing results for 
Search instead for 
Did you mean: 

Re:Crystal Report

Former Member
0 Kudos
49

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

hi,

Have you called the same variable? check when calling the formula re write in then call the formula.

Then if you still have problem, try to separate the report first, add first the main and subreport, 2

reports first let try to check if the variable can be called.

Regards,

Clint

Former Member
0 Kudos

Hi Clint Pow,

My problem is i have shared the variable in the subreport but that formula variable is not shown in the main report then how can i take that variable.

Regards,

Madhavi

Former Member
0 Kudos

Hi,

type manually the variable from the main report so that it can be called anytime in your main report and it can be recognized!

Regards,

Clint

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Clint Pow,

Problem Solved. Thanks.

Regards,

Madhavi.

Answers (0)