コード例 #1
0
        protected AbstractRenderer SetupPushDataRenderer(IReportModel model,
                                                         DataTable dataTable)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }
            if (model.ReportSettings.ReportType != GlobalEnums.ReportType.DataReport)
            {
                throw new ArgumentException("SetupPushDataRenderer <No valid ReportModel>");
            }
            if (model.ReportSettings.DataModel != GlobalEnums.PushPullModel.PushData)
            {
                throw new ArgumentException("SetupPushDataRenderer <No valid ReportType>");
            }
            AbstractRenderer abstr   = null;
            IDataManager     dataMan = DataManager.CreateInstance(dataTable, model.ReportSettings);

            if (dataMan != null)
            {
                abstr                  = RendererFactory.Create(model, dataMan);
                abstr.Rendering       += new EventHandler <SectionRenderEventArgs>(OnSectionPrinting);
                abstr.SectionRendered += new EventHandler <SectionRenderEventArgs>(OnSectionPrinted);

                return(abstr);
            }
            return(null);
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reportModel"></param>
        /// <param name="list"></param>
        /// <param name="reportParameters"></param>
        /// <returns></returns>
        public static IReportCreator CreatePageBuilder(IReportModel reportModel,
                                                       IList list,
                                                       ReportParameters reportParameters)
        {
            if (reportModel == null)
            {
                throw new ArgumentNullException("reportModel");
            }
            if (list == null)
            {
                throw new ArgumentNullException("list");
            }
            ReportEngine.CheckForParameters(reportModel, reportParameters);
            IDataManager dataMan = DataManager.CreateInstance(list, reportModel.ReportSettings);

            if (dataMan != null)
            {
                Layouter layouter = new Layouter();
                return(DataPageBuilder.CreateInstance(reportModel, dataMan, layouter));
            }
            else
            {
                throw new MissingDataManagerException();
            }
        }
コード例 #3
0
        public static IDataManager CreateDataManager(IReportModel reportModel, ReportParameters reportParameters)
        {
            if (reportModel == null)
            {
                throw new ArgumentNullException("reportModel");
            }
            IDataManager        dataManager      = null;
            ConnectionObject    connectionObject = null;
            IDataAccessStrategy accesStrategy    = null;

            if (reportParameters != null)
            {
                connectionObject = reportParameters.ConnectionObject;
            }

            if (connectionObject != null)
            {
                accesStrategy = new SqlDataAccessStrategy(reportModel.ReportSettings, connectionObject);
            }
            else
            {
                accesStrategy = new SqlDataAccessStrategy(reportModel.ReportSettings, null);
            }
            dataManager = DataManager.CreateInstance(reportModel.ReportSettings, accesStrategy);
            if (dataManager == null)
            {
                throw new MissingDataManagerException();
            }
            return(dataManager);
        }
コード例 #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reportModel"></param>
        /// <param name="dataTable"></param>
        /// <param name="reportParameters"></param>
        /// <returns></returns>

        public static IReportCreator CreatePageBuilder(IReportModel reportModel,
                                                       DataTable dataTable,
                                                       ReportParameters reportParameters)
        {
            Console.WriteLine("ReportEngine:CreatePageBuilder_3");
            if (reportModel == null)
            {
                throw new ArgumentNullException("reportModel");
            }
            if (dataTable == null)
            {
                throw new ArgumentNullException("dataTable");
            }
            ReportEngine.CheckForParameters(reportModel, reportParameters);
            IDataManager dataMan = DataManager.CreateInstance(dataTable, reportModel.ReportSettings);

            if (dataMan != null)
            {
                return(DataPageBuilder.CreateInstance(reportModel, dataMan));
            }
            else
            {
                throw new MissingDataManagerException();
            }
        }
コード例 #5
0
        public static IDataManager CreateDataManager(IReportModel reportModel, IList dataTable)
        {
            if (reportModel == null)
            {
                throw new ArgumentNullException("reportModel");
            }
            if (dataTable == null)
            {
                throw new ArgumentNullException("dataTable");
            }
            IDataManager dataManager = DataManager.CreateInstance(dataTable, reportModel.ReportSettings);

            if (dataManager == null)
            {
                throw new MissingDataManagerException();
            }
            return(dataManager);
        }