peebles1979
MIS
hi, im using crystal 8.5 and i want to use my shared variable from my main report formula to my sub report. My report is to get the vessels in a day. For example:
Parameter Date: 06/15/2005
Return Value of Vessel should be: GIRALDA
KOHFU
MEDINA
The syntax of my formula on how to get the vessel:
formula {@xvessel}
shared vessel as string
shared a(1) as string
shared i as number
i = 1
do while i = 1 to {@display}
if {view_Prod_Today.Date1} = {?Date} then
redim preserve a(i)
a(i) = {view_Prod_Today.Vessel}
vessel = a(i)
formula = vessel
end if
i = i + 1
loop
--MAIN REPORT--
GroupHeader1 - Date
GroupHeader2 - Vessel (I inserted my {@xvessel} formula here in group header 2 and it returned the value of GIRALDA, KOHFU and MEDINA.
Now, how can I used this to my subreport. My subreport is to display the value of boxes produced based on the result of vessels from main report. For example the above date parameter: 06/15/2005 and the return vessel of that date are GIRALDA, KOHFU, MEDINA. I will get the summary report of that Vessel from that current date backward until their vessel is equal to the current vessel of main report?
Ex.
06/15/05 - GIRALDA, KOHFU, MEDINA >>>> this is the current
date
06/14/05 - LERIDA, KOHFU, GIRALDA,
06/13/05 - GIRALDA
Therefore, I will get the boxes produced from the current date(6/15/05) and then check if date(6/14/05) have vessel equal to current date. if its equal get again the boxes produce.
Parameter Date: 06/15/2005
Return Value of Vessel should be: GIRALDA
KOHFU
MEDINA
The syntax of my formula on how to get the vessel:
formula {@xvessel}
shared vessel as string
shared a(1) as string
shared i as number
i = 1
do while i = 1 to {@display}
if {view_Prod_Today.Date1} = {?Date} then
redim preserve a(i)
a(i) = {view_Prod_Today.Vessel}
vessel = a(i)
formula = vessel
end if
i = i + 1
loop
--MAIN REPORT--
GroupHeader1 - Date
GroupHeader2 - Vessel (I inserted my {@xvessel} formula here in group header 2 and it returned the value of GIRALDA, KOHFU and MEDINA.
Now, how can I used this to my subreport. My subreport is to display the value of boxes produced based on the result of vessels from main report. For example the above date parameter: 06/15/2005 and the return vessel of that date are GIRALDA, KOHFU, MEDINA. I will get the summary report of that Vessel from that current date backward until their vessel is equal to the current vessel of main report?
Ex.
06/15/05 - GIRALDA, KOHFU, MEDINA >>>> this is the current
date
06/14/05 - LERIDA, KOHFU, GIRALDA,
06/13/05 - GIRALDA
Therefore, I will get the boxes produced from the current date(6/15/05) and then check if date(6/14/05) have vessel equal to current date. if its equal get again the boxes produce.