Skip to main content

Notifications

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
    YUN ZHU Profile Picture
    84,456 Super User 2025 Season 1 on at
    RE: How to pass exacly two filtered tables to two dataitems of one report?

    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

  • Suggested answer
    DAnny3211 Profile Picture
    9,278 Moderator on at
    RE: How to pass exacly two filtered tables to two dataitems of one report?

    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

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,452

#2
YUN ZHU Profile Picture

YUN ZHU 1,313 Super User 2025 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 1,083 Most Valuable Professional

Featured topics

Product updates

Dynamics 365 release plans