Esempio n. 1
0
        public static short openGXReport(String document, IGxContext ctx)
        {
            IReportHandler reportHandler = ctx.reportHandler;

            if (reportHandler == null)
            {
                reportHandler = GxReportUtils.GetPrinter(
                    GxReportUtils.OUTPUT_RVIEWER_DLL,
                    ctx.GetPhysicalPath(),
                    null);
                ctx.reportHandler = reportHandler;
            }
            reportHandler.GxClearAttris();
            bool opened = reportHandler.GxOpenDoc(document);

            if (!ctx.isRemoteGXDB())
            {
                reportHandler.GxRptSilentMode();
            }

            if (opened)
            {
                while (reportHandler.GxIsAlive())
                {
                    try
                    {
                        Thread.Sleep(200);
                    }
                    catch (Exception) {; }
                }
                reportHandler.GxShutdown();
            }
            return(0);
        }
Esempio n. 2
0
        public void ExecuteReports(object sender, ElapsedEventArgs args)
        {
            var actualReports = _reports.GetReports().Where(r => r.FirstReportDate >= DateTime.Today &&
                                                            (DateTime.Today - r.FirstReportDate).TotalDays %
                                                            TimeSpan.FromDays((int)r.Periodicity).TotalDays == 0)
                                .OrderBy(r => r.Code);
            IReportHandler handler = null;

            foreach (var report in actualReports)
            {
                switch (report.Code)
                {
                case ReportCode.MoveAndStop:
                    if (handler == null || handler.GetType() != typeof(MoveAndStopReportHandler))
                    {
                        handler = new MoveAndStopReportHandler();
                    }
                    break;

                case ReportCode.MessagesFromObject:
                    if (handler == null || handler.GetType() != typeof(MessagesFOReportsHandler))
                    {
                        handler = new MessagesFOReportsHandler();
                    }
                    break;

                default:
                    continue;
                }
                report.ExecuteReport(handler);
            }
        }
        public ActionResult ISR080_GetRptIECheckSheetData(string strMaintenanceNo, string strSubcontractorCode)
        {
            strMaintenanceNo     = "5020N20110030";
            strSubcontractorCode = "00002";
            IReportHandler           reportHandler = ServiceContainer.GetService <IReportHandler>() as IReportHandler;
            List <RPTIECheckSheetDo> rptList       = reportHandler.GetRptIECheckSheetData(strMaintenanceNo, strSubcontractorCode);

            IDocumentHandler            dochandler = ServiceContainer.GetService <IDocumentHandler>() as IDocumentHandler;
            List <tbm_DocumentTemplate> dLst       = dochandler.GetDocumentTemplateByDocumentCode(DocumentCode.C_DOCUMENT_CODE_IE_CHECK_SHEET);

            ReportDocument rptH = new ReportDocument();

            string path = ReportUtil.GetReportPath("Reports/ISR080_IECheckSheet.rpt", Server.MapPath("/"));

            rptH.Load(path);

            List <RPTIECheckSheetDo> lst = new List <RPTIECheckSheetDo>();

            lst.Add(rptList[0]);

            if (dLst.Count > 0)
            {
                lst[0].DocumentNameEN  = dLst[0].DocumentNameEN;
                lst[0].DocumentVersion = dLst[0].DocumentVersion;
            }

            rptH.SetDataSource(lst);

            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            rptH.Close();

            return(File(stream, "application/pdf"));
        }
Esempio n. 4
0
        public static IReportHandler GetReportHandler(ReportType reportType)
        {
            switch (reportType)
            {
            case ReportType.Pass:
                reportHandler = new PassReportType1();
                break;

            case ReportType.Fail:
                reportHandler = new FailReport();
                break;

            case ReportType.PhotoLog:
                reportHandler = new PhotologReport();
                break;

            case ReportType.TempPhotolog:
                reportHandler = new TempPhotologReport();
                break;

            default:
                break;
            }
            return(reportHandler);
        }
Esempio n. 5
0
 public SolicitudTask(IDataHandler datahandler, IReportHandler reporthandler, IEmailHandler emailhandler, IReportConfiguration reportconfiguration, SearchCriteria filter)
 {
     _datahandler         = datahandler;
     _reporthandler       = reporthandler;
     _emailhandler        = emailhandler;
     _reportconfiguration = reportconfiguration;
     _filtercriteria      = filter;
 }
Esempio n. 6
0
 public IReportHandler getPrinter()
 {
     if (reportHandler == null)
     {
         oldReportHandler      = reportHandler;
         reportHandler         = GxReportUtils.GetPrinter(getOutputType(), context.GetPhysicalPath(), null);
         context.reportHandler = reportHandler;
     }
     return(reportHandler);
 }
Esempio n. 7
0
        /// <summary>
        /// Generates the photo report.
        /// </summary>
        /// <returns>The photo report.</returns>
        /// <param name="inspection">Inspection.</param>
        private async Task generatePhotoReport(Inspection inspection)
        {
            InspectionDetailService inspectionDetailService = new InspectionDetailService(AppDelegate.DatabaseContext);
            Inspection     insObj        = inspectionDetailService.GetInspectionDetail(inspection, true);
            IReportHandler reportHandler = ReportFactory.GetReportHandler(ReportType.TempPhotolog);

            TempPhotoLogReportPath = reportHandler.GenerateReport("TempPhotoLogReport.pdf", insObj);
            reportHandler          = ReportFactory.GetReportHandler(ReportType.PhotoLog);
            PhotoLogReportPath     = reportHandler.GenerateReport("PhotoLogReport.pdf", insObj);
        }
Esempio n. 8
0
    private static string GetDocumentIntoJson(int clientId, int pager)
    {
        // Use factory to get a ReportHandler
        // You need provide "factoryId" from somewhere too
        IReportHandler dal               = _reportFactory.Create(factoryId);
        var            documents         = dal.FetchDocumentsList(clientId, pager);
        string         documentsDataJSON = JsonConvert.SerializeObject(documents);

        return(documentsDataJSON);
    }
Esempio n. 9
0
        public StatisticsManager(IOptions <StatisticsOptions> optionsAccessor, IReportHandler reportHandler)
        {
            this.ReportHandler = reportHandler ?? throw new ArgumentNullException(nameof(reportHandler));

            this.GlobalStatistics = new StatisticsCollection();

            var options = optionsAccessor.Value;

            this.MonitoredPeriodUtc.Duration = TimeSpanEx.FromSecondsInt(options.MonitoredPeriodSeconds);
            this.ReportDelay = TimeSpanEx.FromSecondsInt(options.ReportDelaySeconds);
        }
Esempio n. 10
0
 public GxReportBuilderPdf(string appPath, Stream outputStream)
 {
     _appPath = appPath;
     {
         _pdfReport = new com.genexus.reports.PDFReportItextSharp(appPath);
     }
     if (outputStream != null)
     {
         _pdfReport.setOutputStream(outputStream);
         GXLogging.Debug(log, "GxReportBuilderPdf outputStream: binaryWriter");
     }
 }
Esempio n. 11
0
        public IReportHandler getPrinter()
        {
            if (reportHandler == null)
            {
                oldReportHandler = reportHandler;
                setContentType();
#if NETCORE
                reportHandler = GxReportUtils.GetPrinter(getOutputType(), context.GetPhysicalPath(), context.HttpContext.Response.Body);
#else
                reportHandler = GxReportUtils.GetPrinter(getOutputType(), context.GetPhysicalPath(), context.HttpContext.Response.OutputStream);
#endif
                context.reportHandler = reportHandler;
            }
            return(reportHandler);
        }
Esempio n. 12
0
        public string GenerateReport(string fileName, Inspection inspectionResult)
        {
            switch (inspectionResult.pass.ToLower())
            {
            case "pass":
                reportHandler = ReportFactory.GetReportHandler(ReportType.Pass);
                break;

            case "fail":
                reportHandler = ReportFactory.GetReportHandler(ReportType.Fail);
                break;
            }

            var path = reportHandler.GenerateReport(fileName, inspectionResult);

            return(path);
        }
Esempio n. 13
0
        public WrappedReportHandler(object handler)
        {
#if NET45 || NET40
            if (handler != null)
            {
                var handlerBase = handler as HandlerBase
                                  ?? new ForwardingProxy <HandlerBase>(handler).GetTransparentProxy();

                _handler = handler as IReportHandler
                           ?? (handlerBase.ImplementsContract(typeof(IReportHandler).FullName)
                        ? new ForwardingProxy <IReportHandler>(handler).GetTransparentProxy()
                        : null);
            }
#else
            _handler = handler as IReportHandler;
#endif
        }
Esempio n. 14
0
        public ActionResult ISR010_GetNewInstallationSlip(string strSlipNo)
        {
            IReportHandler            reportHandler = ServiceContainer.GetService <IReportHandler>() as IReportHandler;
            List <RPTNewRentalSlipDo> rptList       = reportHandler.GetRptNewRentalSlipReport(strSlipNo);

            IDocumentHandler            dochandler = ServiceContainer.GetService <IDocumentHandler>() as IDocumentHandler;
            List <tbm_DocumentTemplate> dLst       = dochandler.GetDocumentTemplateByDocumentCode(DocumentCode.C_DOCUMENT_CODE_NEW_INSTALL_SLIP_RENTAL);

            ReportDocument rptH = new ReportDocument();
            //string path = ReportUtil.GetReportTemplatePath("ISR010_NewInstallationSlip.rpt");
            string path = ReportUtil.GetReportPath("Reports/ISR010_NewInstallationSlip.rpt", Server.MapPath("/"));

            rptH.Load(path);

            List <RPTNewRentalSlipDo> lst = new List <RPTNewRentalSlipDo>();

            if (rptList != null && rptList.Count > 0)
            {
                lst.Add(rptList[0]);

                if (dLst.Count > 0)
                {
                    lst[0].DocumentNameEN  = dLst[0].DocumentNameEN;
                    lst[0].DocumentVersion = dLst[0].DocumentVersion;
                }
            }
            else
            {
                rptList.Add(new RPTNewRentalSlipDo());
            }

            rptH.SetDataSource(lst);
            rptH.Subreports["Page1"].SetDataSource(rptList);
            rptH.Subreports["Page2"].SetDataSource(rptList);
            rptH.Subreports["Page3"].SetDataSource(rptList);

            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            rptH.Close();

            return(File(stream, "application/pdf"));
        }
Esempio n. 15
0
        public ActionResult ISR090_GetRptInstallCompleteConfirmData(string strSlipNo)
        {
            strSlipNo = "401029201112043";

            IReportHandler reportHandler        = ServiceContainer.GetService <IReportHandler>() as IReportHandler;
            List <RPTInstallCompleteDo> rptList = reportHandler.GetRptInstallCompleteConfirmData(strSlipNo);

            IDocumentHandler            dochandler = ServiceContainer.GetService <IDocumentHandler>() as IDocumentHandler;
            List <tbm_DocumentTemplate> dLst       = dochandler.GetDocumentTemplateByDocumentCode(DocumentCode.C_DOCUMENT_CODE_INSTALL_COMPLETE_CONFIRM);

            ReportDocument rptH = new ReportDocument();

            string path = ReportUtil.GetReportPath("Reports/ISR090_InstallCompleteConfirmData.rpt", Server.MapPath("/"));

            rptH.Load(path);

            List <RPTInstallCompleteDo> lst = new List <RPTInstallCompleteDo>();
            int i = 0;

            foreach (RPTInstallCompleteDo rptDataRow in rptList)
            {
                lst.Add(rptDataRow);
                if (dLst.Count > 0)
                {
                    lst[i].DocumentNameEN  = dLst[0].DocumentNameEN;
                    lst[i].DocumentVersion = dLst[0].DocumentVersion;
                }
                i++;
            }

            rptH.SetDataSource(lst);
            rptH.SetParameterValue("C_RENTAL_INSTALL_TYPE_REMOVE_ALL", RentalInstallationType.C_RENTAL_INSTALL_TYPE_REMOVE_ALL);
            rptH.SetParameterValue("C_SALE_INSTALL_TYPE_REMOVE_ALL", SaleInstallationType.C_SALE_INSTALL_TYPE_REMOVE_ALL);


            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            rptH.Close();

            return(File(stream, "application/pdf"));
        }
Esempio n. 16
0
        public ActionResult ISR100_GetRptAcceptanceInspectionNotice(string strMaintenanceNo, string strSubcontractorCode)
        {
            strMaintenanceNo     = "5020N20110030";
            strSubcontractorCode = "00002";
            IReportHandler           reportHandler = ServiceContainer.GetService <IReportHandler>() as IReportHandler;
            List <RPTAcceptInspecDo> rptList       = reportHandler.GetRptAcceptInspecNocticeData(strMaintenanceNo, strSubcontractorCode);

            IDocumentHandler            dochandler = ServiceContainer.GetService <IDocumentHandler>() as IDocumentHandler;
            List <tbm_DocumentTemplate> dLst       = dochandler.GetDocumentTemplateByDocumentCode(DocumentCode.C_DOCUMENT_CODE_ACCEPT_INSPECT_NOTICE);

            ReportDocument rptH = new ReportDocument();

            string path = ReportUtil.GetReportPath("Reports/ISR100_AcceptanceInspectionNotice.rpt", Server.MapPath("/"));

            rptH.Load(path);

            List <RPTAcceptInspecDo> lst = new List <RPTAcceptInspecDo>();
            int i = 0;

            foreach (RPTAcceptInspecDo rptDataRow in rptList)
            {
                lst.Add(rptDataRow);
                if (dLst.Count > 0)
                {
                    lst[i].DocumentNameEN  = dLst[0].DocumentNameEN;
                    lst[i].DocumentVersion = dLst[0].DocumentVersion;
                }
                i++;
            }
            rptH.SetDataSource(lst);

            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            rptH.Close();

            return(File(stream, "application/pdf"));
        }
Esempio n. 17
0
 public Reporter(IReportHandler handler)
 {
     _handler = handler;
 }
Esempio n. 18
0
 public void setContextReportHandler()
 {
     oldReportHandler = null;
     reportHandler    = context.reportHandler;
 }
Esempio n. 19
0
 public void ExecuteReport(IReportHandler handler)
 {
     handler.Execute(this);
 }
 public ShoppingCartHandler(IProductService productService, IOrderService orderService, IReportHandler reportHandler)
 {
     this.productService = productService;
     this.orderService = orderService;
     this.reportHandler = reportHandler;
 }
Esempio n. 21
0
 public ProductReport(IProductService productService, IReportHandler reportHandler)
 {
     this.productService = productService;
     this.reportHandler  = reportHandler;
 }
Esempio n. 22
0
 public HomeController(IReportHandler reportHandler)
 {
     _reportHandler = reportHandler;
 }
Esempio n. 23
0
 public ShoppingCartHandler(IProductService productService, IOrderService orderService, IReportHandler reportHandler)
 {
     this.productService = productService;
     this.orderService   = orderService;
     this.reportHandler  = reportHandler;
 }
Esempio n. 24
0
 public ProductReport(IProductService productService, IReportHandler reportHandler)
 {
     this.productService = productService;
     this.reportHandler = reportHandler;
 }