示例#1
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();
            }
        }
示例#2
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();
            }
        }
示例#3
0
        private void RunDataReport(ReportModel reportModel, IDataManager data)
        {
            ILayouter      layouter      = new Layouter();
            IReportCreator reportCreator = DataPageBuilder.CreateInstance(reportModel, data, layouter);

            reportCreator.SectionRendering += new EventHandler <SectionRenderEventArgs>(PushPrinting);
            reportCreator.PageCreated      += OnPageCreated;
            reportCreator.BuildExportList();
            ShowCompleted();
        }
示例#4
0
        /// <summary>
        /// For internal use only
        /// </summary>
        /// <param name="reportModel"></param>
        /// <returns></returns>

        public static IReportCreator CreatePageBuilder(IReportModel reportModel)
        {
            if (reportModel == null)
            {
                throw new ArgumentNullException("reportModel");
            }
            IDataManager   dataMan = DataManagerFactory.CreateDataManager(reportModel, (ReportParameters)null);
            IReportCreator builder = DataPageBuilder.CreateInstance(reportModel, dataMan);

            return(builder);
        }
示例#5
0
        private void RunDataReport(ReportModel reportModel, IDataManager data)
        {
            IReportCreator reportCreator = DataPageBuilder.CreateInstance(reportModel, data);

            reportCreator.SectionRendering     += new EventHandler <SectionRenderEventArgs>(PushPrinting);
            reportCreator.GroupHeaderRendering += new EventHandler <GroupHeaderEventArgs>(GroupHeaderRendering);
            reportCreator.GroupFooterRendering += GroupFooterRendering;

            reportCreator.RowRendering += new EventHandler <RowRenderEventArgs>(RowRendering);
            reportCreator.PageCreated  += OnPageCreated;
            reportCreator.BuildExportList();
            ShowCompleted();
        }
示例#6
0
        public void RunReport(ReportModel reportModel, IDataManager dataManager)
        {
            if (reportModel == null)
            {
                throw new ArgumentNullException("reportModel");
            }
            if (dataManager == null)
            {
                throw new ArgumentNullException("dataManager");
            }
//			ReportEngine.CheckForParameters(reportModel, parameters);
            IReportCreator reportCreator = DataPageBuilder.CreateInstance(reportModel, dataManager);

            BuildExportList(reportCreator);
        }
示例#7
0
        public void RunReport(ReportModel reportModel, DataTable dataTable, ReportParameters parameters)
        {
            if (reportModel == null)
            {
                throw new ArgumentNullException("reportModel");
            }
            if (dataTable == null)
            {
                throw new ArgumentNullException("dataTable");
            }
            ReportEngine.CheckForParameters(reportModel, parameters);
            IDataManager   dataManager   = DataManagerFactory.CreateDataManager(reportModel, dataTable);
            IReportCreator reportCreator = DataPageBuilder.CreateInstance(reportModel, dataManager);

//			reportCreator.SectionRendering += new EventHandler<SectionRenderEventArgs>(PushPrinting);
//			reportCreator.GroupHeaderRendering += new EventHandler<GroupHeaderEventArgs>(GroupHeaderRendering);
//			reportCreator.GroupFooterRendering += GroupFooterRendering;
//
//			reportCreator.RowRendering += new EventHandler<RowRenderEventArgs>(RowRendering);
            reportCreator.BuildExportList();
        }
示例#8
0
        /// <summary>
        /// Use this method for pullData and FormSheet
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="reportParameters">null if no parameters are used</param>
        /// <returns><see cref="BasePager"</returns>
        public static IReportCreator CreatePageBuilder(string fileName,
                                                       ReportParameters reportParameters)
        {
            if (String.IsNullOrEmpty(fileName))
            {
                throw new ArgumentNullException("fileName");
            }

            IReportModel   reportModel = LoadReportModel(fileName);
            IReportCreator builder     = null;

            if (reportModel.DataModel == GlobalEnums.PushPullModel.FormSheet)
            {
                builder = FormPageBuilder.CreateInstance(reportModel);
            }
            else
            {
                CheckForParameters(reportModel, reportParameters);
                IDataManager dataMan = DataManagerFactory.CreateDataManager(reportModel, reportParameters);
                builder = DataPageBuilder.CreateInstance(reportModel, dataMan);
            }
            return(builder);
        }