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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SubTotals Formatting

Thread ID:

Created:

Updated:

Platform:

Replies:

143748 Apr 3,2019 05:58 PM UTC Apr 4,2019 11:42 AM UTC WinForms 1
loading
Tags: XlsIO
Tim Larson
Asked On April 3, 2019 05:58 PM UTC

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

Meikanda Nayanar [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon