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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

OlapClient Load Multiple Cubes from Different Databases

Thread ID:

Created:

Updated:

Platform:

Replies:

122115 Feb 18,2016 04:21 AM UTC Feb 19,2016 05:01 AM UTC ASP.NET MVC 1
loading
Tags: PivotClient
Ananth
Asked On February 18, 2016 04:21 AM UTC

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

Ramesh Govindaraj [Syncfusion]
Replied On 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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;