Design the request options page

Completed

When you create a new report, a request page is created automatically for the report. Also, you can create custom options in the Request page. You do this by adding a requestpage section.

The requestpage section has the following syntax:

requestpage
    {
        layout
        {
            area(Content)
            {
                group(GroupName)
                {
                    field(Name; SourceExpression)
                    {
                        ApplicationArea = All;

                    }
                }
            }
        }

        actions
        {
            area(processing)
            {
                action(ActionName)
                {
                    ApplicationArea = All;

                }
            }
        }
    }

In this section, you can set the SaveValues property to true to save the values that the end user enters on the request page. When the report is run again, the end user can use previously defined filters.

    requestpage
    {
        SaveValues = true;

You can also add a layout to the request page, specifying an Options section to perform checks.

The following example adds a field to the Options tab of the request page to show or hide blocked customers.

report 50102 Example_DataItems_Join
{
    UsageCategory = ReportsAndAnalysis;
    ApplicationArea = All;
    RDLCLayout = './other/Example_DataItems_Join.rdl';
    DefaultLayout = RDLC;

    dataset
    {
        dataitem(Customer; Customer)
        {
            PrintOnlyIfDetail = true;
            RequestFilterFields = "No.", "Search Name", "Customer Posting Group";
            column(CustomerNo; "No.")
            {
            }
            column(CustomerName; Name)
            {
            }
            dataitem(CustomerLedgers; "Cust. Ledger Entry")
            {
                DataItemLinkReference = Customer;
                DataItemLink = "Customer No." = field("No.");
                DataItemTableView = sorting("Customer No.");
                column(CustomerLedgersCustomerNo; "Customer No.")
                {
                }
                column(CustomerLedgersAmountLCY; "Amount (LCY)")
                {
                }
            }
            trigger OnPreDataItem()
            begin
                if HideBlockedCustomers then
                    Customer.SetRange(Blocked, Blocked::" ");
            end;
        }
    }
    requestpage
    {
        SaveValues = true;
        layout
        {
            area(Content)
            {
                group(Options)
                {
                    field(HideBlockedCustomers; HideBlockedCustomers)
                    {
                        ApplicationArea = All;
                        Caption = 'Hide Blocked Customers?';
                    }
                }
            }
        }
    }
    var
        HideBlockedCustomers: Boolean;
}

The following request page is generated when you run the report.

Request page with Hide Blocked Customers option

When the user selects the Hide Blocked Customers? option, only customers that aren't blocked are added in the dataset.