Arranging column values

Hi @aworker it looks interesting, can you just explain me what this part of the code does?

How does it find the last column and why do we provide all the letters in the String “columns”? Does it refer to the column names in excel?

Hi @Saishiyam

What it finds is the naming of the last column if it doesn’t go beyond column named “AZ”. This is a kind of trick that works for a “reasonable number of columns”, in my case up to a column with name “AZ”. I do not go beyond this number of columns so it fits my needs. If you go beyond this number in your case, then you would need to modify it and extend it further.

Yes, it does. It converts last column position into its Excel naming.



Thank you, understood @aworker
Is there any function in Java which identifies a string and then based on that condition it colors the row?
for eg, if the string ‘Grand total’ is present in say for eg in the 7th row, is it possible to color that row alone based on this condition?
eg this is how my pivot looks like, Im able to color the first and the last one, but there is a Grand total row which is present in between, as it wont be static and might differ from file to file.