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

    文檔首頁>>Stimulsoft Reports.WinForms教程-2019>>【Stimulsoft Reports.WinForms教程】在線程中呈現(xiàn)多個(gè)報(bào)表

    【Stimulsoft Reports.WinForms教程】在線程中呈現(xiàn)多個(gè)報(bào)表


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

    此示例顯示如何在線程中呈現(xiàn)多個(gè)報(bào)表。由于線程中的渲染報(bào)表運(yùn)行后臺,因此它提供了提高生產(chǎn)率的機(jī)會。為此,使用BackgroundWorker類。為簡單起見,運(yùn)行相同的報(bào)表以構(gòu)建五個(gè)不同的線程:

    private void button1_Click(object sender, EventArgs e)
    {
        for (int index = 0; index < 5; index++)
        {
            var worker = new BackgroundWorker();
            worker.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
            worker.RunWorkerAsync();
        }
    }

    在backgroundWorker1_DoWork事件過程的開始,您可以加載報(bào)表并連接數(shù)據(jù)。此外,如果有必要,您可以訂閱一些活動。最后,編譯并呈現(xiàn)報(bào)表:

    ...
    private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
    {
        var report = new StiReport();
        using (var stream = Assembly.GetExecutingAssembly().
               GetManifestResourceStream("RenderInThread2.Master-Detail-Subdetail.mrt"))
        {
            report.Load(stream);
        }
     
        DataSet data = new DataSet();
        data.ReadXmlSchema("..\\..\\Data\\demo.xsd");
        data.ReadXml("..\\..\\Data\\demo.xml");
     
        report.RegData(data);
        report.IsRendered = false;
        report.Compile();
        report.Render(false);
    }

    下載示例

    購買Stimulsoft正版授權(quán),請點(diǎn)擊“咨詢在線客服”喲!

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