bitsmith2k
Programmer
hey guys,
i've got a bit of a problem here.. dunno if i've maybe overlooked something in my code.. hopefully you can help.
my report works fine on its own. it gives me the the totals i'd expect. i've since added it as a subreport in one of our main reports.. for some strange reason it blows up giving me the error: the string is non-numeric.
this does it for the same set of parameters that i feed it when it's on its own..
the code for the formula that seems to be giving me the problems is below.
thanks
mike
i've got a bit of a problem here.. dunno if i've maybe overlooked something in my code.. hopefully you can help.
my report works fine on its own. it gives me the the totals i'd expect. i've since added it as a subreport in one of our main reports.. for some strange reason it blows up giving me the error: the string is non-numeric.
this does it for the same set of parameters that i feed it when it's on its own..
the code for the formula that seems to be giving me the problems is below.
thanks
mike
Code:
whileprintingrecords;
stringvar ga;
numbervar finalg;
stringvar pa;
numbervar finalp;
if {tblMain_ItemTax.TaxesIncluded} = "Y" then
(
ga := totext (( {tblMain_TransTickets.NetPrice} / {tblMain_TransTickets.NumOfPeople}) * 0.07);
if tonumber (ga[length(ga) - 1]) = 5 and (tonumber (ga[length(ga) -2]) mod 2 = 0) then
finalg := tonumber (ga[1 to length(ga) - 2]) * {tblMain_TransTickets.NumOfPeople}
else
finalg := round (tonumber(ga), 2) * {tblMain_TransTickets.NumOfPeople};
)
else
(
ga := totext ({tblMain_TransTickets.NetPrice} * 0.07);
if tonumber (ga[length(ga) - 1]) = 5 and (tonumber (ga[length(ga) -2]) mod 2 = 0) then
finalg := tonumber (ga[1 to length(ga) - 2])
else
finalg := round (tonumber(ga), 2);
);
if "PST" in {tblMain_TransTickets.ItemTax} then
(
if {tblMain_ItemTax.TaxesIncluded} = "Y" then
(
pa := totext (( {tblMain_TransTickets.NetPrice} / {tblMain_TransTickets.NumOfPeople}) * 0.1);
if tonumber (pa[length(pa) - 1]) = 5 and (tonumber (pa[length(pa) -2]) mod 2 = 0) then
finalp := tonumber (pa[1 to length(pa) - 2]) * {tblMain_TransTickets.NumOfPeople}
else
finalp := round (tonumber(pa), 2) * {tblMain_TransTickets.NumOfPeople};
)
else
(
pa := totext ({tblMain_TransTickets.NetPrice} * 0.1);
if tonumber (pa[length(pa) - 1]) = 5 and (tonumber (pa[length(pa) -2]) mod 2 = 0) then
finalp := tonumber (pa[1 to length(pa) - 2])
else
finalp := round (tonumber(pa), 2);
);
)
else finalp := 0;