display result of query: "select [Measures].[SomeMeasure] on columns, [ParentChildHierachy] on rows from [SomeCube]"
Where ParentChildHierachy is parent-child hierarchy. For example: [HR].[Employees] from mondrian example schema "foodmart".
expand at least two branches of ParentChildHierachy. (Click on some members to expand it)
Expected behavior: expanded headers rendered correctly
Actual behavior: expanded headers rendered incorrectly: Some of header`s cells placed in "measures" column because wrong colspan. see screenshot for example:
The reason is comparison of levels at org.pivot4j.ui.table.TableHeaderNode:573
if (OlapUtils.equals(member.getLevel(),level))
In parent-child and ragged hierarchies level can contains members with different depth.
For example: member
[DirectoryHierachy].[DirectoryLevel].[ParentDirectory] has children
[DirectoryHierachy].[DirectoryLevel].[SubDirectory1] and
[DirectoryHierachy].[DirectoryLevel].[SubDirectory2].
All these members has same level.
While calculating SubDirectory1 span, we should look for SubDirectory2, not for ParentDirectory.
Because ParentDirectory will be different pivot header column (or row) when showParentsMembers == true.
So, it is preferabble to compare member.getDepth instead of member.getLevel.
Steps to reproduce
Expected behavior: expanded headers rendered correctly Actual behavior: expanded headers rendered incorrectly: Some of header`s cells placed in "measures" column because wrong colspan. see screenshot for example:![headers-rendered-incorrectly](https://cloud.githubusercontent.com/assets/13167311/8504247/8acf4e1e-21d6-11e5-8875-34d737659550.PNG)
The reason is comparison of levels at org.pivot4j.ui.table.TableHeaderNode:573 if (OlapUtils.equals(member.getLevel(),level))
In parent-child and ragged hierarchies level can contains members with different depth. For example: member [DirectoryHierachy].[DirectoryLevel].[ParentDirectory] has children [DirectoryHierachy].[DirectoryLevel].[SubDirectory1] and [DirectoryHierachy].[DirectoryLevel].[SubDirectory2]. All these members has same level. While calculating SubDirectory1 span, we should look for SubDirectory2, not for ParentDirectory. Because ParentDirectory will be different pivot header column (or row) when showParentsMembers == true. So, it is preferabble to compare member.getDepth instead of member.getLevel.
See pull request