# Report.SetTableView(var Record) Method
> Version: _Available or changed with runtime version 1.0._
Applies the table view on the current record as the table view for the page, report, or XmlPort.
## Syntax
```al
 Report.SetTableView(var Record: Record)
```
## Parameters
Report
Type: report-data-type
An instance of the report-data-type data type.
Record
Type: ../record/record-data-type
The record that has a table view that you want to apply to the page or data item.
## Remarks
The table view is the view of the table that you present to the user. You determine what records that the user can see by setting filters, determining the sorting order, and selecting the keys.
This method only narrows the view of the table that was set through the ../../properties/devenv-sourcetableview-property of the page or through the ../../properties/devenv-dataitemtableview-property of the data item.
> IMPORTANT
> SETTableView is not supported for setting views on subpages from code on table headers. For example, you cannot set a table view on the SalesOrder subpage from the SalesHeader.
## Example
This example is based on the Sales Header table and shows how SETTableView is used for a page object.
```al
var
    SalesHeader: Record "Sales Header";
    SomePage: Page "Sales List";
begin
    SalesHeader.SETCURRENTKey("Document Type");
    SalesHeader.SETRANGE("Document Type",SalesHeader."Document Type"::Order);
    SomePage.SETTableView(SalesHeader); // Only view sales orders.
    SomePage.Run;
end;
```
The page that is reference by the SomePage variable can be any page object that has Sales Header as the value of the ../../properties/devenv-sourcetable-property.
## Related information
report-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/report/reportinstance-settableview-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/report/reportinstance-settableview-method/
