Ejemplo n.º 1
0
        /// <summary>
        /// 打印
        /// </summary>
        /// <param name="MyDataSource">数据源</param>
        /// <param name="MyFormat">格式文件</param>
        public static void MyPrint(object MyDataSource, string MyFormat)
        {
            rpxBase rpt = new rpxBase();

            //rpt.SetLicense("admin,admin,123456,VF4UHHMJ4WOHHV77I8HH");
            rpt.LoadLayout(MyFormat);
            rpt.DataSource = MyDataSource;
            rpt.Run();
            rpt.Document.Print(false, true, true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 打印带预览
        /// </summary>
        /// <param name="MyDataSource">数据源</param>
        /// <param name="MyFormat">格式文件</param>
        /// <param name="showPreview">是否预览</param>
        public static void MyPrint(object MyDataSource, string MyFormat, bool showPreview)
        {
            //Properties.Resources.ground
            rpxBase rpt = new rpxBase();

            //rpt.SetLicense("admin,admin,123456,VF4UHHMJ4WOHHV77I8HH");
            rpt.LoadLayout(MyFormat);
            rpt.DataSource = MyDataSource;
            rpt.Run();
            if (showPreview)
            {
                frmPrintBase preview = new frmPrintBase();
                preview.MyRpt = rpt;
                preview.MyPreview();
                preview.ShowDialog();
            }
            else
            {
                rpt.Document.Print(false, true, true);
            }
        }