We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SubTotals Formatting

Hi,
I am using the range subtotals and I am trying to figure out how to apply a style to the subtotal row and the grand total row.  I want to change the back ground and make the font bold for the entire line of each so it sticks out better.

Please advise the best way to achieve this.

Thanks,
Tim

1 Reply

MN Meikanda Nayanar Syncfusion Team April 4, 2019 11:42 AM UTC

Hi Tim, 
 
Thank you for contacting Syncfusion support. 
 
We have prepared a sample to achieve your requirement which can be downloaded from the following link. 
 
 
Code snippet: 
string startCell = worksheet[worksheet.UsedRange.Row, worksheet.UsedRange.Column].AddressLocal; 
IConditionalFormat format = worksheet[worksheet.UsedRange.Row, worksheet.UsedRange.Column, worksheet.UsedRange.LastRow, worksheet.UsedRange.LastColumn].ConditionalFormats.AddCondition(); 
format.FormatType = ExcelCFType.Formula; 
format.FirstFormula = string.Format("=LEFT(FORMULATEXT({0}),9)=\"=SUBTOTAL\"", startCell); 
format.BackColor = ExcelKnownColors.Bright_green; 
format.IsBold = true; 
 
Kindly try this and let us know whether it helps. 

Thanks, 
Meikandan 


Loader.
Live Chat Icon For mobile
Up arrow icon