web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

SSRS report Expression in D365Fo

(0) ShareShare
ReportReport
Posted on by 1,215

Hi all,

ReportSalary.PNG

As shown in the picture above, I have in form level that row as a negative value.

I checked DP there is no related these kinda records.

And, I found it in the Design <Text box properties<Number <Custom <Expression>

=switch(Fields!AmountMST.Value mod 1 = 0 ,"#,0",Fields!AmountMST.Value mod 1 <> 0,"#,0.00")

i don't understand behind the Expression.

Now, i want to in the report in form level "Basic salary", "Housing"  ....... if its negative i want to in the report as a negative.

if its positive value i want to as a positive so that what should i do ?

Thanks 

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    238,260 Most Valuable Professional on at

    The expression seems to say that if AmountMST is a whole number, the number format should be "#,0", otherwise it should be "#,0.00".

    Note that I don't see any negative value shown in your picture.

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Riyas,

    Looks like this expression is setting the custom expression for the number expression based on the AmountMST field value. This won't have any impact on positive or negative values. Did you debug the DP class to check the values inserted for "Basic salary", "Housing" etc.?

  • Verified answer
    WillWU Profile Picture
    22,363 on at

    Hi Riyas,

    This expression does not convert amountMST to a positive or negative number. Please check the value of the field.

  • Riyas ahamed F Profile Picture
    1,215 on at

    Thanks for replay Mr. Gunjan,

    Yes i did it, in DP class below my code.

     while select setupDetails
                    where setupDetails.MPReportSetup == contract.parmreportSetup()
                {
                    amt = setupDetails.EvaluateColumn(pcw.PayCycleID,pcw.Worker);
        
        
                    MPPayCycleDebCrReport.DebitCredit       = setupDetails.debCred();
                    MPPayCycleDebCrReport.Description       = setupDetails.colDesc();
                    MPPayCycleDebCrReport.ColNum            = setupdetails.ColNum;
                    MPPayCycleDebCrReport.AdditionDeduction = setupdetails.AdditionDeduction; // Added By Saad
                    //breakpoint;
                    //info(strFmt("%1", worker.grossSalary()));
                    if(MPPayCycleDebCrReport.DebitCredit == DebitCredit::Credit)
                    {
                        MPPayCycleDebCrReport.AmountMST     =  -1 * amt;
                    }
                    else
                    {
                        MPPayCycleDebCrReport.AmountMST     =  amt;
                    }
                    MPPayCycleDebCrReport.insert();
        
                }

    Thanks for replay Mr.Martin,

    in design its showing positive records but form level there is negative as a highlight the records.

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Riyas,

    Looks like this block of code is converting the negative number to positive

    if(MPPayCycleDebCrReport.DebitCredit == DebitCredit::Credit)
    {
        MPPayCycleDebCrReport.AmountMST     =  -1 * amt;
    }
    else
    {
        MPPayCycleDebCrReport.AmountMST     =  amt;
    }

    You can simply replace this block of code with this line so that the values are not converted

    MPPayCycleDebCrReport.AmountMST     =  amt;

  • WillWU Profile Picture
    22,363 on at

    Hi Riyas,

    What is the basis for Debit and Credit?

    If the amountmst itself has positive and negative values, then you could use the value directly.

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

News and Announcements

Season of Giving Solutions is Here!

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
Abhilash Warrier Profile Picture

Abhilash Warrier 836 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 349 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans