Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

How to add filter section for my customized report in Business Central?

(1) ShareShare
ReportReport
Posted on by 74
Hello everyone,
 
I've created a new report in BC.  I want to add filter section like this picture, but I do not know how can I proceed that.

 
When  I use "ReqFilterFields", I see this error:
  The property 'ReqFilterFields' cannot be used in this contextALAL0124
(property) ReqFilterFields

How can I add filter part to my customized report? 
report 50103 "Vendor Collection"
{
    DefaultLayout = RDLC;
    RDLCLayout = 'VendorCollection.rdl';
    UsageCategory = Administration;
    ApplicationArea = All;

    dataset
    {
        dataitem(VendLedgEntry; "Vendor Ledger Entry")
        {
            DataItemTableView = sorting("Vendor No.", "Entry No.");

            // Example columns - no 'Caption' property here.
            column(VendorNo; "Vendor No.")
            {
            }

            column(VendorPostingDate; "Posting Date")
            {
            }

            column(Amount; Amount)
            {
            }

            column(CurrencyCode; "Currency Code")
            {
            }

            column(RunningBalance; RunningBalance)
            {
            }

            // Initialize and update RunningBalance
            trigger OnPreDataItem()
            begin
                RunningBalance := 0;
            end;

            trigger OnAfterGetRecord()
            begin
                RunningBalance += Amount;
            end;
        }
    }

    var
        RunningBalance: Decimal; 
}
 
Thanks in advance!
  • gdrenteria Profile Picture
    gdrenteria 12,544 Most Valuable Professional on at
    How to add filter section for my customized report in Business Central?

    Hi, good day
    I hope this can help you, and give you some hints.

    How do I: Add filters in a Report in VSCode with AL? – think about IT

    Best Regards
    Gerardo

  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 5,192 on at
    How to add filter section for my customized report in Business Central?
    You can take reference of this Vendor - Order Detail (308, Report Request)
    Hope this helps as well.
     
     
     
     
     
     
     

     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 5,192 on at
    How to add filter section for my customized report in Business Central?
    Hi, Try with the below code:
    report 50103 "Vendor Collection"
    {
        DefaultLayout = RDLC;
        RDLCLayout = 'VendorCollection.rdl';
        UsageCategory = Administration;
        ApplicationArea = All;
     
        dataset
        {
            dataitem(VendLedgEntry; "Vendor Ledger Entry")
            {
                DataItemTableView = sorting("Vendor No.", "Entry No.");
                RequestFilterFields = "Vendor No.", "Vendor Name", "Vendor Posting Group"; //RK added
                // Example columns - no 'Caption' property here.
                column(VendorNo; "Vendor No.")
                {
                }
     
                column(VendorPostingDate; "Posting Date")
                {
                }
     
                column(Amount; Amount)
                {
                }
     
                column(CurrencyCode; "Currency Code")
                {
                }
     
                column(RunningBalance; RunningBalance)
                {
                }
     
                // Initialize and update RunningBalance
                trigger OnPreDataItem()
                begin
                    RunningBalance := 0;
                end;
     
                trigger OnAfterGetRecord()
                begin
                    RunningBalance += Amount;
                end;
            }
     
        }
        // RK-start
        requestpage
        {
            layout
            {
                area(Content)
                {
                    group("Options")
                    {
                        field(ShowAmountsInLCY; ShowAmountsInLCY)
                        {
                            ApplicationArea = All;
                            Caption = 'Show Amounts in LCY';
                        }
                        field(NewPagePerVendor; NewPagePerVendor)
                        {
                            ApplicationArea = All;
                            Caption = 'New Page per Vendor';
                        }
                        field(ExcludeVendorsWithBalance; ExcludeVendorsWithBalance)
                        {
                            ApplicationArea = All;
                            Caption = 'Exclude Vendors That Have A Balance Only';
                        }
                    }
                }
            }
        }
        // RK-end
     
        var
            RunningBalance: Decimal;
            // RK-start
            ShowAmountsInLCY: Boolean;
            NewPagePerVendor: Boolean;
            ExcludeVendorsWithBalance: Boolean;
        // RK-end
    }

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans