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 :
Microsoft Dynamics AX (Archived)

RDP Class not working

(0) ShareShare
ReportReport
Posted on by 220

Hello,

So I have written the logic for getting all invoice line amount of all item IDs of a particular group for each day and displaying it in the SSRS. Please check the below code and advise where i went wrong as it is not throwing any error but the report is not even displaying the column names.

Please advise.

While (queryrun.next())
{
_TM_GLTable.clear();
_CustInvoiceTrans = queryrun.get(tableNum(CustInvoiceTrans));

_date = _FromDate;
_noOFDayes = _ToDate - _FromDate;
_totalamt =0;

for(i=1;i>=_noOfDayes;i++)

{

while select * from _inventItemGroupItem where _inventItemGroupItem.ItemGroupId == _ItemGroupId
{
select sum(LineAmount) from _custInvoiceTrans where _custInvoiceTrans.ItemId == _inventItemGroupItem.ItemId
&& _custInvoiceTrans.InvoiceDate == _date ;
_totalAmt += _custInvoiceTrans.LineAmount;

}
_TM_GLTable.initValue();
_TM_GLTable.InvoiceDate = _date;
_TM_GLTable.LineAmount= _totalAmt;
_TM_GLTable.insert();
_date = _date+1;

}


}

*This post is locked for comments

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

    Did you try to debug ?

    Because this line 

    for(i=1;i>=_noOfDayes;i++)

    does not make sense for me, maybe you wanted to do

    for( i=1; i <= _noOfDayes; i++)  

  • Sherwin Profile Picture
    220 on at

    Hi ievgen,

    Thanks!

    Now it is displaying but the amount values are all zero

  • Mea_ Profile Picture
    60,284 on at

    No one really knows what query are you using, if any data exists that meet selection criteria except you. 

    You probably need to debug this method and see where exactly your selects returns no data and try to figure out a reason.

  • Suggested answer
    Dan Emreus Profile Picture
    1,162 on at

    Hi Sherwin,

    If I should do such a report I am not sure that I would even use a rdp-class. I would simply create a new query where I joined CustInvoiceTrans with InventItemGroupItem and than use that query in the ssrs report. In Visual Studio you can create the grouping needed and and also add your totals.

    /Dan

  • Sherwin Profile Picture
    220 on at

    Hi Dan,

    yes that is the first option I had in my mind as well but my client doesnt want to include all line amounts and sum it up. He only wants the total invoice amount for all item IDs of an item group . So for each date only the aggregated amount must be shown as below. 

    6404.Capture1.PNG

  • Suggested answer
    Dan Emreus Profile Picture
    1,162 on at

    Hi again,

    I think you should be able to achieve this.

    Create the query and then use it in Visual Studio. For the design create a new one and use the design of type Matrix. In Column grouping use ItemGroupid and for row grouping use invoice date.

    Done!

    Hope this helps.

    /Dan

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans