Hi;
I have a report which is displaying figures from a global variable of decimal datatype. I want to filter this variable to give say only value less than two. Say hardcoding the variable to give only values less than two.
MonOwed:= NofMonths - NumPayments;
The above line of code is calculating MonOwed, where NofMonths and NumPayments are calculated and iare also a variables. I created a request form with MonOwed as the sourceExp. I want to put say 2 in the textbox and and it should give me only MonOwed:= 2. If i also say >6, i should be about to have all MonOwed > 6 and so on. This is the filter i want. If this filter is done, it should add up the MonOwed.But its not working that way for me.
Any idea please?
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
how can i do this. You idea sound good, but i don't know how do go about it. Can you explain it to me with sample code to achieve this please.
Thanks
1) Create variable of type record, for some table which have fields of type you need to sort. You can create your own or use some existing
2) In loop, where you are calculating the values, insert new record for each "variable" you want to filter with all needed values filled in into the table (record type variable) from step 1
3) Set appropriate filters to the fields you want to filter on.
4) In a loop read all records from the table - you will "see" only records for "variables" you want...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
it will skip the dataitem line and will move to the next one
here is my code
Anything the problem?
[/code]
also where (in what dataitem and what trigger) did you put the CurrReport.SKIP code ?
would be great if you post a dataitems layout of your report
I need to be able to filter by MonOwed.
I have two dataItems; Customer dataitem and Cust. Ledger Entry which is indented and linked by customers no. and dates.
Any Idea please?
so probably your code in the onaftergetrecord trigger should look like this:
I used request form so as to filter by MonOwed but its not working. I used the code below but not working.
what i am not doing correctly?
Thanks
Which one is it??
1)Are you setting the Value In the Request Form
OR
2)is it the different of Months & Payments
OR
3)is it hardcoded to 6?
It can't be all three?
I can see somtheing like
MonOwed := MoOFMonth - NumOfPayments;
if MonOwed <= "VariableSetOnRequestForm"
then CurrReport.Skip;
Hardcoding a 6 or whatever does not allow for changes.
http://www.BiloBeauty.com
http://www.autismspeaks.org
I succeeded with the hardcoding and it is skipping what is not needed, but the total at the bottom is not added the filtered value but it is adding everything.
here is the code:
This is what is not totaling correctly: Any other ideas?
Thanks
In this case do you clear the NofMonths and NumPayments variables (MonOwed = NofMonths - NumPayments) for each new customer? That is to say, on the OnAfterGetRecord of Customer dataitem did you put...
Thanks