Formatting other cells if a condition is true?

Hello,

 
I need a hint on how to go about this problem I am having.
 
Basically, I am binding a datatable that has a set of 4 columns repeated N times.  For each column, I have 3 rows above the values to represent headers.  As seen below, the Report Header Type, needs to get formatted for each column in the datatable (dynamically expanding), the Group Header is a seperate datatable that gets merged and centered if values (<#GroupHeader.**>) are the same.  The "Col Head" are set by <#myTable.**>.
 
 
Report Type Header            
Group Header (merge and center if same) Group Header (merge and center if same)
Col 1 Head Col 2 Head Col 3 Head Col 4 Head Col 1 Head Col 2 Head Col 3 Head Col 4 Head
123 123 123 123 123 123 123 123
 
This is the desired output I am seeking, so with that being said, I have a couple questions.
 
1) How would I do something like "<#foreach(<myTable.**>;<format ReportHeaderCell>)> where "format ReportHeaderCell" takes the current cell's row and formats 2-3 rows ahead of it?
 
2) How would I do <#if(<header.**="Col4Head";<#format borders(columns at current - 4, rows at current -1)> so that it adds the border around the "Group Header" and "Col1, Col2, Col3, Col4" headers?
 
Thank You!

Looks like formatting was lost.  Basically, Report Type Header is a blue background that stretches the length of all the columns.

 
Group Header and Col Head's 1-4 are blue background with a border around them all.  This format needs to repeate every 4 columns.

As you have mentioned in the other post, there is a <#merge cells> tag that can merge cells dynamically. I will investigate what you are reporting in the other post and answer there.


About formatting, you can use <#format cell>, with only borders. Search for "Defining Custom Formats" in the document "EndUserGuide.pdf"  Look specially at "Border.Exterior" definition.