Crystal reports, sub-reports, and shared variables

I have the @InitVars formula in the page title, which includes the following and similar lines:

shared numbervar runWaste:=0;

In the Details section, I have a summary report that has the @SetRunWaste formula:

shared numbervar runWaste;
if (OnFirstRecord) then
(
if not(isnull({x.x-or})) and 
not(isnull({x.y-override})) and {x.y-override} = true then
runWaste:={x.x-or} 
  else
runWaste:= {x.x}
);
runWaste

I see that the result of this formula in the subtask is 18.00.

However, both in the other unit and in the main report in the "Details w" section (as a test), I have the following @test formula:

shared numbervar runWaste;
runWaste;

In both places it is displayed as 0.00.

Why is it showing 0 not 18?

I am using Crystal Reports version 11.0.0.895.

+5
source share
3 answers

, @InitVars , . 0 .

@InitVars , " az" .

- - , , , , .

+9

, , . ; , .

. , , . , (WhilePrintingRecords ).

+1

, ( ):

Crystal Reports - , . Sub , . - .

1

: (LabTotal)

Sub Report 2

: (ItemTotal)

Grand Total

Sub- - . ,

Crystal

  • - > Crystal
  • Crystal Report , " Report"
  • " " " " , make Links ( )
  • "" .
  • , ,

:

Formula -name LabTotal

WhilePrintingRecords; Var LabTotal: = ({PC_LABOUR_DETAILS.Total})

({PC_LABOUR_DETAILS) - ---

LabTotal

, "" → (b) 4 5

Formula -name ItemTotal

WhilePrintingRecords; Var ItemTotal: = Sum {PC_MATERIAL_DETAILS.Total})

({PC_MATERIAL_DETAILS) - -

ItemTotal

- GrandTotal

WhilePrintingRecords; Dormitory Room Var ItemTotal; Generic NumberVar LabTotal; NumberVar TotalAmount; TotalAmount: = ItemTotal + LabTotal; Totalamount

0
source

All Articles