Hi Experts,
I am presently finding my filtering of report to be case sensitive. I have to type Capital letters before my filter can work. If i type Small letters it does not work.
Can anyone tell me what to do to stop the case sensitivity on my report filters.
I want my report to filter without any case. i.e whether Capital letter or Small Letters it should not Matter,I want it to filter.
Can anyone help.
Regards
0
Comments
Like @*myfilter* will give you:
myFilter
myfilter
MYFILter
...
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Your suggestion worked. But can i have it inside a code without writing it in front of the filter? i.e @lamin
This is because we want them to type any case to have the report work. Doing as you said can make their work tedious. they might even be forgetting to write the @ symbol.
Any idea.
Thanks
if users are entering filter.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Whats wrong with this code
OnPreReport
@*EmployeeFilter := Employee.GETFILTERS;
If it is wrong , Can you please let me see the correct code and where should it be placed.
Thanks.
the string looks like this.
so your code will not work.
you need to use getfilter for every field
EmployeeNoFilter := '@'+Employee.getfilter("No.");
Employee.setfilter("NO.",EmployeeNoFilter);
EmployeeNoFilter := '@'+Employee.getfilter("Name");
Employee.setfilter("Name",EmployeeNoFilter);
Something like that.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I have used your code but it is still not working. Below is your code:
EmployeeNoFilter := '@'+Employee.getfilter("No.");
Employee.setfilter("NO.",EmployeeNoFilter);
EmployeeNoFilter := '@'+Employee.getfilter("Name");
Employee.setfilter("Name",EmployeeNoFilter);
I put it on ; OnPreReport() trigger on the report form designer, but it did not work.
Can anyone tell me the problem. Did anyone have any code that can work?
Please any suggestion.
Regards.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I have put the code on OnPreDataItem(), but it is not still working. I have tried it in all the Possible places but it still did not work.
I am suspecting that the Code has a problem. I have modified the code in various possible ways, but it still not working too.
Did anyone have this problem before? Can anyone help Please.
Regards.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
The filter have been set already and i can filter by any field in the employee table in the employee registration report[This is a new report i created], but the problem is i can only type capital letters to get my report coming out, but when i type small letters nothing comes out. This is why i suspect case sensitivity in Navision. I was thinking that you can have somewhere in Navision database where you can go and change it to case insensitive and i get my report in what ever case i type.
If that is not available, i try using code that can solve this, but i have still not found any code code that will solve it. I have used the one suggested by ara3n but it has not work yet. I was thinking if someone can look at it and see what might be wrong with it.
Any idea please.
Regards.
I assume you can go the reverse way of typing in your filter into some textbox variable & making it uppercase at that point??
MyFinalFilter := UPPERCASE(TextBoxVariable);
then use setfilter, etc etc.
It sure seems alot easier to hit the "Cap Lock " button or type '@'.
http://www.BiloBeauty.com
http://www.autismspeaks.org
Personally I think the thread is heading in the wrong direction. I think Harry is bringing a bit of the real world back to it. Its all a matter of opinion I guess, but I personally don't like to see someone writing code (especially if they are not sure how exactly to use this code), when simple user training can solve the issue.
The issue here starts with users filtering on text fields. This is a big no no in Navision, unless its just for add hock one off situations. Eg you are trying to do a quick hack report to print all items that have the word Blue in them, because some people wrote it wrong, and you want to clean up BLUE, Blue, blue so you filter @*blue*. But this is not something you do every day. If the users need to do it every day, then the report needs to be rethought our, and hopefully done using Code fields. If this user is on SQL, and is using anything other than 850 or 437, then the filters are going to be a huge performance drag on the system.
Now it gets worse, that if you write code on one report on say 10 fields that they want to filter on, you can be 100% certain that they client will come back and say the report does not work, because they want to filter on the eleventh field, and they will want the report fixed for free, AND they will start to think of this as a feature of Navision, and you will find yourselves for ever modifying reports for free.
So the reports that they run multiple times a day, need to be re thought out to filter AND SORT on code fields, and for the "one offs", train the users.
Please listen to Harry, he uses Navision every day, and really knows how to get the most out of it without coding like crazy.
Thank you all very much for your beautiful suggestions. they have really helped me a lot. I have now solved the problem and its working fine now. \:D/
Regards.
So what was the solution in the end?
The Code that i used is as showned below:
IF Employee.GETFILTER("First Name") <> ''
THEN BEGIN
NameFilter := '@'+Employee.GETFILTER("First Name");
Employee.SETFILTER("First Name",NameFilter);
END;
IF Employee.GETFILTER("Last Name") <> ''
THEN BEGIN
LastNameFilter := '@'+Employee.GETFILTER("Last Name");
Employee.SETFILTER("Last Name",LastNameFilter);
END;
Regards.
](*,) ](*,) ](*,) ](*,) ](*,)
What's the point #-o