1
yhj
2024-07-24 5e5d945e91568b973faa27d8ab0bcef99fc4a6c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#region
 
using System;
using System.Windows.Forms;
using FastReport;
using FastReport.Utils;
 
#endregion
 
namespace CSFrameworkV5.Library
{
    /// <summary>
    ///     报表预览窗体
    /// </summary>
    public partial class frmPreview : Form
    {
        private frmPreview()
        {
            //FastReport.NET汉化
            Res.LocaleFolder = Application.StartupPath + @"\Reports";
            Res.LoadLocale(Res.LocaleFolder + @"\Chinese (Simplified).frl");
 
            InitializeComponent();
        }
 
        private void frmPreview_Load(object sender, EventArgs e)
        {
        }
 
        /// <summary>
        ///     预览报表
        /// </summary>
        /// <param name="report">报表对象</param>
        /// <param name="owner">指定窗体拥有者</param>
        public static void Preview(Report report, Form owner)
        {
            var previewForm = new frmPreview();
            report.Preview = previewForm.previewControl1;
            //准备工作,显示报表预览窗体
            report.Prepare();
            report.ShowPrepared(true, owner);
            previewForm.ShowDialog();
        }
    }
}