ajstickland
MIS
Hi
I’ve come across a very strange problem.
I have a main report that is grouped per contract manager > contract number and shows the summarised amount of actual hours worked on each contract by the engineers. I have inserted within the main report at contract group level and declared a shared variable to pass the planned hours to the main report (i.e. subreport has been placed above the area in the main report I am using the variables.)
The outcome is for the vast majority of the contracts the shared variables are displaying the contract data. However, this is the strange bit, where a contract exists in the main report but doesn’t in the sub report the shared variable returns not 0 but the value of the previous contract which can be found.
E.g.
Contract Planned hrs (Sub Report Variable) ActualHrs
1234567 45 13 471245785 12 11
//Both contract numbers can be found in the sub report - correct
4578998 12 11
//Contract is not found on the sub report so returns the last known contract
4587788 12 11
//Same as above
I have set up the shared variables like this:
Main report:
whileprintingrecords;
shared numbervar pass_hours_inc_sub;
pass_hours_inc_sub;
Sub Report:
whileprintingrecords;
shared numbervar pass_hours_inc_sub:= Sum ({@Hours_Decimal_Inc_Sub}, {Contract_More.CM_Data20})
I’m guessing this is going to be a problem with recognising and knowing what to do with nulls but I have got no idea how to overcome this.
Have you got any ideas, all the help is greatly appreciated!
I’ve come across a very strange problem.
I have a main report that is grouped per contract manager > contract number and shows the summarised amount of actual hours worked on each contract by the engineers. I have inserted within the main report at contract group level and declared a shared variable to pass the planned hours to the main report (i.e. subreport has been placed above the area in the main report I am using the variables.)
The outcome is for the vast majority of the contracts the shared variables are displaying the contract data. However, this is the strange bit, where a contract exists in the main report but doesn’t in the sub report the shared variable returns not 0 but the value of the previous contract which can be found.
E.g.
Contract Planned hrs (Sub Report Variable) ActualHrs
1234567 45 13 471245785 12 11
//Both contract numbers can be found in the sub report - correct
4578998 12 11
//Contract is not found on the sub report so returns the last known contract
4587788 12 11
//Same as above
I have set up the shared variables like this:
Main report:
whileprintingrecords;
shared numbervar pass_hours_inc_sub;
pass_hours_inc_sub;
Sub Report:
whileprintingrecords;
shared numbervar pass_hours_inc_sub:= Sum ({@Hours_Decimal_Inc_Sub}, {Contract_More.CM_Data20})
I’m guessing this is going to be a problem with recognising and knowing what to do with nulls but I have got no idea how to overcome this.
Have you got any ideas, all the help is greatly appreciated!