Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

If condition in Report

(0) ShareShare
ReportReport
Posted on by

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
    37,166 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
    47,789 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
    619 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
    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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans