Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Mon Jan 06, 2014 4:29 pm

Is there an example of applying a data bar conditional format to a column of integers?

Thank you.

starnaus
 
Posts: 1
Joined: Thu Jan 02, 2014 7:10 pm

Tue Jan 07, 2014 6:18 am

Hello,

For your need, please refer to the following method to apply a data bar conditional format to a column of integers. Regarding your email request, we have sent you the demo, please review it.
Code: Select all
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].NumberValue = 1;
sheet.Range["A2"].NumberValue = -2;
sheet.Range["A3"].NumberValue = 3;
sheet.Range["A4"].NumberValue = -4;
sheet.Range["A5"].NumberValue = 5;
ConditionalFormatWrapper format = sheet.Range["A1:A5"].ConditionalFormats.AddCondition();
format.FormatType = ConditionalFormatType.DataBar;
workbook.SaveToFile("sample.xlsx",ExcelVersion.Version2010);

If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.XLS