Saving and Loading a Report in the Designer
Our sample projects and report templates can help you learn the basics of working with our products.The sample shows how to use the
Specify the action to be performed when the report will be saved:
Specify the action to be performed when the report will be loaded:
In the screenshot below you can see the result of the sample code:

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:
