Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Get previous value record data provider class SSRS Report

(0) ShareShare
ReportReport
Posted on by 73

Hallo, i'm new in develop and need Help for my case.

pastedimage1675064049177v1.png

i want to create report and get value like yellow record.

row 1: balance due = invoice amount - payment amount

row 2,3,4... : balance due = balancedue from row 1(previous) - payment amount from record active

how to i convert to my code.

my code:

tmp.InvoiceAmount = custInvoiceJour.InvoiceAmount;
tmp.PaymentAmount = custSettlement.SettleAmountCur;
tmp.BalanceDue = tmp.InvoiceAmount - tmp.PaymentAmount;

i know its read record line not get value from previous.

  • Dodi Profile Picture
    Dodi 73 on at
    RE: Get previous value record data provider class SSRS Report

    Thanks Girish,  its Helping me a lot

  • Martin Dráb Profile Picture
    Martin Dráb 230,817 Most Valuable Professional on at
    RE: Get previous value record data provider class SSRS Report

    You could also handle it in the report with RunningValue(). Check out SSRS: Create a running total using RunningValue, for example.

  • Verified answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Get previous value record data provider class SSRS Report

    Hi Dodi,

    Try to save the last balance due amount in buffer variable during each loop and use that variable to calculate due amount. Also initialize integer variable so that for 1st record you can subtract invoice and payment amount and for upcoming records you can use that balanceDue buffer. Try below code and see whether its suit your scenario. Make sure your query run will loop from the highest amount.

    //declare variable for balance due amount and globally.
    Amount balanceDue;
    integer i = 0;
    tmp.InvoiceAmount = custInvoiceJour.InvoiceAmount;
    tmp.PaymentAmount = custSettlement.SettleAmountCur;
    if(i == 0)
    {
        tmp.BalanceDue = tmp.InvoiceAmount - tmp.PaymentAmount;
    }
    else
    {
        tmp.BalanceDue = balanceDue - tmp.PaymentAmount
    }
    //assign value to balanceDue buffer.
    balanceDue = tmp.balanceDue;
    i  = 1;

    Thanks,

    Girish S.

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,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans