Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

If condition in Report

Posted on by Microsoft Employee

Hi Experts,

I want to filter the row based on the amount above 3000 amount only need to show in report for 4 fileds 

i have written this code but its not working please give any solution.

=IIf((Fields!PrintAmountInLCY.Value Or Fields!PrintDetails.Value AND Fields!AgedCLE2RemAmtLCY.Value>=3000 AND Fields!AgedCLE3RemAmtLCY.Value>=3000 AND Fields!AgedCLE4RemAmtLCY.Value>=3000 AND Fields!AgedCLE5RemAmtLCY.Value>=3000),True, False)

3157.report.png

Thank you

*This post is locked for comments

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: If condition in Report

    Personal recommendation: it’s better to handle business rules in the dataset (NAV) than in RDLC. You can skip the lines that don’t respect your needs and the report will be more clean.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: If condition in Report

    Just go and add the filter on the table instead of Row

    IIf(

    (Fields!PrintAmountInLCY.Value >=3000) AND

    (Fields!AgedCLE2RemAmtLCY.Value>=3000) AND

    (Fields!AgedCLE3RemAmtLCY.Value>=3000) AND

    (Fields!AgedCLE4RemAmtLCY.Value>=3000) AND

    (Fields!AgedCLE5RemAmtLCY.Value>=3000),True, False)

    Not sure what you are using for PrintDetails which you can add the end if you want.

  • Suggested answer
    nav.mukesh Profile Picture
    nav.mukesh 617 on at
    RE: If condition in Report

    Looking at screenshot, it seems you are not checking the AgedCLE2RemAmtLCY.Value and AgedCLE3RemAmtLCY.Value are not >=3000 in the same line.

    You should try with "Or" in place of "And"

    =IIf((Fields!AgedCLE2RemAmtLCY.Value>=3000 Or Fields!AgedCLE3RemAmtLCY.Value>=3000 Or Fields!AgedCLE4RemAmtLCY.Value>=3000 Or Fields!AgedCLE5RemAmtLCY.Value>=3000),True, False)

    The fields Fields!PrintAmountInLCY.Value and Fields!PrintDetails.Value can be also put as "And" Statement if you want to consider those fields as well.

  • Hannes Holst Profile Picture
    Hannes Holst 5,767 on at
    RE: If condition in Report

    Hi,

    I always tend to handle all data in the report before the dataset gets transferred to the layout.

    In your OnAfterGetRecord you could do something like this

    IF AgedCLE3RemAmtLCY < 3000 THEN
      CurrReport.SKIP;


    All records with AgedCLE3RemAmtLCY below 3000 wouldn't transferred to the report layout in the first place.
    It's easier to maintain and you do not have with code in the report layout.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans