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

    文檔首頁>>Stimulsoft Reports.WinForms教程-2019>>【Stimulsoft Reports.WinForms教程】在Designer中保存和加載報(bào)表

    【Stimulsoft Reports.WinForms教程】在Designer中保存和加載報(bào)表


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

    該示例顯示如何在代碼中使用“ Save”和“ Load”事件,您可以在應(yīng)用程序初始化時(shí)將事件偵聽器添加到StiDesigner類:

    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;
    }

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

    private static void OnSaving(object sender, StiSavingObjectEventArgs e)
    {
        StiDesigner designer = sender as StiDesigner;
        //string str = designer.Report.SaveToString(); 
        MessageBox.Show("Report saved");
    }

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

    private static void OnLoading(object sender, StiLoadingObjectEventArgs e)
    {
        StiDesigner designer = sender as StiDesigner;
        //designer.Report.LoadFromString(str);
        MessageBox.Show("Report loaded");
    }

    示例代碼的結(jié)果如下圖所示:

    Stimulsoft

    下載示例

    掃碼咨詢


    添加微信 立即咨詢

    電話咨詢

    客服熱線
    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); })();