Skip to main content

Notifications

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 

  • WillWU Profile Picture
    WillWU 22,352 on at
    RE: SSRS report Expression in D365Fo

    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.

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: SSRS report Expression in D365Fo

    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;

  • Riyas ahamed F Profile Picture
    Riyas ahamed F 1,215 on at
    RE: SSRS report Expression in D365Fo

    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
    WillWU Profile Picture
    WillWU 22,352 on at
    RE: SSRS report Expression in D365Fo

    Hi Riyas,

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

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: SSRS report Expression in D365Fo

    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
    Martin Dráb Profile Picture
    Martin Dráb 230,846 Most Valuable Professional on at
    RE: SSRS report Expression in D365Fo

    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.

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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans