Save and Load events of the Designer
Unsere Beispiele der Projekte und Berichtsvorlagen helfen Ihnen, die Grundlagen der Arbeit mit unserer Software zu erlernen.Dieses Beispiel ist veraltet, checken Sie viele anderen aktualisierten Beispiele in dieser Kategorie aus.This sample shows how to use the Save and Load events in the code. You can add the event listeners to the
Then specify the action to be performed when the report is loading:
Specify the action to be performed when the report is saving:
StiOptions.Engine.GlobalEvents at application initialization:
public Window1()
{
StiOptions.Wpf.CurrentTheme = StiOptions.Wpf.Themes.Office2013Theme;
InitializeComponent();
StiOptions.Engine.GlobalEvents.SavingReportInDesigner +=
new Stimulsoft.Report.Design.StiSavingObjectEventHandler(GlobalEvents_SavingReportInDesigner);
StiOptions.Engine.GlobalEvents.LoadingReportInDesigner +=
new Stimulsoft.Report.Design.StiLoadingObjectEventHandler(GlobalEvents_LoadingReportInDesigner);
}
Then specify the action to be performed when the report is loading:
private void GlobalEvents_LoadingReportInDesigner(object sender, Stimulsoft.Report.Design.StiLoadingObjectEventArgs e)
{
e.Processed = true;
StiReport report = new StiReport();
report.Load("..\\SimpleList.mrt");
designerControl1.Report = report;
}
Specify the action to be performed when the report is saving:
private void GlobalEvents_SavingReportInDesigner(object sender, Stimulsoft.Report.Design.StiSavingObjectEventArgs e)
{
if (designerControl1.Report == null) return;
e.Processed = true;
designerControl1.Report.Save("Report.mrt");
}