Design the request options page
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.
On reports, in addition to defining the filter options by setting the RequestFilterFields property, you can add a requestpage section. In this section, you can set the SaveValues Property to true in order to save the values that the end user enters on the request page. When the report is run again, the end user has the option to use previously defined filters.
You can also add a layout to the request page, specifying an Options section to perform checks.
You can use the SaveValues property together with the AllowScheduling Property to set up the request page to support multiple previews. When both properties are true, users can preview the report from the request page as many times as the like, without having the request page close. This capability lets users change filters, see what the generated report would look like, and then try again. If either property is set to false, the report won't support multiple previews and the request page closes once the user previews the report. In this case, the request page includes a Preview and Close button instead of Preview.
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.
When the user selects the Hide Blocked Customers? option, only customers that aren't blocked are added in the dataset.