Report Request Page filtering

If I have a table of 10 fields for example. I have a report that displays a filter with all those fields in the filter option on request page.

My question is, how can i edit the filter, so that it would display only one field from the table and you can’t see ohter fields at all, just this one field (Beginning Date) and the second filter to display another field (End date).

You can advise the system to not show the filter pane for the record (Just assign a “TableView” to the dataitem) and add Your “Beginning Date” and “Ending Date” as global Variables, then add those to the request page.
In the OnPreDataItem section of the dataitem you just set the filter accordingly.

I was thinking more inside the code. Code example atm:

BufferTemp.RESET;
BufferTemp.DELETEALL;

Periods.RESET;
Periods.SETFILTER(“No.”,“Payroll Periods”.GETFILTER(“No.”)); //FromPeriod,ToPeriod);
//Periods.SETFILTER(“No.”,“Payroll Periods”.GETFILTER(“Beginning Date”)); //FromPeriod,ToPeriod);
IF Periods.FINDFIRST THEN
REPEAT
Deps.RESET;
IF Deps.FINDFIRST THEN
REPEAT
Contracts.RESET;
Contracts.SETFILTER(“From Date”,’<=%1’,Periods.“Ending Date”);
Contracts.SETFILTER(“To Date”,’%1|>=%2’,0D,Periods.“Ending Date”);
Contracts.SETRANGE(“Department No.”,Deps.“No.”);
IF Contracts.FINDFIRST THEN
REPEAT
CASE EmplType OF
0: EmplValid := TRUE;
1: BEGIN
EmplStatus.RESET;
EmplStatus.SETRANGE(Status,EmplStatus.Status::Inactive);
EmplStatus.SETRANGE(“Employee No.”,Contracts.“Employee No.”);
EmplStatus.SETFILTER(“From Date”,’<=%1’,Periods.“Ending Date”);
EmplStatus.SETFILTER(“To Date”,’%1|>=%2’,0D,Periods.“Ending Date”);
EmplValid := NOT EmplStatus.FINDFIRST;
END;
2: BEGIN
EmplStatus.RESET;
EmplStatus.SETRANGE(Status,EmplStatus.Status::Inactive);
EmplStatus.SETRANGE(“Employee No.”,Contracts.“Employee No.”);
EmplStatus.SETFILTER(“From Date”,’<=%1’,Periods.“Ending Date”);
EmplStatus.SETFILTER(“To Date”,’%1|>=%2’,0D,Periods.“Ending Date”);
EmplValid := EmplStatus.FINDFIRST;
END;
END;
IF EmplValid THEN BEGIN
BufferTemp.INIT;
BufferTemp.“Department No.” := Deps.“No.”;
BufferTemp.“Employee No.” := Contracts.“Employee No.”; // key
BufferTemp.Date := Periods.“Ending Date”; // key
IF Contracts.“Working Factor” = 0 THEN
BufferTemp.“Used Days” += 1
ELSE
BufferTemp.“Used Days” += Contracts.“Working Factor”;
IF NOT BufferTemp.INSERT THEN BufferTemp.MODIFY;
END;
UNTIL Contracts.NEXT = 0;
UNTIL Deps.NEXT = 0;
UNTIL Periods.NEXT = 0;
SETRANGE(Number,1,BufferTemp.COUNT);

So you’re creating a report using an “Integer” dataitem to display the BufferTemp records?

Then instead of using the ReqFilterFields, you could create the one filter you want to use as a global variable and only show this in the request page. Then apply this filter to the BufferTemp table before fetching the records.

Important:

When you intend to LOOP through records (REPEAT…UNTIL) then you should use FINDSET instead of FINDFIRST!!!

According to your code, the only thing you need from the Payroll Period Table is the “No.” of the period.

Therefore, remove the “Payroll Period” from the dataitems and create a PayrollPeriodNo as a global variable (Code20 most probably).

Then design the Request Page and add the field "PayrollPeriodNo there, set the table relation for the field to “Payroll Period” and replace your line:
Periods.SETFILTER(“No.”,“Payroll Periods”.GETFILTER(“No.”));
with
Periods.SETFILTER(“No.”,PayrollPEriodNo);

That would be it!