Hi Team,
I am displaying sub-totals in my report and it is showing as formula when I click on the sub-total cell. Is there any way to display value as text?
Thanks in advance.
Hi,
Hi,
I used below code to display sub-totals.
xlWs.Cells.Subtotal(cellarea, intColIndex - 1, ConsolidationFunction.Sum, totalList:=strList, replace:=True, pageBreaks:=True, summaryBelowData:=True)
After getting sub-totals I am checking cell value using below code inside a loop to check the value of cell.
Suppose if I have a value 150 in cell (7,8)
then below condition is showing as blank.
Below code is working fine as it is working for other cells… due to formula inside it is not showing the value. Is there a way to convert formula field to text value while checking the cell value?
xlWs.Cells(totRows , iCol - 1).Value
Hi,
Excellent Amjad Sahi , I am very happy with your response.
I have now small issue after fixing big issue. Please suggest as well.
I am loosing sub-total row style when I am displaying indicators in one of the sub-total row.
Why I am loosing my sub-total row color?
Please provide your valuable suggestion.
Thanks.
Hi,
Hi,
Is there a way to apply style to particular cell directly.
Example :xlws.cells(3,5) --> in Green color.
Thanks
Hi,
//Define a Style and get the F4 cell style
Style style = xlws.Cells[3,5].GetStyle();//Setting the foreground color to yellow
style.ForegroundColor = Color.Yellow;//Setting the background pattern
style.Pattern = BackgroundType.Solid;//Apply the style to F4 cell
xlws.Cells[3,5].SetStyle(style);
…
Hope, this helps a bit.
Thanks for response.
Actually I have range for column “I”(I2 to I60) but I want to provide style based on first cell value of that particular row.
Currently I don’t have anything to access rownum, is there a way to identify the value of row’s first cell based on I8 cell.
in this case I want to know the 8th row first cell value.
Please advise.
Hi,