Beispiel #1
0
        private void BtnReportViewSingle_Click(object sender, EventArgs e)
        {
            try
            {
                DataRow dr = null;
                long    lReportTemplateID = 0;
                long    lReportTypeID     = 0;
                if (sender is LBToolStripReportViewButton)
                {
                    LBToolStripReportViewButton btnViewReport = sender as LBToolStripReportViewButton;
                    dr = btnViewReport.Tag as DataRow;
                    lReportTemplateID = Convert.ToInt64(dr["ReportTemplateID"]);
                    lReportTypeID     = Convert.ToInt64(dr["ReportTypeID"]);
                }

                ReportRequestArgs args = new Report.ReportRequestArgs(lReportTemplateID, lReportTypeID, null, null);
                OnReportRequest(args);
                if (args.DSDataSource == null && args.RecordDR == null)
                {
                    LB.WinFunction.LBCommonHelper.ShowCommonMessage("未设置数据源,编辑报表失败!");
                }
                else
                {
                    ReportHelper.OpenReportDialog(enRequestReportActionType.Preview, args);
                }
            }
            catch (Exception ex)
            {
                LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
            }
        }
Beispiel #2
0
        private void BtnEditReport_Click(object sender, EventArgs e)
        {
            try
            {
                LBToolStripReportViewButton btnEditReport = sender as LBToolStripReportViewButton;
                ReportRequestArgs           args          = new Report.ReportRequestArgs(0, (int)btnEditReport.ReportTypeID, null, null);
                OnReportRequest(args);
                if (args.DSDataSource == null && args.RecordDR == null)
                {
                    LB.WinFunction.LBCommonHelper.ShowCommonMessage("未设置数据源,编辑报表失败!");
                }
                else
                {
                    frmReport frm = new frmReport(args);
                    LBShowForm.ShowDialog(frm);

                    if (mToolStrip != null)
                    {
                        if (mToolStrip.Items.ContainsKey("btnReportEdit"))
                        {
                            mToolStrip.Items.RemoveByKey("btnReportEdit");
                        }
                        if (mToolStrip.Items.ContainsKey("btnReportViewSingle"))
                        {
                            mToolStrip.Items.RemoveByKey("btnReportViewSingle");
                        }
                        if (mToolStrip.Items.ContainsKey("btnReportViewMutli"))
                        {
                            mToolStrip.Items.RemoveByKey("btnReportViewMutli");
                        }
                        this.OnInitToolStripControl(mToolStripReportArgs);
                    }
                }
            }
            catch (Exception ex)
            {
                LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
            }
        }