コード例 #1
0
        public override Report PrepareReport()
        {
            Report rpt = null;

            try
            {
                GZFramework.UI.Dev.WaiteServer.ShowWaite(Owner);
                rpt = LoadReport(RptFileName);

                PrepareDataSource();

                BindDataSource?.Invoke(rpt, DataSource);

                //rpt.RegisterData(DataSource, "D");

                //DataBand dataBandD1 = rpt.FindObject("Data1") as DataBand;
                //dataBandD1.DataSource = rpt.GetDataSource("D");

                UpdateRptCommandData(rpt);

                BeforePrepare?.Invoke(rpt);
            }

            catch (Exception ex)
            {
                RptSuccess   = false;
                RptException = ex;
            }
            finally
            {
                GZFramework.UI.Dev.WaiteServer.CloseWaite();
                if (RptSuccess == false)
                {
                    GZFramework.UI.Dev.Common.Msg.ShowError(RptException.Message);
                    //rpt = null;
                }
                //else
                //{
                //    rpt.Prepare();//准备工作
                //}
            }
            return(rpt);
        }
コード例 #2
0
        public override Report PrepareReport()
        {
            Report _Report = null;

            try
            {
                GZFramework.UI.Dev.WaiteServer.ShowWaite(Owner);
                _Report = LoadReport(RptFileName);

                PrepareDataSource();

                _Report.RegisterData(DataSummary, "M");
                _Report.RegisterData(DataDetail, "D");

                DataBand dataBandD1 = _Report.FindObject("Data1") as DataBand;
                dataBandD1.DataSource = _Report.GetDataSource("D");

                UpdateRptCommandData(_Report);

                BeforePrepare?.Invoke(_Report);
            }
            catch (Exception ex)
            {
                RptSuccess   = false;
                RptException = ex;
            }
            finally
            {
                GZFramework.UI.Dev.WaiteServer.CloseWaite();
                if (RptSuccess == false)
                {
                    GZFramework.UI.Dev.Common.Msg.ShowError(RptException.Message);
                    //_Report = null;
                }
                //else
                //{
                //    _Report.Prepare();//准备工作
                //    frmRptPreview.Preview(_Report, owner, !ShowPrint);
                //}
            }
            return(_Report);
        }