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 :
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,284 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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans