Retrieve the MDX Query of a CurrentReport

The MDX query of a current report is used to display data in Grid/Chart control and it can be retrieved by calling the GetMDXQuery() method.

The following code explains how to retrieve MDX Query from the OlapDataManager:

olapDataManager.GetMDXQuery();
olapDataManager.GetMDXQuery()

In Silverlight:

string currentMdxQuery = null;

//// Invoke the service call to retrieve the MDX query from the Server based on current report. 

_olapDataManager.GetMdxQuery(_olapDataManager.CurrentReport);

_olapDataManager.MdxQueryObtained += () =>

{

    ////MDX Query retrieved.

    currentMdxQuery = _olapDataManager.CurrentReport.CurrentMdxQuery;

};
Dim currentMdxQuery As String

'Invoke the service call to retrieve the MDX query from the Server based on current report. 

_olapDataManager.GetMdxQuery(_olapDataManager.CurrentReport)

_olapDataManager.MdxQueryObtained += Function() 

'MDX Query retrieved.

currentMdxQuery = _olapDataManager.CurrentReport.CurrentMdxQuery

End Function