}
boolean expanded = false;
boolean same = true;
for (int y = 0; y < members.length; y++) {
final MemberCell memberInfo = new MemberCell();
final Member member = members[y];
expanded = false;
int index = memberList.indexOf(member);
if (index >= 0) {
final AxisOrdinalInfo ordinalInfo = axisInfo.ordinalInfos.get(index);
int depth_i = ordinalInfo.getDepths().indexOf(member.getDepth());
if (depth_i > 0) {
expanded = true;
}
}
memberInfo.setExpanded(expanded);
same = same && i > 0 && Olap4jUtil.equal(prevMembers[y], member);
if (member != null) {
if (lvls != null && lvls.get(member.getHierarchy()) != null) {
memberInfo
.setProperty("levelindex",
"" + lvls.get(member.getHierarchy()).indexOf(member.getLevel().getDepth()));
}
if (x - 1 == offset) {
memberInfo.setLastRow();
}
matrix.setOffset(offset);
memberInfo.setRawValue(member.getUniqueName());
memberInfo.setFormattedValue(member.getCaption()); // First try to get a formatted value
memberInfo.setParentDimension(member.getDimension().getName());
memberInfo.setHierarchy(member.getHierarchy().getUniqueName());
memberInfo.setLevel(member.getLevel().getUniqueName());
memberInfo.setUniquename(member.getUniqueName());
//try {
//memberInfo.setChildMemberCount(member.getChildMemberCount());
//} catch (OlapException e) {
//e.printStackTrace();
//throw new RuntimeException(e);
//}
//NamedList<Property> values = member.getLevel().getProperties();
//for(int j=0; j<values.size();j++){
//String val;
//try {
//val = member.getPropertyFormattedValue(values.get(j));
//} catch (OlapException e) {
//e.printStackTrace();
//throw new RuntimeException(e);
//}
//memberInfo.setProperty(values.get(j).getCaption(), val);
//}
//if (y > 0) {
//for (int previ = y-1; previ >= 0;previ--) {
//if(prevMembers[previ] != null) {
//memberInfo.setRightOf(prevMemberInfo[previ]);
//
// memberInfo.setRightOfDimension(prevMembers[previ].getDimension().getName());
//previ = -1;
//}
//}
//}
//
//
//if (member.getParentMember() != null)
//
// memberInfo.setParentMember(member.getParentMember().getUniqueName());
} else {
memberInfo.setRawValue(null);
memberInfo.setFormattedValue(null);
memberInfo.setParentDimension(null);
}
if (isColumns) {
memberInfo.setRight();
memberInfo.setSameAsPrev(same);
if (member != null) {
memberInfo.setParentDimension(member.getDimension().getName());
}
matrix.set(x, y, memberInfo);
} else {
memberInfo.setRight();
memberInfo.setSameAsPrev(false);
matrix.set(y, x, memberInfo);
}
int x_parent = isColumns ? x : y - 1;
int y_parent = isColumns ? y - 1 : x;
if (index >= 0) {
final AxisOrdinalInfo ordinalInfo = axisInfo.ordinalInfos.get(index);
int depth_i = ordinalInfo.getDepths().indexOf(member.getDepth());
while (depth_i > 0) {
depth_i--;
int parentDepth = ordinalInfo.getDepths().get(depth_i);
Member parent = member.getParentMember();
while (parent != null && parent.getDepth() > parentDepth) {
parent = parent.getParentMember();
}
final MemberCell pInfo = new MemberCell();
if (parent != null) {
pInfo.setRawValue(parent.getUniqueName());
pInfo.setFormattedValue(parent.getCaption()); // First try to get a formatted value
pInfo.setParentDimension(parent.getDimension().getName());
pInfo.setHierarchy(parent.getHierarchy().getUniqueName());
pInfo.setUniquename(parent.getUniqueName());
pInfo.setLevel(parent.getLevel().getUniqueName());
} else {
pInfo.setRawValue("");
pInfo.setFormattedValue(""); // First try to get a formatted value
pInfo.setParentDimension(member.getDimension().getName());
pInfo.setHierarchy(member.getHierarchy().getUniqueName());
pInfo.setLevel(member.getLevel().getUniqueName());
pInfo.setUniquename("");
}
matrix.set(x_parent, y_parent, pInfo);
if (isColumns) {
y_parent--;
} else {