Class Reference
%ZEN.Auxiliary.jsonMDXProvider
Server:appadmin-00044-deployment-6bf4cbc86d-9f4xc
Instance:IRIS
User:SuperUser
 
-
  [USER] >  [%ZEN] >  [Auxiliary] >  [jsonMDXProvider]
Private  Storage

deprecatedclass %ZEN.Auxiliary.jsonMDXProvider extends %ZEN.Auxiliary.altJSONProvider, %DeepSee.Component.pivotTable

A version of the JSON provider that can use an MDX query or the full name of a stored pivot table to supply data that is served to the client in JSON format. This can be used in the same manner as the jsonProvider component.
For example, placing this within your page definition:

<jsonMDXProvider id="mdxProvider" mdxQuery="SELECT FROM HOLEFOODS"/>
would cause the given MDX statement to execute when the page is requested and the results of the query to be written to the page in JSON format:
o.content = {
		"AxesInfo": {
		},
		"Info": {
			"ColCount":0,
			"Cube":"HOLEFOODS",
			"CubeKey":"HOLEFOODS",
			"Error": {
				"ErrorCode":"",
				"ErrorMessage":""
			},
			"ListingSource":"",
			"MDXText":"SELECT FROM HOLEFOODS",
			"QueryKey":"en558256763",
			"QueryType":"SELECT",
			"ResultsComplete":1,
			"RowCount":0,
			"TimeStamp":"2015-05-12 13:23:58"
		},
		"Result": {
			"Axes":[
			],
			"CellData":[ {
					"%ID":"Cell_1",
					"Format":"",
					"ValueFormatted":"1,000",
					"ValueLogical":1000
				}
			]
		}
	};
The JSON content object will contain three major branches AxesInfo, Info, and Result, each of which contain an array of objects that correspond to query structure, metadata, and actual results as returned by the MDX statement.
If you need more control over the MDX query, you can use the OnGetMDX callback method.
This component ignores all of the data source callback methods inherited from the jsonProvider class.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
8 15


Summary

Properties
%Format %condition %import %includeFiles
%page %resource LastCube LastQueryKey
LastSessionKey OnCreateResultSet OnExecuteResultSet OnGetArray
OnGetMDX OnGetTargetObject OnRenderJSON OnSubmitContent
absolutePositioning alertOnError align allowPreviewInteraction
analyzerMode autoExecute autoRefresh aux
backgroundImage backgroundOpacity borderBottomCell borderBottomCol
borderBottomRow borderLeftCell borderLeftCol borderLeftRow
borderRightCell borderRightCol borderRightRow borderTopCell
borderTopCol borderTopRow calculatedMembers caption
cellHeight cellStyle cellWidth changesPending
colorScale columnAxisOptions columnCount columnHeaderStyle
columnLabelSpan columnLevels columnList composite
containerStyle contextFilterSpec crossJoinRowLimit cubeKey
cubeName currListingPage currPage currentQueryText
dataSource defaultListing defaultSeries documentId
dragEnabled drillLevels drillRowNumbers dropEnabled
enclosingClass enclosingStyle error evenRowStyle
filterTableCaptionStyle filterTableItemStyle filterTableStyle filters
fontFamilyCell fontFamilyCol fontFamilyRow fontSizeCell
fontSizeCol fontSizeRow formatRules headFunctionAdded
height hidden hiddenMeasureText hideMeasures
hint hintClass hintStyle id
index initialExecute isDrillThrough jsonRows
kpi label labelClass labelDisabledClass
labelStyle listing listingEnabled listingFontSize
listingPageSize listingRowCount listingRows listingSelect
listingSortColumn listingSortDir maxChartSize maxRows
mdx mdxQuery measureLocation measures
modelError modelId name nowDisplayFormat
onafterdrag onbeforedrag oncellClick oncellDblClick
oncreate ondelete ondrag ondrill
ondrop onerror onhide onlistingSelect
onnotifyController onrefresh onsave onshow
onupdate overrideColumnSpec overrideColumnText overrideRowSpec
overrideRowText pageSize parameters parent
pivotSelect pivotTable previewMode previewRowCount
printCellWidth printLabelWidth printMarginBottom printMarginLeft
printMarginRight printMarginTop printOrientation printPageSize
printSubtitle printSubtitleOn printTitle progressMessage
propertyList queryKey readOnly recordCount
reinitialized resolvedQueryText rowAxisOptions rowCaptionList
rowCount rowHeaderStyle rowLabelSpan rowLevels
rowsTruncated selectedCellBackground selectedCellColor selectedRange
seriesNameProperty showDate showEmptyColumns showEmptyRows
showFilters showLabel showListingFilters showPivot
showPivotStats showPlan showQuery showRowCaption
showStatus showUser showZebra showZebraStripes
singleTable slice sortColumn sortDir
sqlRestriction staleCache tableStyle targetClass
title tuple userMDX valign
valueColumn visible width window

Methods
%AddToSaveSet %ArrayToAET %ArrayToJSON %Attr
%BindExport %CalculateSpans %ClassIsLatestVersion %ClassName
%CollectMeasures %ConstructClone %ConstructNewDynamicArray %ConstructNewDynamicObject
%ConvertJSONToObject %CreateResultSet %DeleteModelInstance %DispatchClassMethod
%DispatchGetModified %DispatchGetProperty %DispatchMethod %DispatchSetModified
%DispatchSetMultidimProperty %DispatchSetProperty %DrawComponentHTML %DrawDataTable
%DrawEmptyTable %DrawHTML %DrawJSStrings %DrawKPITable
%DrawNub %DrawTable %Emit %EnclosingDivId
%Eval %EvalC %Execute %Extends
%ForceClientRender %GetDataByName %GetEventHandlers %GetMaxRowLevelDepth
%GetModelPropertyList %GetParameter %GetSummaryFromCSS %GetTypeByName
%GetTypeInfo %GetXMLName %HideMeasures %IsA
%IsModified %MakeId %MergeTables %New
%NormalizeObject %ObjectModified %ObjectToAET %ObjectToJSON
%OnAddToPageAfter %OnAddToPageBefore %OnCreateResultSet %OnDrawEnclosingDiv
%OnExecuteResultSet %OnZENDeserialize %OriginalNamespace %PackageName
%QuoteValue %QuoteValueL10N %RemoveFromSaveSet %Self
%SerializeObject %SetDataByName %SetModified %SetTargetObject
%ShowPlan %ShowPlanItem %StatusToDynamicObject %TestForNestedObjects
%UpdateLocalSession %ValidateObject %WriteJSONFromArray %WriteJSONFromMDX
%WriteJSONFromObject %WriteJSONFromPivot %WriteJSONStreamFromArray %WriteJSONStreamFromMDX
%WriteJSONStreamFromObject %WriteJSONStreamFromPivot DeleteLastResult DivMerge
FormatValue GetCurrentQueryText GetItemCaption GetItemSpec
GetPivotVariableData GetQueryStatus GetQueryText GetSlicerSpecForCells
KillQuery LogMessage ParseMDXExpression SetCurrentQueryText
SynthesizeMDX XMLDTD XMLExport XMLExportToStream
XMLExportToString XMLNew XMLSchema XMLSchemaNamespace
XMLSchemaType absoluteAdjustLayout adjustCellSize adjustTableLayout
allClick allClickPivot callFormatValue callGetItemSpec
callbackExportRStoPDF callbackRSPending canDrillThrough canGoBack
canGoForward cancelQuery cbClick cbClickPivot
cellClickHandler cellDblClickHandler cellMouseDownHandler cellScrollHz
cellScrollVt columnClickHandler columnDblClickHandler computeTotals
createNewObject dateFromHorolog deleteId dragFinishHandler
dragHandler dragNotifyHandler dragStartHandler drillThrough
dropHandler dropStartHandler executeListing executeQuery
exportToPDF exposeComponent filterLabelClick findElement
fireOnUpdateEvent firstPage getColumnDescriptors getContentObject
getContentType getData getDataAsArrays getDataAsObject
getDataSourceCaption getDimName getDimSize getDrillLevel
getEnclosingDiv getError getFilterForCells getFilterInfo
getHidden getHintElement getLabel getLabelElement
getListingPageCount getModelId getPageCount getPivotVariableInfo
getPivotVariablesValues getProperty getPropertyDim getPropertyName
getRowDescriptors getSelectedItems getSelectedRange getSettings
getType getTypeByName getValueName goBack
goForward gotoDrillLevel gotoPage hasData
hasFormatRules hideMessage ieLayout invokeAction
invokeSuper isModelReadOnly isOfType isPropertyValid
lastPage listingHeaderDblClickHandler makeId newDataHandler
nextPage onCreate onDelete onDisplayHandler
onEndModalHandler onPopupAction onRefreshContents onSerialize
onStartModalHandler onloadHandler onunloadHandler onupdateHandler
previousPage raiseDataChange refreshContent refreshContents
reloadContents reloadContentsAsynch removeAllDrillLevels removeDrillLevel
removeMeasureLabels render renderContents renderSVG
resetTable rowClickHandler rowDblClickHandler save
selectCellRange sendEventToViews setContentObject setContentText
setContentType setDrillThrough setHidden setListing
setModelId setOverlayMode setPivotDisabled showAllRows
showIKnowMeasureValue showMDXQuery showMessage showPendingMsg
singleTableAdjustLayout startProgressBar startQueryTimer stopProgressBar
stopQueryTimer submitContent swapRowsAndColumns update
wheelHandler


Properties

• property OnCreateResultSet as %ZEN.Datatype.delegator(FORMALSPEC="*tSC:%Status,&pParms:%String",RETURNTYPE="%DeepSee.ResultSet");
(optional) Name of Server-side callback method to call to create a %DeepSee.ResultSet object.
This must be the name of a server-only method in the page class that contains this component.
• property OnExecuteResultSet as %ZEN.Datatype.delegator(FORMALSPEC="pRS:%DeepSee.ResultSet,*tSC:%Status,&pParms:%String",RETURNTYPE="%Boolean");
(optional) Name of Server-side callback method to call to execute the %DeepSee.ResultSet object.
This must be the name of a server-only method in the page class that contains this table pane.
• property OnGetMDX as %ZEN.Datatype.delegator(FORMALSPEC="&pParameters:%String,&pMDX:%String,pCriteria:%ZEN.proxyObject,&pPagingInfo:%String",RETURNTYPE="%Status");
This specifies a callback method that returns an MDX query (string) that will drive this provider. This is identical in behavior to (and replaces) the mdx property. The method can make it easier to create queries based on parameter values or search criteria passed via the criteria property.
• property cubeKey as %ZEN.Datatype.string;
If defined along with queryKey, the provider can prepare a resultset of a query already in progress.
• property mdxQuery as %ZEN.Datatype.string;
If defined, the provider can generate JSON results from MDX query text
• property pivotTable as %ZEN.Datatype.string;
If defined, the provider can generate JSON results from a stored pivot definition
• property queryKey as %ZEN.Datatype.string;
If defined along with cubeKey, the provider can prepare a resultset of a query already in progress.
• property recordCount as %ZEN.Datatype.integer;
If the provider is using server-side data paging, this is the total number of records.

Methods

• method %ConstructNewDynamicArray() as %DynamicArray
Constructor for a dynamic array.
• method %ConstructNewDynamicObject() as %DynamicObject
Constructor for a dynamic object.
• method %Execute() as %Status
Execute the MDX query or pre-defined pivot table
• classmethod %ObjectToJSON(pObject As %RegisteredObject, ByRef pVisited, pLevel As %Integer = 0, pFormat As %String = "aeloqstw") as %Status
Override this method for this provider to override the format and suppress the default inclusion of the class in the JSON output.
• method %OnCreateResultSet(Output pRS As %DeepSee.ResultSet, ByRef pParms) as %Status
This callback is invoked when a provider is about to create a result set.
If the callback creates a %DeepSee.ResultSet object and returns it via pRS, then the pivot table will use this result set to display results.
• method %OnExecuteResultSet(pRS As %DeepSee.ResultSet, Output tSC As %Status, ByRef pParms) as %Boolean
Internal method.
Subclasses can override this to execute the %ResultSet object used to by this component.
Return true (1) if the result set has been executed.
The default implementation is to call the page method specified by the onExecuteResultSet property, if defined.
• classmethod %StatusToDynamicObject(pStatus As %Status) as %RegisteredObject
Convert a %Status object into an object that can be emitted as JSON
• classmethod %WriteJSONFromMDX(pVar As %String = "", pMDX As %String, pReturnStatus As %Boolean = 0, tProvider As %ZEN.Auxiliary.jsonMDXProvider = "") as %String
Utility method to allow direct use of JSON from a non-ZEN context (such as a CSP page).
The JSON notation is written out to the current device. pVar is the optional name of the client-side javascript variable that refers to the JSON notation.
pMDX is the MDX statement that is executed and provides the JSON content. Supported query types are SELECT, DRILLTHOUGH, DRILLFACTS.
From a CSP page, you could invoke the method as follows:
#(##class(%ZEN.Auxiliary.jsonMDXProvider).%WriteJSONFromMDX("json","SELECT NON EMPTY [Channel].[H1].[Channel Name].Members ON 0 FROM [HOLEFOODS]"))#
pReturnStatus controls whether the method will return the execution status. By default this is set to 0 to quit an empty string for compatibility with the #()# syntax.
tProvider allows parameters to be passed in by creating an instance of the jsonMDXProvider and passing it into the method. The value of pMDX will be ignored in this case.
• classmethod %WriteJSONFromPivot(pVar As %String = "", pPivot As %String, pReturnStatus As %Boolean = 0, tProvider As %ZEN.Auxiliary.jsonMDXProvider = "") as %String
Utility method to allow direct use of JSON from a non-ZEN context (such as a CSP page).
The JSON notation is written out to the current device. pVar is the optional name of the client-side javascript variable that refers to the JSON notation.
pPivot is the full name of a stored pivot that is executed and provides the JSON content.
From a CSP page, you could invoke the method as follows:
#(##class(%ZEN.Auxiliary.jsonMDXProvider).%WriteJSONFromPivot(,"Use In Dashboards/ProductInfo"))#
pReturnStatus controls whether the method will return the execution status. By default this is set to 0 to quit an empty string for compatibility with the #()# syntax.
tProvider allows parameters to be passed in by creating an instance of the jsonMDXProvider and passing it into the method. The value of pPivot will be ignored in this case.
• classmethod %WriteJSONStreamFromMDX(ByRef pStream As %Stream.Object, pMDX As %String, pRewindStream As %Boolean = 0, tProvider As %ZEN.Auxiliary.jsonMDXProvider = "") as %Status
Utility method to allow JSON output generated by the MDX query defined in pMDX to be written to the stream supplied in pStream from a general non-ZEN context. Note that pStream will be created if not supplied, hence the ByRef designation.
pRewindStream controls whether the stream should be rewound after the data is written to it.
tProvider allows parameters to be passed in by creating an instance of the jsonMDXProvider and passing it into the method. The value of pMDX will be ignored in this case.
• classmethod %WriteJSONStreamFromPivot(ByRef pStream As %Stream.Object, pPivot As %String, pRewindStream As %Boolean = 0, tProvider As %ZEN.Auxiliary.jsonMDXProvider = "") as %Status
Utility method to allow JSON output generated by the stored pivot table defined in pPivot to be written to the stream supplied in pStream from a general non-ZEN context. Note that pStream will be created if not supplied, hence the ByRef designation.
pRewindStream controls whether the stream should be rewound after the data is written to it.
tProvider allows parameters to be passed in by creating an instance of the jsonMDXProvider and passing it into the method. The value of pPivot will be ignored in this case.


Copyright (c) 2025 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.