//Set the shared formula
IRange range = worksheet.Range["A3:A25"];
range.FormulaR1C1 = "R[-1]C + 1"; |
Query |
Response | |
My another question is related to conditional formatting. I am not apply Theme color and TintAndShade color on conditional formatting. but RGB color is apply successfully. |
XlsIO doesn't support TintAndShade in conditional formats similar to MS Excel.
However, we have added the theme color support to our Feature request list and it will be implemented in any of our upcoming releases. | |
My second Question is related to cell formatting. I am send Excel file. In this file E1 number column type is date . E1 Column data is show correct value when apply Calibri font . but when apply with Arial font , data show garbage value. ExcelEngine oengine = new ExcelEngine(); IApplication oApp = oengine.Excel; oApp.DefaultVersion = ExcelVersion.Excel2007; IWorkbook oWorkbook = oApp.Workbooks.Create(1); IWorksheets osheets = oWorkbook.Worksheets; IWorksheet osheet = osheets .Worksheets[0]; IRange oRange = osheet .Range["E1"]; oRange.Value2 = "42017"; oRange.NumberFormat = "d-mmm-yyyy"; oRange.CellStyle.Font.FontName = "Arial"; // Orignal Data show oRange.CellStyle.Font.FontName = "Calibri "; // Garabge Data Show |
Whenever the cell value is larger than the cell width, Excel shows the ### in the cell. You need to Autofit the column width to see its actual value.
We request you to Autofit the column width to avoid these kind of issues. Kindly refer the following code snippet to Autofit the UsedRange column width in XlsIO.
Code snippet:
We have also prepared a sample for this which can be downloaded from the following location.
Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/NumberFormat1275646791.zip
|
worksheet.Range["F1:F26"].Formula = "=IF(E12<>\"\",\"Closed\",\"Open\")"; |
Query |
Details | |
My repaired file is not match to the original file (cell F3,F11,F18,F25 have different value ). |
As same formula =IF(E12<>"","Closed","Open") is set to range from F2:F26, Closed is assigned to all the range as E12 is not empty.
So, We suggest you to set shared formula for range F2:F26 to get the results as expected. Kindly refer below code snippet to achieve this.
Code Example:
| |
how to differentiate shared formula in different cases (sometimes i am use FormulaR1C1 function and some time I am use Formula function). |
FormulaR1C1 property sets the incremental formula or shared formula. Formula property sets same formula value for all the range. |
application.EnableIncrementalFormula = true;
worksheet.Range["F2:F26"].Formula = "=IF(E2<>\"\",\"Closed\",\"Open\")";
application.EnableIncrementalFormula = false; |