Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

SSRS reduces retrieval and adds filtering to code

Posted on by 35

There were more than 10,000 lines, but only a small part was added to the report. Most of them will be discarded, whether they can restrict retrieval and add filtering through development

perDate = contract.parmPerDate();

while(queryRun.next())

   {

       if(queryRun.changed(tablenum(CustTable)))

       {

           custTable = queryRun.get(tablenum(CustTable));

       }

       custTrans = queryRun.get(tablenum(CustTrans));

       if(custTrans.TransDate <= perDate &&

          (custTrans.Closed == dateNull()||

           custTrans.Closed> perDate))

       {

        ...

           this.insertCustTransOpenPerDateTmp();

       }

   }

*This post is locked for comments

  • Sival Profile Picture
    Sival 35 on at
    RE: SSRS reduces retrieval and adds filtering to code

    Thanks all.

  • Verified answer
    Blue Wang Profile Picture
    Blue Wang on at
    RE: SSRS reduces retrieval and adds filtering to code

    Hi Sival,

    Your If condition restricts retrieval, remove the if-condition add data range.

    QbdsCustTrans = SysQuery:: findOrCreateDataSource (queryRun. query (), tableNum (CustTrans));
    QbdsCustTrans. addRange (field Num (CustTrans, TransDate). value (queryRange (null, perDate));
    QbdsCustTrans. addRange (field Num (CustTrans, Closed). value (queryValue (dateNull ());
    QbdsCustTrans. addRange (field Num (CustTrans, Closed). value (strFmt ('>% 1', queryValue (perDate));


  • Verified answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: SSRS reduces retrieval and adds filtering to code

    You have CustTrans as a data source in your query, before executing it you can add new range by Closed field and set range value to perDate. In this case SQL will filter records and return you only valid. 

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans