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 :
Finance | Project Operations, Human Resources, ...
Answered

Filter SSRS Report By Production Record with double Datasets/queries

(0) ShareShare
ReportReport
Posted on by 46

Hi all,

I have a report which I am customizing (ProdCalcTrans) and I want to automatic filter the report by ProdId to the selected production order in the ProdTableListPage. ( all custom buttons/menu items are set)

the problem is that I have two Datasets even though I really use only one and both have dynamic filter: true.

I manage two filter by the SrsReportRunController Class the first Query which is the original from AX ( not needed) but I am doing exacly the same code to filter the second query : AKS_ProdCalcTrans but is not filtering. so all the productions are shown in the report :/

pastedimage1600082735283v1.png

Please any help to fix this i really appreciate it.

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,286 on at

    Here is an old thread how to get all the queries https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/210102/ssrs-report---multiple-queries---ranges?pifragment-96834=1 

    Using this approach you get get second query and apply the range, Because now you work with AOT that has nothing to do with report intance.

  • CBNestor Profile Picture
    46 on at

    Working. Perfect. Thanks a lot Ievgen

    protected void prePromptModifyContract()
    {
    
        ProdTable pTable;
        Map             queryContractsMap;
        MapEnumerator   mapEnum;
        Query           query;
        str             queryKey;
    
        pTable = this.parmArgs().record();
    
    
        queryContractsMap = this.getReportContract().parmQueryContracts();
    
        if(queryContractsMap)
        {
            mapEnum = queryContractsMap.getEnumerator();
            /*AKS:NC 15.09.2020 : Will loop in all queries (datasets) of the report and filter the ProdId and ProdStatus
                    which are set as Dynamic Parameters of the Report.
            */
            while(mapEnum.moveNext())
            {
                queryKey = mapEnum.currentKey();
                query = queryContractsMap.lookup(queryKey);
    
                SrsReportHelper::addParameterValueRangeToQuery(query,
                                                        tableNum(ProdTable),
                                                        fieldNum(ProdTable, ProdId),
                                                        SysQuery::value(pTable.ProdId));
    
                SrsReportHelper::addParameterValueRangeToQuery(query,
                                                        tableNum(ProdTable),
                                                        fieldNum(ProdTable, ProdStatus),
                                                        SysQuery::value(pTable.ProdStatus));
            }
        }
    
    }

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 733

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 461 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 278 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans