logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Asynchronous calls to ESWeb (C#)
CarpeDatum
#1 Posted : Wednesday, March 30, 2011 10:59:04 AM(UTC)
Rank: Administration

Groups: Registered, Administrators
Joined: 8/17/2010(UTC)
Posts: 6
Location: Denver

This example shows how to use asynchronous calls to ESWeb so that your UI can continue operating while the view/subset/process is working.

This example uses a service reference rather than a web reference to ESWeb.

Code:

public partial class MainPage : UserControl
{
    private ESWeb.ESWebSoapClient _es;

    public MainPage()
    {
        _es = new ESWeb.ESWebSoapClient();

        // Required to initialize variables
        InitializeComponent();
        DisplayView("Employees", "Big Query");
    }

    // This function starts the process of getting the
    // view "Big Query" from the "Employees" cube
    public void DisplayView( string cubeName, string viewName )
    {
        // Set up the handler for notifying when the view is complete and ready to display
        _es.TM1ViewCompleted += new EventHandler<ESWeb.TM1ViewCompletedEventArgs>(DisplayViewCompleted);

        // Make the call to the web service
        _es.TM1ViewAsync(cubeName, viewName, true);
    }

    // This function gets called when the view has 
    // completed and is ready to be processed
    public void DisplayViewCompleted(object sender, ESWeb.TM1ViewCompletedEventArgs e)
    {
        // Do the required work with the results, in this case we convert the results
        // to a class that is bindable by a Silverlight grid control.
        CubeView cubeView = new CubeView( e.Result.Results );
        viewPane.Items.Add(cubeView);
    }
}
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.018 seconds.