Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

How to write condition in Excel report using excel buffer in business central

Posted on by 153
Hi Guys,
I want to write a condition on excel report using excel buffer.
I have create on excel report using excel buffer.In that report there is 3 columns.
In amount column ,I want to display condition: if amount is 0 then display 'No balance' text in report.
i.e. Column C - Amount (If Amount is 0, then display 'No Balance' instead of 0.)
 
 
Is any way to do this
Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,647 Super User 2024 Season 2 on at
    How to write condition in Excel report using excel buffer in business central
    Hi, or you can use the Format method to convert all the amount into text, and then modify the format uniformly in Excel.
     
    Hope this helps as well.
    Thanks.
    ZHU
  • Verified answer
    TeddyH Profile Picture
    TeddyH 12,868 Super User 2024 Season 1 on at
    How to write condition in Excel report using excel buffer in business central
    Add if condition after the amount calcfields. Example:
     
    "Cust. Ledger Entry".CalcFields(Amount);
    if Amount = 0 then
      Rec_excelbuffer.AddColumn('No Balance', true,'',true,false,false,'',Rec._excelbuffer."Cell Type"::Text)
    else
      Rec_excelbuffer.AddColumn('Amount, true,'',true,false,false,'',Rec._excelbuffer."Cell Type"::Number);

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans