Glossary Item Box

ActiveReports for .NET 2 Online Help Send feedback to Data Dynamics

Saving and Loading Charts

A chart can be saved to or loaded from an XML file at design time using the Load... and Save As... links below the properties window.  This can be done at run time using code like the following.

 

'VB
Private Sub ReportHeader_Format(ByVal sender As Object, ByVal e As System.EventArgs) _
	Handles ReportHeader.Format
    Me.ChartControl2.Save(Application.StartupPath & "\savedChart.xml")
End Sub

Private Sub Detail_Format(ByVal sender As Object, ByVal e As System.EventArgs) Handles _
	Detail.Format
    Me.ChartControl1.Load(Application.StartupPath & "\Bezier.xml")
End Sub

 

//C#
private void Detail_Format(object sender, System.EventArgs eArgs)
{
	this.ChartControl1.Load(System.Windows.Forms.Application.StartupPath + 
		"\\Bezier.xml");
}

private void ReportHeader_Format(object sender, System.EventArgs eArgs)
{
	this.ChartControl2.Save(System.Windows.Forms.Application.StartupPath + 
		"\\savedChart.xml");
}

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.