[]
        
(Showing Draft Content)

C1.PivotEngine.C1PivotEngine.ViewDefinition

ViewDefinition Property

ViewDefinition

Gets or sets the PivotEngine view definition as an XML string.

Declaration
public string ViewDefinition { get; set; }
Remarks

This property is typically used to persist the current PivotEngine view as an application setting.

Examples

The code below shows how to save a PivotEngine 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 "PivotEngineView".

public Form1()
{
  InitializeComponent();

  // load default view
  C1PivotEngine fp = GetPivotEngine();
  string view = Properties.Settings.Default.PivotEngineView;
  if (!string.IsNullOrEmpty(view))
  {
    fp.ViewDefinition = Properties.Settings.Default.PivotEngineView;
  }
}
protected override void OnClosed(EventArgs e)
{
  // save current view as default
  C1PivotEngine fp = GetPivotEngine();
  Properties.Settings.Default.PivotView = fp.ViewDefinition;
  Properties.Settings.Default.Save();
}