optimist
02-27-2010, 11:28 AM
I'm trying to get captionExpression to work in 3.1.5. I found a bug report with patch (http://jira.pentaho.com/browse/MONDRIAN-683) but even after applying the patch I have no luck. I suspect it's because my level is hierarchical - does it work for hierarchical levels?
Specifically, I get a SQLException due to Invalid column index in mondrian.rolap.SqlMemberSource.getMemberChildren2() and I see from debugging that the caption expression isn't in the result set because it isn't in the generated sql for this level, yet childLevel.hasCaptionColumn() is true so getMemberChildren2() thinks it should be. Here's my level...
<Level name="Work Item" column="ID" table="ARTIFACT" nullParentValue="null" parentColumn="PARENT_ID" uniqueMembers="true" >
<CaptionExpression>
<SQL>
'hey'
</SQL>
</CaptionExpression>
</Level>
And the generated sql: select "ARTIFACT"."ID" as "c0" from "ARTIFACT" "ARTIFACT" where (type = 'A') and "ARTIFACT"."PARENT_ID" IS NULL group by "ARTIFACT"."ID" order by "ARTIFACT"."ID" ASC
Is there a workaround, something I'm doing wrong, or another patch that might make this work?
Thanks.
Joel
Specifically, I get a SQLException due to Invalid column index in mondrian.rolap.SqlMemberSource.getMemberChildren2() and I see from debugging that the caption expression isn't in the result set because it isn't in the generated sql for this level, yet childLevel.hasCaptionColumn() is true so getMemberChildren2() thinks it should be. Here's my level...
<Level name="Work Item" column="ID" table="ARTIFACT" nullParentValue="null" parentColumn="PARENT_ID" uniqueMembers="true" >
<CaptionExpression>
<SQL>
'hey'
</SQL>
</CaptionExpression>
</Level>
And the generated sql: select "ARTIFACT"."ID" as "c0" from "ARTIFACT" "ARTIFACT" where (type = 'A') and "ARTIFACT"."PARENT_ID" IS NULL group by "ARTIFACT"."ID" order by "ARTIFACT"."ID" ASC
Is there a workaround, something I'm doing wrong, or another patch that might make this work?
Thanks.
Joel