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

    文檔首頁(yè)>>Stimulsoft Reports.WinForms教程-2019>>【Stimulsoft Reports.WinForms教程】將渲染報(bào)表導(dǎo)出到PDF文件

    【Stimulsoft Reports.WinForms教程】將渲染報(bào)表導(dǎo)出到PDF文件


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

    此示例項(xiàng)目演示了如何將一些不同的報(bào)表呈現(xiàn)和導(dǎo)出到一個(gè)PDF文件。例如,使用三個(gè)不同的報(bào)表——SimpleList.mrt,SimpleGroup.mrt和Master-Detail.mrt。創(chuàng)建新的報(bào)表對(duì)象并分配SimpleList.mrt,SimpleGroup.mrt和Master-Detail.mrt報(bào)表:

    private void button7_Click(object sender, System.EventArgs e)
    {
        StiReport report1 = GetReport("SimpleList.mrt");
        StiReport report2 = GetReport("SimpleGroup.mrt");
        StiReport report3 = GetReport("Master-Detail.mrt");
    ...

    然后,創(chuàng)建一個(gè)新的摘要報(bào)表:

    ...
        StiReport report = new StiReport();
        report.Render(false);
        report.RenderedPages.Clear();
    ...

    將SimpleList.mrt,SimpleGroup.mrt和Master-Detail.mrt中呈現(xiàn)的頁(yè)面添加到此報(bào)表中:

    ...
        foreach (StiPage page in report1.RenderedPages)
        {
            report.RenderedPages.Add(page);
        }
     
        foreach (StiPage page in report2.RenderedPages)
        {
            report.RenderedPages.Add(page);
        }
     
        foreach (StiPage page in report3.RenderedPages)
        {
            report.RenderedPages.Add(page);
        }
     ...

    最后,導(dǎo)出報(bào)表并將結(jié)果保存到文件中:

    ...
        report.ExportDocument(StiExportFormat.Pdf, "d:\\file.pdf");
    }

    示例代碼的結(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); })();