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)

Customer Account Statement report - Show closing balance in the footer

(0) ShareShare
ReportReport
Posted on by

Hi,

I copied standard report design of customer statement report , created a customized design (which will use same DP, Controller, Contract classes) and then added a footer in it as part of customization.

I want to show a Closing balance in the footer with some big font. You can see in the below screen shot. I want to show the exact same value of this field into Footer.

When i used that in the footer, i have to use it with Aggregate function i.e. Sum()  and that is creating issue in below scenario.

I have 2 customers. 1st having balance let's say $100.  and 2nd having balance $0 (assume that it's a newly created customer and doesn't have any transactions). 

In this scenario, when i run the report only for these 2 customers, the 2nd customer would show $100 balance as well. 

Has anyone faced this? Can you please guide how to show correct value i.e. $0 for the 2nd customer who doesn't have any transactions?

CustomerStatementReport.JPG

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    To fix this issue, I put the value of ClosingBalance field into the hidden textbox in body part using Code.SetData(Fields!ClosingBalance) in the expression and in the footer , i received that value using Code.GetData(1,1) value.

    Below are these two functions need to be put in Report Properties -> Code section.

    Shared Data1 as Object

    Shared Data2 as Object

    Shared Data3 as Object

    Public Function GetData(Num as Integer, Group as integer) as Object

    if Group = 1 then

      Return Cstr(Choose(Num, Split(Cstr(Data1),Chr(177))))

    End If

    if Group = 2 then

      Return Cstr(Choose(Num, Split(Cstr(Data2),Chr(177))))

    End If

    if Group = 3 then

      Return Cstr(Choose(Num, Split(Cstr(Data3),Chr(177))))

    End If

    End Function

    Public Function SetData(NewData as Object,Group as integer)

     If Group = 1 and NewData > "" Then

         Data1 = NewData

     End If

     If Group = 2 and NewData > "" Then

         Data2 = NewData

     End If

     If Group = 3 and NewData > "" Then

         Data3 = NewData

     End If

     Return True

    End Function

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