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

Notifications

Announcements

No record found.

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?)

I have the same question (0)
  • Suggested answer
    DAnny3211 Profile Picture
    11,397 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
    95,729 Super User 2025 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,664

#2
YUN ZHU Profile Picture

YUN ZHU 960 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans