Link to home
Start Free TrialLog in
Avatar of mahmood66
mahmood66Flag for United Arab Emirates

asked on

how to user WhilePrintingRecords

Hi Experts
I have attached image of my exiting report and requirement. code is given below which i have written formula. please help me to correct this correct according to my requirement.
*************************************
WhilePrintingRecords;
numberVar  i ;
if {WhseMst.Name} = "Yard 02" then
   if i+1 = 1 then  
         20
    else
          if i+2  = 2 then
                      40
            else  if i+3  >= 3 then
                      55
else
0
Yard-Issue.bmp
Avatar of radcaesar
radcaesar
Flag of India image

numberVar  i=0 ;
if {WhseMst.Name} = "Yard 02" and {i=0} then 20
else if {WhseMst.Name} = "Yard 02" and {i=1} then 40
else 55
Avatar of mahmood66

ASKER

thanx for reply,
i appled your formula but its still not fullfilling my requirement, i will explain you.
when 1st time "Yard 02" is found then system must print 20
if 2nd time "Yard 02" found then system must print 40
if 3rd time or more than 3rd time "Yard 02" Found  then system must print 55
.eg.
WhseName   yard02
yard 03         0
yard 03         0
yard 02         20
yard 01         0
yard 02        40
yard 01        0
yard 02        55
yard 02        55
yard 03        0
yard 02        55
what is ur problem after applying this logic. send the updated code and screenshot.

pls upload the screenshot in jpeg format as its small in size.
dear Radcaesar:
below is code and see attached output.

WhilePrintingRecords;
numberVar  i=0 ;
if {WhseMst.Name} = "Yard 02" and i=0 then 20
else if {WhseMst.Name} = "Yard 02" and i=1 then 40
else 55

YardIssue1.JPG
Dear My Logic is:
My labour having a incentive on loading of container, in each yard, for 1st container bonus is 20 USD and for 2nd contianer in the same yard  is having Bonus  of 40 USD and for 3rd, 4th,5th ... etc  each container is having 55 USD Bonus.
Note: this report is group by ContainerInDate wise field. (may be it will helps you to sort out this issue)
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dear mlmcc:
a bundal of Thax, almost 90% work done with your support.
The value of variabe must be reset to 1 in next Next group.  for reference see my attachment.
YardIssue2.JPG
dear mlmmc:
thanx for your support. I am giving you points.
its done, greate job of mlmcc