Exemplo n.º 1
0
        public SubReport()
        {
            Report        = new Report();
            CanGrow       = true;
            Report.Height = 35;
            Width         = 100;
            Report.PageHeaderSection.IsVisible = false;
            Report.PageFooterSection.IsVisible = false;
            Report.PageHeaderSection.Height    = 0;

            Report.PageFooterSection.Height            = 0;
            Report.ReportHeaderSection.BackgroundColor = new Color(0.2, 0.8, 0.4);
            Report.ReportFooterSection.BackgroundColor = new Color(0.8, 0.2, 0.7);
            Report.PageFooterSection.BackgroundColor   = new Color(0.8, 0.2, 0.2);
            Report.PageHeaderSection.BackgroundColor   = new Color(0.1, 0.3, 0.2);
            Report.DetailSection.BackgroundColor       = new Color(0.78, 0.78, 0.78);
            Report.ReportHeaderSection.Controls.Add(new Controls.TextBlock {
                FontSize = 12, FontName = "Helvetica",
                Text     = "11text random text random text 08Random text 33 Random text random WW text random _text Random text random text r 44 andom text Random text random text random text ZZZZ", FontColor = new Color(1, 0, 0), Location = new Point(0, 10), CanGrow = true, Size = new Model.Size(79, 30)
            });
            engine = new ReportEngine(this.Report, null)
            {
                IsSubreport = true
            };
        }
Exemplo n.º 2
0
        protected virtual void OnMainNotebookSwitchPage(object o, Gtk.SwitchPageArgs args)
        {
            if (designService != null)
            {
                if (args.PageNum == 1)
                {
                    designService.IsDesign = false;
                    evaluate();

                    ImageSurface  imagesSurface = new ImageSurface(Format.Argb32, (int)designService.Report.Width, (int)designService.Report.Height);
                    Cairo.Context cr            = new Cairo.Context(imagesSurface);
                    reportRenderer.Context = cr;
                    reportEngine           = new ReportEngine(designService.Report, reportRenderer);


                    reportEngine.Process();
                    (cr as IDisposable).Dispose();
                    pageSpinButton.SpinButton.SetRange(1, designService.Report.Pages.Count);
                    previewDrawingArea.QueueDraw();
                }
                else
                {
                    designService.IsDesign = true;
                    drawingarea.QueueDraw();
                }
            }
        }
Exemplo n.º 3
0
        public ActionResult HipVsHop(PrefixReportViewModel model)
        {
            var reportViewer = ReportEngine.Create();

            if (ModelState.IsValid)
            {
                var     day = int.Parse(model.ReportDay);
                DataSet dataset;
                dataset = model.SelectedBranch == "All" ?
                          m_enttContext.GetHipVsHopReportDataSet(model.ReportDate, day) :
                          m_enttContext.GetHipVsHopBranchReportDataSet(model.ReportDate, day, model.SelectedBranch);
                reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\Versus\HipVsHop.rdlc";

                var parameters = new List <ReportParameter>
                {
                    new ReportParameter("reportDate", model.ReportDate.ToShortDateString()),
                    new ReportParameter("day", model.ReportDay)
                };
                reportViewer.LocalReport.EnableHyperlinks = true;
                reportViewer.LocalReport.SetParameters(parameters);
                reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dataset.Tables[0]));
            }

            ViewBag.ReportViewer = reportViewer;
            ViewBag.Branches     = GetUserViewBranches().Select(w => new SelectListItem {
                Text = w.Name, Value = w.Code
            });
            ViewBag.ReportDays = ApplicationHelper.GetReportDays().Select(w => new SelectListItem {
                Text = w.Value, Value = w.Key.ToString()
            });
            return(View(model));
        }
Exemplo n.º 4
0
        public ActionResult HipVsNoHopDetails(string branchCode, double date, string day = "7")
        {
            var reportDate = DateTime.FromOADate(date);

            ViewBag.Branches = m_enttContext.GetBranchInfo(branchCode).Select(w => new SelectListItem {
                Text = w.Name, Value = w.Code
            });
            ViewBag.ReportDays = ApplicationHelper.GetReportDays().Select(w => new SelectListItem {
                Text = w.Value, Value = w.Key.ToString()
            });
            var reportViewer = ReportEngine.Create();

            var dataset = m_enttContext.GetHipVsNoHopDetailsReportDataSet(reportDate.Date, int.Parse(day), branchCode);

            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\Versus\HipVsNoHopDetails.rdlc";
            var parameters = new List <ReportParameter>
            {
                new ReportParameter("reportDate", reportDate.ToShortDateString()),
                new ReportParameter("day", day),
                new ReportParameter("branchCode", branchCode)
            };

            reportViewer.LocalReport.EnableHyperlinks = true;
            reportViewer.LocalReport.SetParameters(parameters);
            reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dataset.Tables[0]));
            ViewBag.TotalRows    = dataset.Tables[0].Rows.Count;
            ViewBag.ReportViewer = reportViewer;
            var model = new PrefixReportViewModel {
                ReportDate = reportDate, ReportDay = day, SelectedBranch = branchCode
            };

            return(View(model));
        }
Exemplo n.º 5
0
        private void RunEventLogger(string fileName)
        {
            /*
             * using (var provider = ProfilingDataSQLiteProvider.FromFile("ProfilingSession.sdps")){
             *      var functions = provider.GetFunctions(0, provider.DataSets.Count - 1);
             *      foreach (CallTreeNode n in functions) {
             *              Console.WriteLine("{0}: {1} calls, {2:f2}ms", n.Name, n.CallCount, n.TimeSpent);
             *      }
             *
             * }
             */
            Cursor.Current = Cursors.WaitCursor;
            EventLogger eLog = new EventLogger(fileName);

            Cursor.Current = Cursors.Default;

            this.imageList = eLog.Images;

            ReportModel  model       = ReportEngine.LoadReportModel(fileName);
            IDataManager dataManager = DataManager.CreateInstance(eLog.EventLog, model.ReportSettings);

//			this.previewControl1.SectionRendering += PushPrinting;

            this.previewControl1.PreviewLayoutChanged += delegate(object sender, EventArgs e)

            {
                this.previewControl1.RunReport(model, dataManager);
            };
            this.previewControl1.RunReport(model, dataManager);
        }
Exemplo n.º 6
0
        private void RunStandardReport(string reportName)
        {
            string s = Path.GetFileNameWithoutExtension(reportName);

            if (s == "ContributorsList")
            {
                this.RunContributors(reportName);
            }
            else if (s == "NoConnectionReport")
            {
                this.RunProviderIndependent(reportName);
            }
            else if (s == "EventLog")
            {
                this.RunEventLogger(reportName);
            }
//			this.RunEventLogger_Pdf(reportName);
            else
            {
                ReportParameters parameters = ReportEngine.LoadParameters(reportName);

                if ((parameters != null) && (parameters.SqlParameters.Count > 0))
                {
                    parameters.SqlParameters[0].ParameterValue = "I'm the Parameter";
                }
                this.previewControl1.PreviewLayoutChanged += delegate(object sender, EventArgs e)
                {
                    this.RunStandardReport(reportName);
                };
                this.previewControl1.RunReport(reportName, parameters);
            }
        }
Exemplo n.º 7
0
        public ActionResult ExpectedArrivalDetailsReport(string branchCode, double date)
        {
            var reportDate = DateTime.FromOADate(date);

            ViewBag.Branches = m_enttContext.GetBranchInfo(branchCode).Select(w => new SelectListItem {
                Text = w.Name, Value = w.Code
            });
            var reportViewer = ReportEngine.Create();

            var dataset = m_enttContext.ExpectedArrivalBranchReportDetailsDataSet(reportDate.Date, branchCode);

            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\Versus\ExpectedArrivalDestinationOfficeDetails.rdlc";
            var parameters = new List <ReportParameter>
            {
                new ReportParameter("reportDate", reportDate.ToShortDateString()),
                new ReportParameter("branchCode", branchCode)
            };

            reportViewer.LocalReport.EnableHyperlinks = true;
            reportViewer.LocalReport.SetParameters(parameters);
            reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dataset.Tables[0]));
            ViewBag.TotalRows    = dataset.Tables[0].Rows.Count;
            ViewBag.ReportViewer = reportViewer;
            var model = new StandardReportViewModel {
                ReportDate = reportDate, SelectedBranch = branchCode
            };

            return(View(model));
        }
Exemplo n.º 8
0
        public ActionResult ExpectedArrivalReport(StandardReportViewModel model)
        {
            var reportViewer = ReportEngine.Create();

            if (ModelState.IsValid)
            {
                DataSet dataset;
                dataset = model.SelectedBranch == "All" ?
                          m_enttContext.ExpectedArrivalReportDataSet(model.ReportDate) :
                          m_enttContext.ExpectedArrivalBranchReportDataSet(model.ReportDate, model.SelectedBranch);
                reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\Versus\ExpectedArrivalDestinationOffice.rdlc";

                var parameters = new List <ReportParameter>
                {
                    new ReportParameter("reportDate", model.ReportDate.ToShortDateString())
                };
                reportViewer.LocalReport.EnableHyperlinks = true;
                reportViewer.LocalReport.SetParameters(parameters);
                reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dataset.Tables[0]));
            }

            ViewBag.ReportViewer = reportViewer;
            ViewBag.Branches     = GetUserViewBranches().Select(w => new SelectListItem {
                Text = w.Name, Value = w.Code
            });
            return(View(model));
        }
Exemplo n.º 9
0
        public void ProcessSectionUpToHeightTreshold_BeforeDeailsProcess_HeightLeftIsReportHeightMinusHeadersAndFooters()
        {
            Report r = new Report();

            double heightBeforeDetails = 0;

            r.ReportHeaderSection.Height = 50;
            r.PageHeaderSection.Height = 10;
            r.PageFooterSection.Height = 25;
            r.DetailSection.Height = 15;

            r.DetailSection.OnBeforeControlProcessing += delegate(ReportContext rc, Control c) {
                //before first detail processing
                if( heightBeforeDetails == 0 ) {
                    heightBeforeDetails = rc.HeightLeftOnCurrentPage;
                }
            };

            RendererMock m = new RendererMock();
            ReportEngine re = new ReportEngine(r,m);
            re.Process();
            double pageHeaderAndPageFooterHeight =  r.Height - ( r.ReportHeaderSection.Height + r.PageHeaderSection.Height + r.PageFooterSection.Height);

            Assert.AreEqual(pageHeaderAndPageFooterHeight,heightBeforeDetails);
        }
 public void UserTestCases()
 {
     UsersReusables = new UsersReusables(driver);
     foreach (var ItemOne in UserSuites.ParamValOne)
     {
         foreach (var ItemTwo in UserSuites.ParamValOne)
         {
             foreach (var ItemThree in UserSuites.ParamValOne)
             {
                 foreach (var ItemFour in UserSuites.ParamValOne)
                 {
                     foreach (var ItemFive in UserSuites.ParamValOne)
                     {
                         foreach (var ItemSix in UserSuites.ParamValOne)
                         {
                             foreach (var ItemSeven in UserSuites.ParamValOne)
                             {
                                 ++Count;
                                 ReportEngine.Count = Count;
                                 UserResult         = UsersReusables.UserRegistrationCompulsoryFields(ItemOne, ItemTwo, ItemThree, ItemFour, ItemFive, ItemSix, ItemSeven);
                                 ReportEngine.ReportEngineGlobal(4, UserReadPath, UserWritePath, UserResult);
                                 new Base.Base(driver).UserRegisrationFailed(UserValidations.RegistrationFailedPanels, UserValidations.CloseFailedPanel);
                                 UsersReusables.ReclickCreate(SystemAdminConstants.Users, UserConstants.CreateUser, UserConstants.CreateUser, UserValidations.UserFooter, driver, UserConstants.AddNewUser);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 11
0
        //
        /// <summary>
        /// Some values in the Datastructure are not set (means they are null), you can handle this values by setting
        /// the NullValue in the properties of this Item, or, you can use the SectionRenderingEvent as shown
        /// below
        /// </summary>
        /// <param name="fileName"></param>
        private void RunContributors(string fileName)
        {
            ReportModel model = ReportEngine.LoadReportModel(fileName);
//			Console.WriteLine(model.ReportSettings.PageSize);
//			model.ReportSettings.PageSize = new Size(model.ReportSettings.PageSize.Width,400);
//			Console.WriteLine(model.ReportSettings.PageSize);

            // sorting is done here, but, be carefull, misspelled fieldnames will cause an exception

            //ReportSettings settings = model.ReportSettings;
            //settings.SortColumnCollection.Add(new SortColumn("First",System.ComponentModel.ListSortDirection.Ascending));

            // Both variable declarations  are valid

            ContributorCollection contributorCollection = ContributorsReportData.CreateContributorsList();
            IDataManager          dataManager           = DataManager.CreateInstance(contributorCollection, model.ReportSettings);

//			List<Contributor> list = ContributorsReportData.CreateContributorsList();
//			IDataManager dm = DataManager.CreateInstance(list,model.ReportSettings);


            this.previewControl1.PreviewLayoutChanged += delegate(object sender, EventArgs e)
            {
                this.previewControl1.RunReport(model, dataManager);
            };
            this.previewControl1.RunReport(model, dataManager);
        }
Exemplo n.º 12
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        contributors = CreateTestList();


        // instance reporting engine
        // assign parameters

        ReportEngine engine = new ReportEngine();

        string reportPath = Server.MapPath("ContributorList.srd");

        ReportModel reportModel = ReportEngine.LoadReportModel(reportPath);

        PageBuilder pageBuilder = engine.CreatePageBuilder(reportModel, contributors);

        pageBuilder.BuildExportList();
        string outputPath = Server.MapPath("ContributorList.pdf");

        // render report
        PdfRenderer pdfRenderer =
            PdfRenderer.CreateInstance(pageBuilder.Pages, outputPath, false);

        pdfRenderer.Start();
        pdfRenderer.RenderOutput();
        pdfRenderer.End();

        // send report to the client
        Response.ContentType = "Application/pdf";
        Response.WriteFile(outputPath);
        Response.End();
    }
Exemplo n.º 13
0
        private void ResolveReport(Report report, Hashtable parameters)
        {
            try
            {
                SheetView    sheetView    = (SheetView)Serializer.LoadObjectXml(typeof(SheetView), Serializer.GetObjectXml(report.ReportSheet, "SheetView"), "SheetView");
                ReportEngine reportEngine = new ReportEngine(report.Configuration.DataSources, sheetView, parameters);
                PageReport   pageReport   = reportEngine.execute();

                PaginateReportIterator iterator = pageReport.generateReportPageIterator();

                DynamicValueList ColumnWidthList = ReportHelper.getColumnWidthList(pageReport.ToWorkSheet());
                DynamicValueList RowHeightList   = ReportHelper.getRowHeightList(pageReport.ToWorkSheet());

                DrawingOP drawingOP = new DrawingOP(this, pageReport, RowHeightList, ColumnWidthList);
                while (iterator.hasNext())
                {
                    ReportPage reportPage = iterator.next() as ReportPage;
                    drawingOP.DrawReport(reportPage);
                }
            }
            catch (Exception ex)
            {
                Report.Reset();
                Report.ColumnCount         = 6;
                Report.RowCount            = 2;
                Report.RowHeaderVisible    = false;
                Report.ColumnHeaderVisible = false;
                Report.Columns[0].Width    = 700;
                Report.Rows[0].Height      = 500;
                Report.Cells[0, 0].Text    = "报表解析出错:" + ex.Message;
            }
        }
Exemplo n.º 14
0
        private void GeneratePagesWrapped()
        {
            ReportEngine  engine        = Report.Engine;
            PreparedPages preparedPages = Report.PreparedPages;

            preparedPages.CanUploadToCache = false;

            List <Rectangle> spans = GetSpanList();
            int startColumn        = 0;

            Top = 0;

            while (startColumn < Columns.Count)
            {
                int startRow   = 0;
                int columnsFit = GetColumnsFit(startColumn, engine.PageWidth - Left);
                // avoid the infinite loop if there is not enough space for one column
                if (startColumn > 0 && columnsFit == 0)
                {
                    columnsFit = 1;
                }

                while (startRow < Rows.Count)
                {
                    int rowsFit = GetRowsFit(startRow, engine.FreeSpace);
                    if (startRow == 0 && engine.IsKeeping && rowsFit < RowCount && isFirstRow && engine.KeepCurY > 0)
                    {
                        engine.EndColumn();

                        rowsFit = GetRowsFit(startRow, engine.FreeSpace);
                    }
                    if (rowsFit == 0)
                    {
                        engine.StartNewPage();
                        rowsFit = GetRowsFit(startRow, engine.FreeSpace);
                    }

                    engine.CurY += GeneratePage(startColumn, startRow, columnsFit, rowsFit,
                                                new RectangleF(0, 0, engine.PageWidth, engine.FreeSpace), spans);

                    startRow += rowsFit;

                    if (Report.Aborted)
                    {
                        break;
                    }
                }

                startColumn += columnsFit;
                if (startColumn < Columns.Count)
                {
                    engine.CurY += WrappedGap;
                }

                if (Report.Aborted)
                {
                    break;
                }
            }
        }
Exemplo n.º 15
0
        public void ProcessSectionUpToHeightTreshold_BeforeDeailsProcess_HeightLeftIsReportHeightMinusHeadersAndFooters()
        {
            Report r = new Report();

            double heightBeforeDetails = 0;

            r.ReportHeaderSection.Height = 50;
            r.PageHeaderSection.Height   = 10;
            r.PageFooterSection.Height   = 25;
            r.DetailSection.Height       = 15;

            r.DetailSection.OnBeforeControlProcessing += delegate(ReportContext rc, Control c) {
                //before first detail processing
                if (heightBeforeDetails == 0)
                {
                    heightBeforeDetails = rc.HeightLeftOnCurrentPage;
                }
            };

            RendererMock m  = new RendererMock();
            ReportEngine re = new ReportEngine(r, m);

            re.Process();
            double pageHeaderAndPageFooterHeight = r.Height - (r.ReportHeaderSection.Height + r.PageHeaderSection.Height + r.PageFooterSection.Height);

            Assert.AreEqual(pageHeaderAndPageFooterHeight, heightBeforeDetails);
        }
Exemplo n.º 16
0
 public void ProcessSectionUpToHeightTreshold_WithNoDatasource_HasAtLeastOnePage()
 {
     Report r = new Report();
     RendererMock m = new RendererMock();
     ReportEngine re = new ReportEngine(r,m);
     re.Process();
     Assert.IsNotEmpty(r.Pages);
 }
Exemplo n.º 17
0
        private void InnerOpenReport(string cacheId, string viewId, string fileterFlag, string groupId, string rawtable, RuntimeFormat runtimeFormat, FilterArgs args, string crossId)
        {
            //加载报表的样式
            ReportEngine reportEngine = new ReportEngine(_login, ReportStates.Browse, _datacontainer);
            string       allcolumns   = reportEngine.LoadFormat(cacheId, viewId, fileterFlag, groupId, null, rawtable, runtimeFormat);

            if (args != null)
            {
                if (!string.IsNullOrEmpty(allcolumns))
                {
                    //if (_context.Type == ReportType.IndicatorReport)
                    if (string.IsNullOrEmpty(args.ClassName))// &&! _context.FilterArgs.bAutoSource )
                    {
                        RowAuthFacade raf     = new RowAuthFacade();
                        string        rowauth = raf.GetRowAuthFromAllColumns(viewId, allcolumns, ClientReportContext.Login, true);
                        args.Args.Add("RowAuthString", rowauth);
                    }
                    string[] columns = Regex.Split(allcolumns, "@;@");//allcolumns.Split(new char[] { '@', ';', '@' });
                    //if( _context.FilterArgs.Args.Contains( "DataAccordingGroup" ) )
                    //{
                    if (columns.Length > 1)
                    {
                        string[] items = columns[1].Split(',');
                        for (int i = 0; i < items.Length; i++)
                        {
                            if (!string.IsNullOrEmpty(items[i]))
                            {
                                args.GroupItems.Add(items[i]);
                            }
                        }
                    }
                    if (columns.Length > 2)
                    {
                        string[] items = columns[2].Split(',');
                        for (int i = 0; i < items.Length; i++)
                        {
                            if (!string.IsNullOrEmpty(items[i]))
                            {
                                args.SumItems.Add(items[i]);
                            }
                        }
                    }
                    //}
                    args.DataSource.SelectString = string.IsNullOrEmpty(columns[0]) ? "" : columns[0];
                }
                else
                {
                    args.DataSource.SelectString = "";
                }

                args.Args.Add("columns", args.DataSource.SelectString);
            }

            string colAuthString = GetColAuthString(viewId);

            //运行报表
            reportEngine.CreateReport(true, args, null, null, null, rawtable, 0, colAuthString, ShowStyle.Normal, crossId, false);
        }
Exemplo n.º 18
0
        private void PostaviIzvjestaj(DataSet ds)
        {
            DataTable dt = ds.Tables[0];

            this.reportViewer1.Reset();

            this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource(dt.TableName, dt));


            ReportBuilder reportBuilder = new ReportBuilder();

            reportBuilder.DataSource = ds;

            reportBuilder.Page = new ReportPage();
            ReportSections reportFooter      = new ReportSections();
            ReportItems    reportFooterItems = new ReportItems();

            ReportTextBoxControl[] footerTxt = new ReportTextBoxControl[3];
            footerTxt[0] = new ReportTextBoxControl()
            {
                Name = "txtCopyright", ValueOrExpression = new string[] { string.Format("Copyright {0}", DateTime.Now.Year) }
            };
            footerTxt[1] = new ReportTextBoxControl()
            {
                Name = "ExecutionTime", ValueOrExpression = new string[] { "Izvjestaj generiran " + DateTime.Now.ToString() }
            };
            footerTxt[2] = new ReportTextBoxControl()
            {
                Name = "PageNumber", ValueOrExpression = new string[] { "Stranica ", ReportGlobalParameters.CurrentPageNumber, " of ", ReportGlobalParameters.TotalPages }
            };

            reportFooterItems.TextBoxControls = footerTxt;
            reportFooter.ReportControlItems   = reportFooterItems;
            reportBuilder.Page.ReportFooter   = reportFooter;

            ReportSections reportHeader = new ReportSections();

            reportHeader.Size        = new ReportScale();
            reportHeader.Size.Height = 0.05;

            ReportItems reportHeaderItems = new ReportItems();

            ReportTextBoxControl[] headerTxt = new ReportTextBoxControl[1];
            headerTxt[0] = new ReportTextBoxControl()
            {
                Name = "txtReportTitle", ValueOrExpression = new string[] { "Stanje na dan : " + DateTime.Now.ToString() }
            };

            reportHeaderItems.TextBoxControls = headerTxt;
            reportHeader.ReportControlItems   = reportHeaderItems;
            reportBuilder.Page.ReportHeader   = reportHeader;



            this.reportViewer1.LocalReport.LoadReportDefinition(ReportEngine.GenerateReport(reportBuilder));

            this.reportViewer1.RefreshReport();
        }
Exemplo n.º 19
0
        /// <summary>
        /// 打开的crosstable,rawtable为NULL,
        /// basetable传入的是rawtable
        /// </summary>
        private void InnerOpenCrossReport(string cacheId, string viewId, string fileterFlag, string groupId, string rawtable, RuntimeFormat runtimeFormat, FilterArgs args, string crossId)
        {
            ReportEngine reportEngine = new ReportEngine(_login, ReportStates.Browse, _datacontainer);

            reportEngine.CrossLoadFormat(cacheId, viewId, runtimeFormat);
            string colAuthString = GetColAuthString(viewId);

            reportEngine.CreateCrossReport(true, true, fileterFlag, colAuthString, groupId, null, args, null, null, rawtable, 0, ShowStyle.Normal, crossId, false);
        }
Exemplo n.º 20
0
 public static void ForceEngineHeartbeats()
 {
     EmailEngine.ForceHeartbeat();
     WebEmailEngine.ForceHeartbeat();
     ReportEngine.ForceHeartbeat();
     WebReportEngine.ForceHeartbeat();
     RssEventEngine.ForceHeartbeat();
     WebRssEventEngine.ForceHeartbeat();
 }
Exemplo n.º 21
0
        public void ProcessSectionUpToHeightTreshold_WithNoDatasource_HasAtLeastOnePage()
        {
            Report       r  = new Report();
            RendererMock m  = new RendererMock();
            ReportEngine re = new ReportEngine(r, m);

            re.Process();
            Assert.IsNotEmpty(r.Pages);
        }
Exemplo n.º 22
0
        public void SetupAsynchron(string fileName, ReportParameters parameters)
        {
            if (String.IsNullOrEmpty(fileName))
            {
                throw new ArgumentNullException("fileName");
            }
            ReportModel m = ReportEngine.LoadReportModel(fileName);

            RunReport(m, parameters);
        }
Exemplo n.º 23
0
        public void RunReport(string fileName, ReportParameters parameters)
        {
            if (String.IsNullOrEmpty(fileName))
            {
                throw new ArgumentNullException("fileName");
            }
            ReportModel model = ReportEngine.LoadReportModel(fileName);

            this.RunReport(model, parameters);
        }
Exemplo n.º 24
0
        public ActionResult Upload(IEnumerable <HttpPostedFileBase> files, PatientViewModel model)
        {
            var  pvm       = new PatientViewModel();
            long patientID = 0;

            //HttpFileCollection someFiles = files;
            //IEnumerable<HttpPostedFileBase> someFiles = files;

            //try
            //{
            //	patientDoc = XDocument.Load(Request.Files["PatientFile"].InputStream);
            //}
            //catch (Exception e)
            //{
            //	Console.WriteLine(e.Message);
            //	ViewBag.UploadAlert = "You must select a valid file";
            //}

            using (var c = new DataModelContext())
            {
                var patient = c.Patients.Find(model.ID);
                patientID = patient.ID;

                HttpPostedFileBase patientDoc = Request.Files["PatientFile"];
                var fileName = Path.GetFileName(patientDoc.FileName);
                var path     = Path.Combine(Server.MapPath("~/Content/excelfiles"), fileName);
                patientDoc.SaveAs(path);

                var ReportE = ReportEngine.getInstance();
                pvm.Report           = ReportE.GenerateReport(patient, path);
                patient.ReportResult = pvm.Report;

                try
                {
                    c.SaveChanges();
                }
                catch (DbEntityValidationException e)
                {
                    foreach (var i in e.EntityValidationErrors)
                    {
                        Console.WriteLine(i.ValidationErrors);
                    }
                    throw e;
                }
                //nvm.Patients = c.Patients.Include("Therapist").Where(n => n.Name != null).ToList();

                //ViewBag.NewNetworkID = xmlnetwork.ID;
            }

            ViewBag.Alert      = "Upload successful";
            ViewBag.AlertClass = "alert-success";

            return(RedirectToAction("Report", new { id = patientID }));
            //return View("Report", pvm);
        }
Exemplo n.º 25
0
        private async Task <bool> CheckValidTemplate()
        {
            bool     temp = false;
            FileInfo file;
            var      sheetName = "";

            foreach (var item in fileList)
            {
                try
                {
                    if (!CommonEngine.CheckExistsUnicodeChar(item.FileName))
                    {
                        item.IsValid = false;
                        item.Note    = LanguageEngine.GetMessageCaption("000021", ConfigEngine.Language);
                    }
                    file = new FileInfo(item.FilePath);
                    CommonEngine.SetWaitFormInfo("Đang kiểm tra tập tin " + file.Name, "Checking file " + file.Name, 1);
                    if (file.Exists)
                    {
                        temp = await ReportEngine.CheckValidImportTemplate(CommonEngine.userInfo.UserID, ConfigEngine.Language, strStoreProcedure, file.Name, strModuleID, strFunctionID, file.FullName);

                        if (!temp)
                        {
                            item.IsValid = false;
                            item.Note    = ConfigEngine.Language.Equals("vi") ? "Mẫu không hợp lệ!" : "Invalid template!";
                        }
                        else
                        {
                            item.IsValid   = true;
                            item.Note      = ConfigEngine.Language.Equals("vi") ? "Mẫu hợp lệ!" : "Valid template!";
                            item.SheetName = sheetName;
                            string tmp = item.FileName;
                            tmp            = tmp.Substring(0, tmp.LastIndexOf('.'));
                            tmp            = Regex.Replace(tmp, @"[^a-zA-Z0-9\s-().\[\]]", "");
                            item.TableName = tmp;
                        }
                    }
                    else
                    {
                        item.IsValid = false;
                        item.Note    = ConfigEngine.Language.Equals("vi") ? "Tập tin không tồn tại!" : "File not exists!";
                    }
                }
                catch (Exception ex)
                {
                    CommonEngine.ShowExceptionMessage(ex);
                }
            }
            grvSeletedFiles.RefreshData();

            return(true);
        }
Exemplo n.º 26
0
        private void InnerPreLoad(object login)
        {
            try
            {
                ClientReportContext context = new ClientReportContext(login);
                ClientReportContext.Port     = Cryptography.LoginInfo.ProtocolPort["RePt"].ToString();
                ClientReportContext.Protocal = Cryptography.LoginInfo.ProtocolPort["RePr"].ToString();
                DefaultConfigs.RegChannel(ClientReportContext.Login.AppServer);
                ReportEngine re = DefaultConfigs.GetRemoteEngine(ClientReportContext.Login, ReportStates.Browse);
                re.PreLoad();

                new ReportViewControl();
                new GridReportControl();

                AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinGrid.v10.2");
                AppDomain.CurrentDomain.Load("Infragistics2.Shared.v10.2");
                AppDomain.CurrentDomain.Load("Infragistics2.Win.v10.2");
                AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinDock.v10.2");
                AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinDataSource.v10.2");
                AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinChart.v10.2");
                AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinToolbars.v10.2");
                AppDomain.CurrentDomain.Load("Infragistics2.Win.SupportDialogs.v10.2");

                //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinGrid.v6.3");
                //AppDomain.CurrentDomain.Load("Infragistics2.Shared.v6.3");
                //AppDomain.CurrentDomain.Load("Infragistics2.Win.v6.3");
                //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinDock.v6.3");
                //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinDataSource.v6.3");
                //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinChart.v6.3");

                //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinGrid.v6.1");
                //AppDomain.CurrentDomain.Load("Infragistics2.Shared.v6.1");
                //AppDomain.CurrentDomain.Load("Infragistics2.Win.v6.1");
                //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinDataSource.v6.1");
                //AppDomain.CurrentDomain.Load("Infragistics2.Win.UltraWinToolbars.v6.1");

                AppDomain.CurrentDomain.Load("UFIDA.U8.UAP.UI.Runtime.Common");
                AppDomain.CurrentDomain.Load("UFIDA.U8.UAP.UI.Runtime.View");
                AppDomain.CurrentDomain.Load("UFIDA.U8.UAP.UI.Runtime.Controller");
                AppDomain.CurrentDomain.Load("UFIDA.U8.UAP.UI.Runtime.Model");
                AppDomain.CurrentDomain.Load("UFIDA.U8.UAP.UI.Runtime.List");
                AppDomain.CurrentDomain.Load("UFIDA.U8.UAP.UI.Runtime.BusinessObject");

                System.Diagnostics.Trace.WriteLine("Report preload end");
            }
            catch (Exception e)
            {
                System.Diagnostics.Trace.WriteLine(e.Message);
            }
        }
Exemplo n.º 27
0
        void Button7Click(object sender, EventArgs e)
        {
            ReportParameters pm     = new ReportParameters();
            ReportEngine     engine = new ReportEngine();

            if (osistem.Contains("Win"))
            {
                engine.PreviewPushDataReport(Application.StartupPath + @"\RepSpisak.srd", dataSet1.Tables["tAdresar"], pm);
            }
            else
            {
                engine.PreviewPushDataReport(Application.StartupPath + @"/RepSpisak.srd", dataSet1.Tables["tAdresar"], pm);
            }
        }
Exemplo n.º 28
0
        public ActionResult ExpectedArrivalReport()
        {
            var reportViewer = ReportEngine.Create();

            ViewBag.ReportViewer = reportViewer;
            ViewBag.Branches     = GetUserViewBranches().Select(w => new SelectListItem {
                Text = w.Name, Value = w.Code
            });
            var model = new StandardReportViewModel {
                ReportDate = DateTime.Today
            };

            return(View(model));
        }
        public IReportCreator Run(ReadOnlyCollection <AssemblyNode> list)
        {
            System.Reflection.Assembly asm    = Assembly.GetExecutingAssembly();
            System.IO.Stream           stream = asm.GetManifestResourceStream("ICSharpCode.CodeQuality.Reporting.DependencyReport.srd");
            var model = ReportEngine.LoadReportModel(stream);

            ReportSettings = model.ReportSettings;
            var newList = MakeList(list);

            IReportCreator creator = ReportEngine.CreatePageBuilder(model, newList, null);

            creator.BuildExportList();
            return(creator);
        }
Exemplo n.º 30
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);

            RunReport(reportModel, dataManager);
        }
Exemplo n.º 31
0
 private void OnEndAll()
 {
     try
     {
         _completeevent.Set();
         if (EndAll != null)
         {
             EndAll(null, null);
         }
     }
     finally
     {
         _engine = null;
     }
 }
Exemplo n.º 32
0
        public void RunReport(ReportModel reportModel, System.Collections.IList dataSource, ReportParameters parameters)
        {
            if (reportModel == null)
            {
                throw new ArgumentNullException("reportModel");
            }
            if (dataSource == null)
            {
                throw new ArgumentNullException("dataSource");
            }
            ReportEngine.CheckForParameters(reportModel, parameters);
            IDataManager dataManager = DataManagerFactory.CreateDataManager(reportModel, dataSource);

            RunReport(reportModel, dataManager);
        }
Exemplo n.º 33
0
        public SubReport()
        {
            Report = new Report();
            CanGrow = true;
            Report.Height = 35;
            Width = 100;
            Report.PageHeaderSection.IsVisible = false;
            Report.PageFooterSection.IsVisible = false;
            Report.PageHeaderSection.Height = 0;

            Report.PageFooterSection.Height = 0;
            Report.ReportHeaderSection.BackgroundColor = new Color(0.2, 0.8, 0.4);
            Report.ReportFooterSection.BackgroundColor = new Color(0.8, 0.2, 0.7);
            Report.PageFooterSection.BackgroundColor =   new Color(0.8, 0.2, 0.2);
            Report.PageHeaderSection.BackgroundColor = new Color(0.1, 0.3, 0.2);
             Report.DetailSection.BackgroundColor = new Color(0.78,0.78,0.78);
            Report.ReportHeaderSection.Controls.Add (new Controls.TextBlock { FontSize = 12, FontName = "Helvetica",
            Text = "11text random text random text 08Random text 33 Random text random WW text random _text Random text random text r 44 andom text Random text random text random text ZZZZ", FontColor = new Color(1,0,0), Location = new Point (0, 10), CanGrow = true, Size = new Model.Size (79, 30) });
            engine = new ReportEngine (this.Report,null) {
            IsSubreport = true
            };
        }
Exemplo n.º 34
0
        public ActionResult FichaPacienteReporte(TurnosPorPacienteViewModel viewModel)
        {
            //Si es sólo paciente, puede ver sus atenciones únicamente
            if (User.IsInRole<Paciente>() && User.Roles.Count == 1) viewModel.PacienteId = User.As<Paciente>().Id;

            if (!viewModel.PacienteId.HasValue) return RedirectToAction("SeleccionPaciente");

            var paciente = SessionFactory.GetCurrentSession().Get<Paciente>(viewModel.PacienteId);
            if (paciente == null) return HttpNotFound();

            viewModel.PacienteSeleccionado = MappingEngine.Map<InfoViewModel>(paciente);

            var report = ReportFactory.Create<IFichaPacienteReporte>();
            report.FechaDesde = viewModel.Filters.Desde;
            report.FechaHasta = viewModel.Filters.Hasta;
            report.Filtro = viewModel.Filters.Filtro;
            report.PacienteId = paciente.Id;

            var reportEngine = new ReportEngine();
            var reportBytes = reportEngine.BuildReport(report);
            return File(reportBytes, "application/pdf", string.Format("FichaPaciente_{0}.pdf", viewModel.PacienteSeleccionado.Descripcion.SanitanizeForFileName()));
        }
Exemplo n.º 35
0
 public void ProcessReport()
 {
     FillDatasource();
     ImageSurface imagesSurface = new ImageSurface (Format.Argb32, (int)Report.Width, (int)Report.Height);
     using (Cairo.Context cr = new Cairo.Context (imagesSurface)) {
         renderer.Context = cr;
         reportEngine = new ReportEngine (Report, renderer);
         reportEngine.Process ();
         (cr as IDisposable).Dispose ();
     }
     if (OnReportDataFieldsRefreshed != null)
         OnReportDataFieldsRefreshed (this, new EventArgs ());
     IsDirty = false;
 }
Exemplo n.º 36
0
        protected virtual void OnMainNotebookSwitchPage(object o, Gtk.SwitchPageArgs args)
        {
            if (designService != null) {
                if (args.PageNum == 1) {
                    designService.IsDesign = false;
                    evaluate ();

                    ImageSurface imagesSurface = new ImageSurface (Format.Argb32, (int)designService.Report.Width, (int)designService.Report.Height);
                    Cairo.Context cr = new Cairo.Context (imagesSurface);
                    reportRenderer.Context = cr;
                    reportEngine = new ReportEngine (designService.Report, reportRenderer);

                    reportEngine.Process ();
                    (cr as IDisposable).Dispose ();
                    pageSpinButton.SpinButton.SetRange (1, designService.Report.Pages.Count);
                    previewDrawingArea.QueueDraw ();
                } else {
                    designService.IsDesign = true;
                    drawingarea.QueueDraw ();
                }
            }
        }