Unbounddata source - create dataset on the fly from WCF

Posted by: balukr54-dd on 3 August 2017, 3:56 pm EST

  • Posted 3 August 2017, 3:56 pm EST

    Dear all,

    Is to possible to specify the pivotview unbound data source from code behind in Silverlight.
    i saw  a code in xaml

    here is it
    ----------



    ----------

    How can i make it in C#(in silverlight).

    What i am trying to test is to create a dataset on a button click from a WCF service and bind it to the control(pivotview).Is it possible to do?

    Can i have any samples?

    Thanks and Regards
    balu

  • Replied 3 August 2017, 3:56 pm EST

    balu,

    You can also use C# to connect Silverlight viewer. Please take a look at this link. Also, the complete help file is available here.
    If you have more questions, please feel free to ask.

    Regards,
    Aashish
  • Replied 3 August 2017, 3:56 pm EST

    Dear Aashish,

    The link is not available.
    "http://www.datadynamics.com/Help/ActiveAnalysis/ConnectToServerSideDataSources.html". showing page not found.

    Regards
    balu
  • Replied 3 August 2017, 3:56 pm EST

    Dear Aashish,
     I tried a sample code.But its not working. I am not sure whether my approach is right.
    This is what i tried I created a WCF service with a function

     [OperationContract]
        public IDataSource CreateUnboundDataSource(string input)
        {
            try
            {
                ServerDataSourceManager.Register("Unbound", CreateUnboundDataSource);
                SchemaDefinition schema = PrepareSchema();
                UnboundDataSource unboundDS = new UnboundDataSource();
                unboundDS.CustomSchema = schema;
                unboundDS.DataSource = PrepareDataSet();
                IDataSource iDataSource = unboundDS;

                return iDataSource;
            }
            catch (Exception ee)
            {
                return null;
            }
        }

    In the silverlight part in a button click i call the WCF service and in the completed event.

    i tried to bind.

       void serviceClient_CreateUnboundDataSourceCompleted(object sender, CreateUnboundDataSourceCompletedEventArgs e)
            {
                try
                {
            //---------------------------    
                   // in e.result i am getting error.. 
    \\becoz idatainterface in server(GrapeCity.ActiveAnalysis.DataSources) and client(GrapeCity.ActiveAnalysis.Silverlight.DataSources) is of different type.

            
            //The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
            //---------------------------

                    ServerSideDataSource serverData = new ServerSideDataSource();
                    serverData.DataSourceId = "Unbound";
                    serverData = (ServerSideDataSource)e.Result;
                    pivotView.DataSource = serverData;
                }
                catch (Exception ee)
                {
                    MessageBox.Show(ee.Message.ToString() + "  :::::  " + ee.InnerException.ToString());
                }
            }


    Regards
    balu
  • Replied 3 August 2017, 3:56 pm EST

    its fixed

    Regards
    balu

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels