# Report Boolean to filter zero value

**URL:** <https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290>\
**Category:** Developers Forum\
**Created:** [October 5, 2005, 1:24pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290 "2005-10-05T13:24:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![PenGwenInc](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@PenGwenInc](https://www.dynamicsuser.net/u/PenGwenInc)\
**Post date:** [October 5, 2005, 1:24pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/1 "2005-10-05T13:24:04Z")

</div>

I’ve added a Boolean to the Request Form in the “Inventory to G/L Reconcile” report. When the Boolean is checked, I would like the report to display only items with a zero “Inventory Value”. The InventoryValue field is an existing calced field on the report. I can’t seem to code this properly and the Boolean doesn’t filter when checked. It should filter on 0 Inventory Values, but I cant get it to work. Any ideas?

---

<div class="post-metadata">

**Author:** ![Marq](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@Marq](https://www.dynamicsuser.net/u/Marq)\
**Post date:** [October 5, 2005, 1:34pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/2 "2005-10-05T13:34:40Z")

</div>

What is the exact report no. and navision version you are using? If you cannot filter it may be a calculated field, have you tried skipping them?

---

<div class="post-metadata">

**Author:** ![PenGwenInc](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@PenGwenInc](https://www.dynamicsuser.net/u/PenGwenInc)\
**Post date:** [October 5, 2005, 2:09pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/3 "2005-10-05T14:09:03Z")

</div>

Report 10138 Version 3.70 It is a calculted field. What do you mean by “Try skipping them”

---

<div class="post-metadata">

**Author:** ![Marq](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@Marq](https://www.dynamicsuser.net/u/Marq)\
**Post date:** [October 5, 2005, 2:14pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/4 "2005-10-05T14:14:46Z")

</div>

Ok, so it is a report specialy for your country then? You can use CurrReport.SKIP if you want a report not to do something with a record. You usualy use this if you cannot filter on a field or the filter is conditional.

---

<div class="post-metadata">

**Author:** ![PenGwenInc](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@PenGwenInc](https://www.dynamicsuser.net/u/PenGwenInc)\
**Post date:** [October 5, 2005, 2:44pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/5 "2005-10-05T14:44:28Z")

</div>

I’ve inserted the following in the OnPreDataItem trigger and my report still shows items with values. My Boolean on the request form is “Show0Values” IF Show0Values THEN BEGIN IF InventoryValue \<\> 0 THEN CurrReport.SKIP END;

---

<div class="post-metadata">

**Author:** ![Marq](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@Marq](https://www.dynamicsuser.net/u/Marq)\
**Post date:** [October 5, 2005, 2:46pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/6 "2005-10-05T14:46:43Z")

</div>

The CurrReport.SKIP shoud be used in the OnAfterGetRecord trigger.

---

<div class="post-metadata">

**Author:** ![PenGwenInc](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@PenGwenInc](https://www.dynamicsuser.net/u/PenGwenInc)\
**Post date:** [October 5, 2005, 2:53pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/7 "2005-10-05T14:53:48Z")

</div>

I moved the code to the OnAfterGetRecord but it is still not filtering.

---

<div class="post-metadata">

**Author:** ![Marq](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@Marq](https://www.dynamicsuser.net/u/Marq)\
**Post date:** [October 5, 2005, 2:57pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/8 "2005-10-05T14:57:06Z")

</div>

Ok. I am sorry for that. I do not have the report, it is a country specific thing, so I cannot have a look at it unfortunately. Have you used the debugger on this?

---

<div class="post-metadata">

**Author:** ![PenGwenInc](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@PenGwenInc](https://www.dynamicsuser.net/u/PenGwenInc)\
**Post date:** [October 5, 2005, 3:07pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/9 "2005-10-05T15:07:30Z")

</div>

Thank you for your efforts Marq. Are there any Americans with any ideas?

---

<div class="post-metadata">

**Author:** ![thomasbrodkorb](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@thomasbrodkorb](https://www.dynamicsuser.net/u/thomasbrodkorb)\
**Post date:** [October 5, 2005, 3:16pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/10 "2005-10-05T15:16:21Z")

</div>

Your code in your OnAfterGetRecord - Trigger should look like this: ` IF Show0Values THEN BEGIN CALCFIELDS(InventoryValue); IF InventoryValue <> 0 THEN CurrReport.SKIP; END; ` if your InventoryValue is a flowfield. if it is not, please tell me how you determine the InventoryValue

---

<div class="post-metadata">

**Author:** ![thomasbrodkorb](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@thomasbrodkorb](https://www.dynamicsuser.net/u/thomasbrodkorb)\
**Post date:** [October 5, 2005, 3:17pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/11 "2005-10-05T15:17:36Z")

</div>

Oooh sorry. Can I withdraw my answer as I’m not American ? [:D]

---

<div class="post-metadata">

**Author:** ![PenGwenInc](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@PenGwenInc](https://www.dynamicsuser.net/u/PenGwenInc)\
**Post date:** [October 5, 2005, 3:24pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/12 "2005-10-05T15:24:42Z")

</div>

I’m sorry! I thought only American’s had the report! I take it back, please forgive me. The field is not a flowfield, it is calculated as follows: InventoryValue := TotalInvoicedValue + TotalExpectedCost;

---

<div class="post-metadata">

**Author:** ![thomasbrodkorb](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@thomasbrodkorb](https://www.dynamicsuser.net/u/thomasbrodkorb)\
**Post date:** [October 5, 2005, 3:26pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/13 "2005-10-05T15:26:36Z")

</div>

In fact it does not matter if I have the report or not. Where does the value get calculated ? In what trigger I mean ?

---

<div class="post-metadata">

**Author:** ![PenGwenInc](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@PenGwenInc](https://www.dynamicsuser.net/u/PenGwenInc)\
**Post date:** [October 5, 2005, 3:30pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/14 "2005-10-05T15:30:41Z")

</div>

It is calculated in a Function trigger.

---

<div class="post-metadata">

**Author:** ![thomasbrodkorb](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@thomasbrodkorb](https://www.dynamicsuser.net/u/thomasbrodkorb)\
**Post date:** [October 5, 2005, 3:37pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/15 "2005-10-05T15:37:13Z")

</div>

OK, to get it clear: if the InventoryValue variable which I assume to be global (otherwise you could not print that value), is getting calculated in the OnAfterGetRecord Trigger or in a function called by the OnAfterGetRecordTrigger, then you can access the value from the moment where you calculate it, until the moment you calculate the next time (i.e. on the next record). So you can use the InventoryValue value either in the OnAfterGetRecordTrigger to CurrReport.Skip the record, or you can use that in the OnPreSection Trigger of the section displaying the InventoryValue variable with the following code: ` CurrReport.SHOWOUTPUT( (Show0Values AND InventoryValue = 0) OR (NOT Show0Values)); ` It mainly depends on the fact that the value is being calculated already when you try to use it for your purpose. It is also necessary (to get back to the OnAfterGetRecord trigger) that you call the code in the dataitem which you want to suppress the body section for.

---

<div class="post-metadata">

**Author:** ![zimiwings](https://avatars.discourse-cdn.com/v4/letter/z/dec6dc/32.png) [@zimiwings](https://www.dynamicsuser.net/u/zimiwings)\
**Post date:** [October 5, 2005, 3:46pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/16 "2005-10-05T15:46:34Z")

</div>

You could try to code it on the Section that gets printed. In The OnPreSection Header use: IF Show0Values AND (InventoryValue \<\> 0) THEN CurrReport.SHOWOUTPUT(FALSE); regards Daniel Zimmermann

---

<div class="post-metadata">

**Author:** ![thomasbrodkorb](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@thomasbrodkorb](https://www.dynamicsuser.net/u/thomasbrodkorb)\
**Post date:** [October 5, 2005, 3:47pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/17 "2005-10-05T15:47:48Z")

</div>

THX Daniel, but this is exactly what I suggested [;)]

---

<div class="post-metadata">

**Author:** ![zimiwings](https://avatars.discourse-cdn.com/v4/letter/z/dec6dc/32.png) [@zimiwings](https://www.dynamicsuser.net/u/zimiwings)\
**Post date:** [October 5, 2005, 3:50pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/18 "2005-10-05T15:50:27Z")

</div>

Yep, didn’t see your reply until it was too late…

---

<div class="post-metadata">

**Author:** ![PenGwenInc](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@PenGwenInc](https://www.dynamicsuser.net/u/PenGwenInc)\
**Post date:** [October 5, 2005, 3:58pm UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/19 "2005-10-05T15:58:56Z")

</div>

Thanks guys! It worked. Thanks for all your help!

---

<div class="post-metadata">

**Author:** ![vardhan](https://avatars.discourse-cdn.com/v4/letter/v/ebca7d/32.png) [@vardhan](https://www.dynamicsuser.net/u/vardhan)\
**Post date:** [February 15, 2011, 5:55am UTC](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290/20 "2011-02-15T05:55:13Z")

</div>

Hi,

I am genarating a simple report. In CustTable I am having Boolean(YesNo) type for Car Field. now i want to genarate only “no” type custDetails.

Thanks in Adv

[Next page](https://www.dynamicsuser.net/t/report-boolean-to-filter-zero-value/10290.md?page=2)
