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 44

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.

  • CBNestor Profile Picture
    44 on at
    RE: Filter SSRS Report By Production Record with double Datasets/queries

    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));
            }
        }
    
    }

  • Verified answer
    Mea_ Profile Picture
    60,278 on at
    RE: Filter SSRS Report By Production Record with double Datasets/queries

    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.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,758 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans