Skip to main content

Notifications

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,035 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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,928 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans