travelerII
Technical User
I am using Crystal 10.
I am creating a sales report and we record other income in two ways. On the invoice line with a dimension of OTH and in the invoice elements.
I have created a subreport to get the amount from the invoice elements and have used a shared varible to place it in the main report. I need to be able to add this amount to the amount from the invoice line with the dimension of other. I created a report to get the amount from the details section.
if {SINVOICED.CCE2_0}="OTH"
then({SINVOICED.AMTNOTLIN_0}*{SINVOICE.SNS_0})
else 0
Placed in the detail section this returns the correct amount. Then I wrote the following formula to get the amount allocated to the proper time period
if Year({SINVOICED.INVDAT_0}) = Year({?rptdat}) then
{@Amount Other}
else
0
However when I try to add it to the shared variable
(whileprintingrecords;
shared numbervar YTDOther![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
+
{@Current YTD Other}
I only get the amount of the original shared variable.
If I place the Current YTD Other formula
if Year({SINVOICED.INVDAT_0}) = Year({?rptdat}) then
{@Amount Other}
else
0
in any other section of the main report besides details it returns 0.
How can I get this to work?
Any help is greatly appreciated.
I am creating a sales report and we record other income in two ways. On the invoice line with a dimension of OTH and in the invoice elements.
I have created a subreport to get the amount from the invoice elements and have used a shared varible to place it in the main report. I need to be able to add this amount to the amount from the invoice line with the dimension of other. I created a report to get the amount from the details section.
if {SINVOICED.CCE2_0}="OTH"
then({SINVOICED.AMTNOTLIN_0}*{SINVOICE.SNS_0})
else 0
Placed in the detail section this returns the correct amount. Then I wrote the following formula to get the amount allocated to the proper time period
if Year({SINVOICED.INVDAT_0}) = Year({?rptdat}) then
{@Amount Other}
else
0
However when I try to add it to the shared variable
(whileprintingrecords;
shared numbervar YTDOther
+
{@Current YTD Other}
I only get the amount of the original shared variable.
If I place the Current YTD Other formula
if Year({SINVOICED.INVDAT_0}) = Year({?rptdat}) then
{@Amount Other}
else
0
in any other section of the main report besides details it returns 0.
How can I get this to work?
Any help is greatly appreciated.