The sample shows how to use the SavingReport and LoadingReport events in the code. You can add the event listener to the StiDesigner class at application initialization:
static Form1()
{
	StiDesigner.SavingReport += new StiSavingObjectEventHandler(OnSaving);
	StiDesigner.LoadingReport += new StiLoadingObjectEventHandler(OnLoading);
	
	// If you need you can hide menu item "Save As.."
	StiMainMenuService service = StiMainMenuService.GetService();
	service.ShowFileReportSaveAs = false;
}

Specify the action to be performed when the report will be saved:
private static void OnSaving(object sender, StiSavingObjectEventArgs e)
{
	StiDesigner designer = sender as StiDesigner;
	//string str = designer.Report.SaveToString();
	MessageBox.Show("Report saved");
}

Specify the action to be performed when the report will be loaded:
private static void OnLoading(object sender, StiLoadingObjectEventArgs e)
{
	StiDesigner designer = sender as StiDesigner;
	//designer.Report.LoadFromString(str);
	MessageBox.Show("Report loaded");
}

In the screenshot below you can see the result of the sample code:

Saving and Loading a Report in the Designer

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.