Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Dictionary <string, object> pars = new Dictionary <string, object>();

            pars.Add("UserID", "HQ01U4282");
            pars.Add("UserName", "陈迪臣");
            DataSet ds = getReportData();

            System.Guid gid = new Guid("60215F32-1467-46a5-A5A7-D38E6ECC9CB2");

            MB.WinPrintReport.DefaultReportData    reportData = new MB.WinPrintReport.DefaultReportData("StockOut", ds, pars);
            MB.WinPrintReport.FrmEditPrintTemplete frm        = new MB.WinPrintReport.FrmEditPrintTemplete(reportData, gid);
            frm.ShowDialog();
        }
Esempio n. 2
0
        //对象事件...
        private void menuItem_Click(object sender, EventArgs e)
        {
            using (MB.WinBase.WaitCursor cursor = new WinBase.WaitCursor()) {
                try {
                    // System.Windows.Forms.Form.ActiveForm.Cursor = Cursors.WaitCursor;
                    System.Windows.Forms.MenuItem item = sender as System.Windows.Forms.MenuItem;
                    if (item.Tag == null)
                    {
                        return;
                    }
                    string txt          = item.Text;
                    var    templeteInfo = _MenuItems[item.Tag as System.Windows.Forms.MenuItem]; //获取打印模板的ID
                    if (txt == TXT_PRINT_PREVIEW)                                                //打印预览

                    {
                        _ReportTemplete.ShowPreview(_ReportDataHelper.ModuleID, templeteInfo);
                    }
                    else if (txt == TXT_PRINT)   //直接打印
                    {
                        _ReportTemplete.Print(_ReportDataHelper.ModuleID, templeteInfo);
                    }
                    else if (txt == TXT_PRINT_DESIGN)  //模板设计
                    {
                        MB.WinPrintReport.FrmEditPrintTemplete frm = new MB.WinPrintReport.FrmEditPrintTemplete(_ReportDataHelper, _MenuItems[item.Tag as System.Windows.Forms.MenuItem].GID);
                        frm.ShowDialog();
                    }
                    else
                    {
                        throw new MB.Util.APPException("该文件类型还没有进行处理 ", MB.Util.APPMessageType.SysWarning);
                    }
                }
                catch (Exception ex) {
                    throw new MB.Util.APPException("DIY 报表操作有误,可能格报表格式已经遭到损坏 " + ex.Message, MB.Util.APPMessageType.DisplayToUser);
                }
                finally {
                    //  System.Windows.Forms.Form.ActiveForm.Cursor = Cursors.Default;
                }
            }
        }