Winform中使用FastReport實現自定義PDF打印預覽


場景

Winform中使用FastReport實現簡單的自定義PDF導出:

https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/100920681

在上面已經實現自定義PDF並導出的基礎上,實現導出或者打印前的預覽。

實現

在窗體中拖拽一個FastReport的PreviewControl控件,以及Buton按鈕。

 

 

然后在Button按鈕的點擊事件中

private void button2_Click(object sender, EventArgs e)
        {
            this.report1 = new FastReport.Report();
            string baseDir = System.Windows.Forms.Application.StartupPath;
            var reportFile = Path.Combine(baseDir, "1.frx");
            this.report1.Load(reportFile);
            this.report1.Preview = this.previewControl1;                     
            report1.Prepare();
            report1.ShowPrepared();
        }

 

運行效果

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM