LightSwitch HTML Edition
ViewDefinition Property
Example 






Gets or sets the Olap view definition as an Xml string.
Syntax
'Declaration
 
Public Property ViewDefinition As System.String
'Usage
 
Dim instance As C1OlapEngine
Dim value As System.String
 
instance.ViewDefinition = value
 
value = instance.ViewDefinition
public System.string ViewDefinition {get; set;}
public read-write property ViewDefinition: System.String; 
public function get,set ViewDefinition : System.String
public: __property System.string* get_ViewDefinition();
public: __property void set_ViewDefinition( 
   System.string* value
);
public:
property System.String^ ViewDefinition {
   System.String^ get();
   void set (    System.String^ value);
}
Remarks
This property is typically used to persist the current Olap view as an application setting.
Example

The code below shows how to save an Olap view as an application setting when the application ends and how to load it when the application starts.

The code assumes that the application settings contain a string property called "OlapView".

public Form1()
{
  InitializeComponent();
            
  // load default view
  C1OlapEngine olap = GetOlapEngine();
  string view = Properties.Settings.Default.OlapView;
  if (!string.IsNullOrEmpty(view))
  {
    olap.ViewDefinition = Properties.Settings.Default.OlapView;
  }
}
protected override void OnClosed(EventArgs e)
{
  // save current view as default
  C1OlapEngine olap = GetOlapEngine();
  Properties.Settings.Default.OlapView = olap.ViewDefinition;
  Properties.Settings.Default.Save();
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

C1OlapEngine Class
C1OlapEngine Members

Send Feedback