• <menu id="w2i4a"></menu>
  • logo Stimulsoft Reports.WinForms教程-2019

    文檔首頁(yè)>>Stimulsoft Reports.WinForms教程-2019>>【Stimulsoft Reports.WinForms教程】使用全局保存和加載事件

    【Stimulsoft Reports.WinForms教程】使用全局保存和加載事件


    【下載Stimulsoft Reports.Ultimate最新版本】

    此示例顯示如何在代碼中使用“Save”和“Load”事件,您可以在應(yīng)用程序初始化時(shí)將事件監(jiān)聽器添加到StiOptions.Engine.GlobalEvents:

    public Form1()
    {
        InitializeComponent();
     
        StiOptions.Engine.GlobalEvents.SavingReportInDesigner +=
            new Stimulsoft.Report.Design.StiSavingObjectEventHandler(GlobalEvents_SavingReportInDesigner);
     
        StiOptions.Engine.GlobalEvents.LoadingReportInDesigner +=
            new Stimulsoft.Report.Design.StiLoadingObjectEventHandler(GlobalEvents_LoadingReportInDesigner);
    }

    然后指定加載報(bào)表時(shí)要執(zhí)行的操作:

    ...
    private void GlobalEvents_LoadingReportInDesigner(object sender, Stimulsoft.Report.Design.StiLoadingObjectEventArgs e)
    {
        e.Processed = true;
     
        StiReport report = new StiReport();
        report.Load("..\\..\\Reports\\SimpleList.mrt");
        designerControl1.Report = report;
    }
    ...

    指定報(bào)表保存時(shí)要執(zhí)行的操作:

    ...
    private void GlobalEvents_SavingReportInDesigner(object sender, Stimulsoft.Report.Design.StiSavingObjectEventArgs e)
    {
        if (designerControl1.Report == null) return;
        e.Processed = true;
     
        designerControl1.Report.Save("Report.mrt");
    }

    下載示例

    掃碼咨詢


    添加微信 立即咨詢

    電話咨詢

    客服熱線
    023-68661681

    TOP
    三级成人熟女影院,欧美午夜成人精品视频,亚洲国产成人乱色在线观看,色中色成人论坛 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();