OlapClient Load Multiple Cubes from Different Databases

Hello dear support...

Below I attached a screenshot my Database.According to my Database,  I want to load Multiple Cubes in My Olapclient Cube Selector. Is it possible to load Multiple Cubes ??

Thanks
R.Ananth


 

Attachment: database_Screenshot_663635c9.rar

1 Reply

RG Ramesh Govindaraj Syncfusion Team February 19, 2016 05:01 AM UTC

Hi Ananth,

Thank you for using Syncfusion products.

In-general, Cube Selector displays all the cubes available in the connected database. And, it is possible to connect only one database at a time with the control. So, fetching cubes from more than one database at a time is not an appropriate behavior. Meanwhile, we have prepared a sample where you can switch your database on-demand by changing the connection string. Please find the sample and code example in the following link.

Sample Link:  http://www.syncfusion.com/downloads/support/forum/122115/ze/SyncfusionMvcApplication1597120499

Code:


JavaScript[Inside .cshtml]:

<select class="ddlist" onchange="Change()" style="width:150px;margin-left:10px">

    <option value="DB 1">DB 1</option>

    <option value="DB 2">DB 2</option>
</select>

………………………………………..

    function Change() {

        clientTarget = $("#OlapClient1").data("ejOlapClient");

        var oclientWaitingPopup = $("#" + clientTarget._id).data("ejWaitingPopup");

        oclientWaitingPopup.show();

        var DB = $(".ddlist").val();

        var serializedCustomObject = JSON.stringify(DB);

        oclientProxy.doAjaxPost("POST", oclientProxy.model.url + "/" + oclientProxy.model.serviceMethodSettings.initialize, JSON.stringify({

            "action": "initializeClient", "customObject": serializedCustomObject, "clientParams": oclientProxy.model.enableMeasureGroups + "-" + oclientProxy.model.chartType

        }), oclientProxy._renderControlSuccess);
    }



C#[Inside WCF Service]:

string DB = "DB 1";

  public Dictionary<string, object> InitializeClient(string action, object customObject, string clientParams)

        {


            ////


            dynamic customData = serializer.Deserialize<dynamic>(customObject.ToString());

            if (customData as string != null)

                DB = customData;


            // You can choose your database by giving appropriate connection string.

            if (DB.Equals("DB 1"))

                connectionString = "Your Connection String1 here”;

            else

                connectionString = "Your Connection String2 here”;


            ////


            return olapClientHelper.GetJsonData(action, DataManager, clientParams);
        }


Regards,
Ramesh G.

Loader.
Up arrow icon