web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to pass exacly two filtered tables to two dataitems of one report?

(0) ShareShare
ReportReport
Posted on by 104

In previous post I wrote unclear example :D 

 

I need to create report with two data items (for example Sales Header and Sales Line) and I need to pass both two tables to this report. 

 

Situation: User choose Sales Headers. In next step User choose Sales Lines from above Sales Headers. So we have two records with User selection filter.

 

In report I have two dataitems - connected by DataItemLink (Sales Header.No) - and I pass SalesHeader by report .SetTableView property. But how can I also pass second table (SalesLine which contains records selected by User)?

 

For each selected Sales Header I only want to print Sales Lines selected by User. If I only use DataItemLink I get all sales Lines related to selected Sales Header. I want to print only part od them - based on User selection.

 

(this is only example - generally I need to 'filter' two dataitems inside report based on User selection on two records. After user selection I have two tables with only selected records. I want to pass both to dataitems of one report - first is clear - by Report.SetTableView.But what with second table/dataitem?)

  • Suggested answer
    DAnny3211 Profile Picture
    11,423 Super User 2026 Season 1 on at

    Hi

    you have to create a function within the report with the parameters you will need to filter the rows.

    If you call the report from, for example, a page or codeunit... you will call the function

    for example

    report50001.yourfunction(param1,param2..etc)

    DAniele

  • Suggested answer
    YUN ZHU Profile Picture
    103,164 Super User 2026 Season 2 on at

    Hi, I think you can consider adding two fields on the Request Page, Sales Header, Sales Lines (multiple select)

    pastedimage1668383690660v1.png

    Then you can process this filter in the Trigger of the Report.

    Just an idea, hope this helps.

    Thanks.

    ZHU

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 710 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 387 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 385 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans