Report Boolean to filter zero value

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?

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?

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

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.

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;

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

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

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?

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

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

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

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;

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

It is calculated in a Function trigger.

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.

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

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

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

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

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