Beispiel #1
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;
                }
            }
        }
Beispiel #2
0
 private void tButPreview_Click(object sender, EventArgs e)
 {
     using (MB.WinBase.WaitCursor cursor = new MB.WinBase.WaitCursor(this)) {
         _ReportTempleteHelper.ShowPreview(_ModuleID, _PrintTemplete);
     }
 }