Пример #1
0
        /// <summary>
        /// 通过指定的实体元数据,创建一个报表视图。
        /// </summary>
        /// <param name="evm"></param>
        /// <returns></returns>
        public ReportLogicalView CreateReportView(WPFEntityViewMeta evm)
        {
            var reportPath = evm.ReportPath;

            if (string.IsNullOrEmpty(reportPath))
            {
                throw new InvalidOperationException("创建报表控件失败:没有为元数据设置需要显示的报表路径。");
            }

            //开发期暂时使用的路径,方便开发。
            var relativePath = ConfigurationHelper.GetAppSettingOrDefault("Developing_ReportRootPath");

            if (!string.IsNullOrEmpty(relativePath))
            {
                reportPath = System.IO.Path.Combine(relativePath, reportPath);
            }

            var view = new ReportLogicalView(evm);

            view.SetControl(new ReportHost()
            {
                ReportPath = reportPath
            });

            this.OnViewCreated(view);

            return(view);
        }
Пример #2
0
        /// <summary>
        /// 通过指定的实体元数据,创建一个报表视图。
        /// </summary>
        /// <param name="evm"></param>
        /// <returns></returns>
        public ReportLogicalView CreateReportView(WPFEntityViewMeta evm)
        {
            var reportPath = evm.ReportPath;

            if (string.IsNullOrEmpty(reportPath)) { throw new InvalidOperationException("创建报表控件失败:没有为元数据设置需要显示的报表路径。"); }

            //开发期暂时使用的路径,方便开发。
            var relativePath = ConfigurationHelper.GetAppSettingOrDefault("Developing_ReportRootPath");
            if (!string.IsNullOrEmpty(relativePath)) { reportPath = System.IO.Path.Combine(relativePath, reportPath); }

            var view = new ReportLogicalView(evm);

            view.SetControl(new ReportHost()
            {
                ReportPath = reportPath
            });

            this.OnViewCreated(view);

            return view;
        }