NAV 2016 - Export To Excel Color Line

Hi Folks -

I have a simple report that exports 5 fields to excel. User has requested that if the CreditAmt is not 0 then show the line in Red color like example shown below. Is there any property in below code to set the entire line to Red.

ExcelBuf.AddColumn(“Customer No.”,FALSE,’’,FALSE,FALSE,FALSE,’’,ExcelBuf.“Cell Type”::Text);
ExcelBuf.AddColumn(Name,FALSE,’’,FALSE,FALSE,FALSE,’’,ExcelBuf.“Cell Type”::Text);
ExcelBuf.AddColumn(“Document No.”,FALSE,’’,FALSE,FALSE,FALSE,’’,ExcelBuf.“Cell Type”::Text);
ExcelBuf.AddColumn(DebitAmt,FALSE,’’,FALSE,FALSE,FALSE,’’,ExcelBuf.“Cell Type”::Number);
ExcelBuf.AddColumn(CreditAmt,FALSE,’’,FALSE,FALSE,FALSE,’’,ExcelBuf.“Cell Type”::Text);

Example

Customer No. Name Document No. Debit Amt Credit Amt

001 ABC 123 100

002 DEF 456 50

Any help is highly appreciated.

Thanks

Hello,

Here is a nice article by saurav, go thru Export to Excel with Font & Colour and based on your requirement make changes.

Many Thanks Binesh for your help.

Hi sbhatbng,
Did Binesh’s suggestion help you? If yes, please click “This helped me” on his post.
This way the post is marked “Verified” and other users may see which post helped you.