Skip to content

Commit 1eda5e9

Browse files
committed
ProcessOneAxisCell: populate axis cell info after determining cell visibility
1 parent 5ed87eb commit 1eda5e9

3 files changed

Lines changed: 37 additions & 34 deletions

File tree

MDX2JSON/ResultSet.cls.xml

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -145,40 +145,9 @@ Returns array of Axes</Description>
145145
set cell=$$$NewDynObj
146146
147147
set tNode = $G($$$DeepSeeAxisGLVN(CubeIndex,AxisKey,"axes",Node))
148-
set tDimNo = $LG(tNode,9)
149-
set tHierNo = $LG(tNode,10)
150-
set tLevelNo = $LG(tNode,11)
151148
152149
set cell.caption = ##class(%DeepSee.UserPortal.Utils).%ResolveText($LG(tNode,5)) // text caption
153150
set cell.vis = $LG(tNode,2) // visibility helper - does not help (apperently it shows if the cell is the lowest level)
154-
set cell.format = $LG(tNode,12) // format for numbers, eg: $## ###.##
155-
set cell.total = $LG(tNode,8) //COUNT,AVG function
156-
set cell.type = $LG(tNode,1) // mbr,cmbr,lit,exp
157-
set cell.valueID = $LG(tNode,6) // id in mdx dimension for mbr, path for cmbr
158-
set cell.title = $LG(tNode,23)
159-
160-
try {
161-
set cell.path = ##class(%DeepSee.Query.Engine).%GetSpecForAxisNode(CubeName, QueryKey, AxisNumber, Node) // MDX cell path
162-
} catch ex {
163-
set cell.path = "path too long"
164-
}
165-
166-
set cell.headerStyle = $LG(tNode,19)
167-
set cell.cellStyle = $LG(tNode,18)
168-
169-
set info = $LG(tNode,18)
170-
if info'="" { // extract aggregation information, leave the rest as css
171-
set summaryposition = $f(info,"summary")
172-
if summaryposition>0 {
173-
set summaryvalue = $e(info,summaryposition+1,$f(info,";",summaryposition)-2)
174-
set cell.summary = summaryvalue // aggregate function
175-
set $e(info,summaryposition-7,summaryposition + $l(summaryvalue) + 1) = ""
176-
}
177-
set cell.style = info // css
178-
}
179-
180-
do ##class(%DeepSee.Utils).%GetDimensionCaption(CubeName,tDimNo, tHierNo,tLevelNo, .tAxisCaption)
181-
set cell.dimension = tAxisCaption // cube dimension
182151
183152
// now we process cell children, if any exist
184153
if ($D($$$DeepSeeAxisGLVN(CubeIndex, AxisKey, "axes", Node, "ch")) = 10) {
@@ -205,6 +174,40 @@ Returns array of Axes</Description>
205174
if (..IsCellNull(cell, AxisNumber, Node)=1) {
206175
return cell.children
207176
}
177+
178+
try {
179+
set cell.path = ##class(%DeepSee.Query.Engine).%GetSpecForAxisNode(CubeName, QueryKey, AxisNumber, Node) // MDX cell path
180+
} catch ex {
181+
set cell.path = "path too long"
182+
}
183+
184+
set cell.format = $LG(tNode,12) // format for numbers, eg: $## ###.##
185+
set cell.total = $LG(tNode,8) //COUNT,AVG function
186+
set cell.type = $LG(tNode,1) // mbr,cmbr,lit,exp
187+
set cell.valueID = $LG(tNode,6) // id in mdx dimension for mbr, path for cmbr
188+
set cell.title = $LG(tNode,23)
189+
190+
set cell.headerStyle = $LG(tNode,19)
191+
set cell.cellStyle = $LG(tNode,18)
192+
193+
set info = $LG(tNode,18)
194+
if info'="" { // extract aggregation information, leave the rest as css
195+
set summaryposition = $f(info,"summary")
196+
if summaryposition>0 {
197+
set summaryvalue = $e(info,summaryposition+1,$f(info,";",summaryposition)-2)
198+
set cell.summary = summaryvalue // aggregate function
199+
set $e(info,summaryposition-7,summaryposition + $l(summaryvalue) + 1) = ""
200+
}
201+
set cell.style = info // css
202+
}
203+
204+
set tDimNo = $LG(tNode,9)
205+
set tHierNo = $LG(tNode,10)
206+
set tLevelNo = $LG(tNode,11)
207+
208+
do ##class(%DeepSee.Utils).%GetDimensionCaption(CubeName,tDimNo, tHierNo,tLevelNo, .tAxisCaption)
209+
set cell.dimension = tAxisCaption // cube dimension
210+
208211
209212
set:$$$Debug cell.visible = '..IsCellNull(cell,AxisNumber,Node)
210213
set:$$$Debug cell.node = Node

MDX2JSON/Tests.cls.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ Classes with support methods for testing MDX2JSON</Description>
88

99
<Parameter name="LastCommit">
1010
<Type>%String</Type>
11-
<Default>837054cda0fc869888ffd57dd9d7a0a558d9911c</Default>
11+
<Default>5ed87eb495d30907ef7c41be9d17c52309b97ce5</Default>
1212
</Parameter>
1313

1414
<Parameter name="LastCommitTS">
1515
<Type>%TimeStamp</Type>
16-
<Default>2020-11-13 08:59:36.384</Default>
16+
<Default>2021-07-01 16:03:56</Default>
1717
</Parameter>
1818

1919
<Method name="ProjectLength">

module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Export generator="Cache" version="25">
33
<Document name="MDX2JSON.ZPM"><Module>
44
<Name>MDX2JSON</Name>
5-
<Version>2.3.3</Version>
5+
<Version>2.3.4</Version>
66
<Description>RESTful web api for MDX to JSON transformation (plus JSONP and XML/A) for InterSystems Caché. Also provides information about DeepSee objects.</Description>
77
<Packaging>module</Packaging>
88
<SourcesRoot>./</SourcesRoot>

0 commit comments

Comments
 (0)