| Author |
Message |
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|

Topic: supress if zero Posted: 13 Sep 2013 at 2:23am |
|
I have a GL report that adds up credits and debits. It's working and the numbers all look good. The layout is good but for some reason I'm getting 3 random 0's that show up.
I have suppress if zero checked on in the report and sub report and i'm not sure why these zero's are still showing. Is there a trick to it or something I may not be thinking of.
for example I'm getting something like this
credit | debit 418.29 0 29.15 356.10 | 0 | 10 0 | 100
|
IP Logged |
|
|
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 13 Sep 2013 at 3:44am |
likely is it not zero bit rather something like .00001
try and round it to 2 decimals and suppress that =0
|
IP Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|

Posted: 13 Sep 2013 at 3:51am |
|
well, i thought that might be the case so i have already done that. i went through and removed any "Else 0;" statements and I'm still getting random zeros. to me it's not really a big deal but the import cannot have zeros and I can't figure out what it is. The report zero's out also as a GL should which makes it a bit more odd that the zeros showing are random.
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 13 Sep 2013 at 3:54am |
what kind of values are they? RT's, summary fields?
Are they in headers, details , footers?
Subreport values?
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 13 Sep 2013 at 3:59am |
also you can test it by adding a formula to see how the piece of data is being read to try and troubleshoot.
//test
summaryfield = 0
what does it return? true or false?
if false change it to
summaryfield in 0 to 1
now is it true or false?
|
IP Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|

Posted: 13 Sep 2013 at 3:59am |
|
They are sum fields of credits and debits coming from 2 sub reports.
1 sub report for invoices and 1 for checks. they are being displayed in the main reports footer record.
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 13 Sep 2013 at 4:07am |
so the formula field is
sharedvariable1+sharedvariable2
with a suppression formula as what?
|
IP Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|

Posted: 13 Sep 2013 at 4:19am |
so i fixed it up a bit and found a spot that the logic was off but i'm still getting 1 zero using this formula. "format" is a variable that allows for user input so it's checking if the user entered "Number" If format = "NUMBER" Then ( If Debit = 0 Then sOutput := "" Else If Debit > Credit Then sOutput:= toText(Debit - Credit, 2,"") Else sOutput := ""; //removed zero isTextField := FALSE; ); and it returns this
so it looks like i'm still getting this random 0 thing.
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 13 Sep 2013 at 4:30am |
totext does sort of round but you are not rounding in your if calculation.
try this but i warn you that it might give you the output you want it still does not explain the result that is less than a penny
If format = "NUMBER" Then ( If round(Debit,2) = 0 Then sOutput := "" Else If round(Debit,2) > round(Credit,2) Then sOutput:= toText(Debit - Credit, 2,"") Else sOutput := ""; //removed zero isTextField := FALSE; );
|
IP Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|

Posted: 13 Sep 2013 at 4:31am |
|
for suppression i'm just using format field and suppress if zero. on the subreport i just went to suppress formula
if {field1} or {field2} = 0 then true else false
|
IP Logged |
|
|
|