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

BUILD (7.4.0.20) BUG: Alphabetic Characters in Conditional Formatting Formula interpretted as Named Range

I'm experiencing an error when trying to add a conditional formula that checks if the value is an Alphabetic character. Below is a snippet demonstrating this issue:

IConditionalFormats condition = sheet.Range["A1:A20"].ConditionalFormats;
IConditionalFormat condition1 = condition.AddCondition();
condition1.FormatType = ExcelCFType.CellValue;
condition1.Operator = ExcelComparisonOperator.Equal;
condition1.FirstFormula = "\'r\'"; // ERROR HERE
condition1.FontColor = ExcelKnownColors.Red;
condition1.Color = ExcelKnownColors.Red;

The code will compile fine, however when ran the following unhandled exception is thrown:

Syncfusion.XlsIO.Implementation.Exceptions.ParseException was unhandled
Message="r is not valid named range"
Source="Syncfusion.XlsIO.Base"
StackTrace:
at Syncfusion.XlsIO.Implementation.FormulaParser.CreateLocalName(Int32 iRefIndex, String strToken, ParseParameters arguments, Dictionary`2 indexes, Int32 i, ExcelParseFormulaOptions options)
at Syncfusion.XlsIO.Implementation.FormulaParser.CreateNamedRange(String strToken, ParseParameters arguments, Dictionary`2 indexes, Int32 i, ExcelParseFormulaOptions options, Int32 iRefIndex)
at Syncfusion.XlsIO.Implementation.FormulaParser.ParseIdentifier(String identifier, Dictionary`2 indexes, Int32 i, ExcelParseFormulaOptions options, ParseParameters arguments)
at Syncfusion.XlsIO.Implementation.FormulaParser.ParseFirstOperand(Priority priority, Dictionary`2 indexes, Int32 i, ExcelParseFormulaOptions& options, ParseParameters arguments)
at Syncfusion.XlsIO.Implementation.FormulaParser.ParseExpression(Priority priority, Dictionary`2 indexes, Int32 i, ExcelParseFormulaOptions options, ParseParameters arguments)
at Syncfusion.XlsIO.Implementation.FormulaParser.Parse(String formula, Dictionary`2 indexes, Int32 i, ExcelParseFormulaOptions options, ParseParameters arguments)
at Syncfusion.XlsIO.Implementation.FormulaUtil.ParseString(String strFormula, IWorksheet sheet, Dictionary`2 indexes, Int32 i, Dictionary`2 hashWorksheetNames, ExcelParseFormulaOptions options, Int32 iCellRow, Int32 iCellColumn)
at Syncfusion.XlsIO.Implementation.ConditionalFormatImpl.set_FirstFormula(String value)
at Syncfusion.XlsIO.Implementation.ConditionalFormatWrapper.set_FirstFormula(String value)
at ExcelTestApp.Program.Main(String[] args) in C:\temp\ExcelTestApp\ExcelTestApp\ExcelTestApp\Program.cs:line 22
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:


I attempted a number of variants for escaping the alphabetic character however nothing was successful.

Attached is a sample solution which demonstrates the issue. A support incident was opened for this (Incident #62049).




ExcelTestApp_54f929f9_3a391471.zip

2 Replies

AD Administrator Syncfusion Team November 18, 2009 12:02 PM UTC

Hi Robert,

Thank you for using Syncfusion products.
Its possible to use alphabetics and numbers in conditional formula.The conditional formula is only for setting the Range.I have attached the sample program.
Please refer the sample and let us know if you have any questions.

Regards,
Balamurugan





Alphabetical CharConditional_327ff132.zip


SR Sridhar Syncfusion Team August 30, 2012 06:38 AM UTC

Hi Robert,
 
Please let us know the above sample solved the query reported in this forum and let us know if you require any further assistance on this.
 
Thanks,
Sridhar.S

Loader.
Live Chat Icon For mobile
Up arrow icon