We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How can i invoke the method cubeChanged passing the cube name to be loaded

hi, i know that this example below execute the method cubeChanged when loading the olap client, but how can i send the cube name to be loaded?


<div id="OlapClient"></div> 
 
<script>
// Create OLAP Client
$('#OlapClient').ejOlapClient({
      url: "OlapClientService.svc"
  });
var clientObj = $("#OlapClient").data("ejOlapClient");
clientObj.cubeChanged(ej.proxy(function(){}, this));
// raised while changing cubes
</script>

Thanks in advance

3 Replies

RG Ramesh Govindaraj Syncfusion Team September 30, 2015 11:21 AM UTC

Hi Dylan,

We have created a sample based on your requirement. Please find the following sample.

http://www.syncfusion.com/downloads/support/forum/120642/ze/WebApplication41778845769

Regards,

Ramesh G.


DY Dylan September 30, 2015 06:23 PM UTC

the example worked fine, but i still need to click the button, is there any other way to load a cube that is does not need to click any button?

Thanks


RG Ramesh Govindaraj Syncfusion Team October 1, 2015 11:45 AM UTC

Hi Dylan,

Yes, Cube could be loaded initially by setting the current cube name at OlapReport in server side (WCF Service). Please find the below code snippet for your reference.

WCF file path : <SystemDrive>:\Users\<username>\AppData\Local\Syncfusion\EssentialStudio\xx.x.x.xx\JavaScript\olapsamples\wcf\OlapClientService.svc.cs

Code snippet[C#]:

OlapReport:

       private OlapReport CreateReport()

        {

            OlapReport olapReport = new OlapReport() { Name = "Default Report" };


            //Cube name can be declared below

            olapReport.CurrentCubeName = "Adventure Works";


            //Your code here

        }


Please let us know if you have any concerns.


Regards,

Ramesh G.


Loader.
Live Chat Icon For mobile
Up arrow icon