예제 #1
0
        public void RenderHeader(BuiltinReportDescriptor data, bool title, bool logo)
        {
            var s = LoadTemplate("builtinreport_header.ent", data.m);

            /* do replacements */
            s.Set("title", data.Caption); /* [dlatikay 20130111] was encoded twice; removed: System.Web.HttpUtility.HtmlEncode */
            switch (data.DQP)
            {
            case "D":
                s.Set("dqp_info", data.m(445));     /* Development system */
                break;

            case "Q":
            case "T":
                s.Set("dqp_info", data.m(443));     /* Test and Training system */
                break;

            default:
                /* naught */
                s.Set("showdqpinfo_commentstart", Html.cstHTMLCommentStart);
                s.Set("showdqpinfo_commentend", Html.cstHTMLCommentEnd);
                break;
            }
            s.Set("logoresourcename", mime.BINGET_NAMEDRESOURCE_CORPORATELOGO);
            s.Set("nonce", Guid.NewGuid().ToString());
            header = s.AsStringBuilder;
        }
예제 #2
0
        public void SubmitToStream(BuiltinReportDescriptor descriptor)
        {
            /* load the master template */
            var raw = LoadTemplate("builtinreport.ent", descriptor.m);

            /* do we need the JS libraries of amline? */
            if (NeedsAMJSLines)
            {
                var flashscript = LoadTemplate("am_embed_js.html", descriptor.m);
                raw.Set("flashscript", flashscript.ToString());
            }
            else
            {
                raw.Set("flashscript", String.Empty); /* added [dlatikay 20120202] */
            }
            /* perform the replacements */
            raw.Set("title", descriptor.ReportPageTitle);
            raw.Set("dqp", descriptor.DQP);                                                                          /* added [dlatikay 20120209] */
            raw.Set("onloadaction", descriptor.Outputformat == FileType.ft_html ? "window.print();" : String.Empty); /* added [dlatikay 20120209] */
            raw.Set("header", header == null ? String.Empty : header.ToString());
            raw.Set("meta", meta == null ? String.Empty : meta.ToString());
            var compositecontent = new StringBuilder();
            var partcounter      = 0;

            foreach (var part in parts)
            {
                compositecontent.AppendFormat("{1}{0}{2}", part.ToString(), (((++partcounter) <= 1) ? String.Empty : "<!-- section ruler -->"), Environment.NewLine);
            }
            raw.Set("rendition", compositecontent.ToString());
            raw.Set("footer", String.Format("<span id=\"builtinreport_footer\">{0}</span>", HttpUtility.HtmlEncode(String.Format(descriptor.m(3252), descriptor.Systemname, descriptor.Systemversion, descriptor.ReportCreationTimestamp)))); /* Created using en-software SHERM v2.1 */
            raw.Set("onafterprint", descriptor.Outputformat == dal.business.FileType.ft_pdf ? "JavaScript:window.location.href='about:blank';" : String.Empty);                                                                               /* when we are rendering a pdf, we will print it to the postscript printer. therefore we need this to allow the silent host browser to detect when printing has finished */

            /* [dlatikay 20111202] if we want html, we get html;
             * stream it out: */
            if (descriptor.Outputformat == dal.business.FileType.ft_html)
            {
                byte[] html = System.Text.UTF8Encoding.UTF8.GetBytes(raw.ToString());
                ResultStream.Write(html, 0, html.Length);
            }
            /* reset if can */
            if (ResultStream.CanSeek)
            {
                ResultStream.Seek(0, SeekOrigin.Begin);
            }
        }
예제 #3
0
 internal static string MediaURL(string namedresource, int?maxwidth_pix, int?maxheight_pix, dal.business.FileType[] coerce_filetype)
 {
     return(BuiltinReportDescriptor.MediaURL(-1, namedresource, maxwidth_pix, maxheight_pix, coerce_filetype));
 }
예제 #4
0
        /// <summary>
        /// The German Dienstwegeunfallfragebogen
        /// (test harness)
        /// </summary>
        public bool RenderRep0010(out MemoryStream chunk, out string mime, out string encoding, out string uri, BuiltinReportDescriptor data)
        {
            /* make a direct (synchronous) PDF off the rdlc */
            chunk    = new MemoryStream();
            mime     = sherm.core.formatting.mime.cstMIMEPDF;
            encoding = Encoding.UTF8.EncodingName;
            uri      = "Wegeunfallfragebogen.pdf";
            try
            {
                var dt                   = data.DataDescriptor.Data.Tables[ReportDatatableIdentifiers.REPORT_DATATABLE_HARDCOPY_ACCIDENTTRAVEL];
                var dr                   = dt.Rows[0];
                var repRepDate           = dr["fRepRepDate"].ToString();
                var repPersNr            = dr["PersNr"].ToString();
                var repRequestorname     = string.Format("{0}", dr["Requestorname"].ToString());
                var repRequestorPosition = string.Format("{0}", dr["RequestorPosition"].ToString());
                var repTravelOrder       = dr["TravelOrder"].ToString();
                var RepPersonInfo        = string.Format("{0} {1} geb. {2}", dr["Firstname"].ToString(), dr["Lastname"].ToString(), dr["fPersDoB"].ToString());

                var repAccidentInfo          = string.Format(" - Unfall vom {0} - ", dr["fEventDate"].ToString());
                var repTavelStartDatePlace   = InjectCommas(dr["TravelStartPlace"].ToString(), dr["fTravelStartdate"].ToString(), dr["fTravelStarttime"].ToString());
                var repReturnDateReturnPlace = InjectCommas(dr["ReturnPlace"].ToString(), dr["fReturnDate"].ToString(), dr["ReturnTime"].ToString());

                var repAccidentLocation = dr["AccidentLocation"].ToString();
                var repAccidentRoute    = dr["AccidentRoute"].ToString();

                var repRouteMatchesOrder = ToYesNoString(dr["RouteMatchesOrder"].ToString());
                var repsObjective        = dr["sObjective"].ToString();

                var repLastContactBeforeAcc = dr["LastContactBeforeAcc"].ToString();
                var repLastContactDate      = InjectCommas(dr["fLastContactEnddate"].ToString(), dr["fLastContactEndtime"].ToString());
                var repNextPlannedDest      = dr["NextPlannedDest"].ToString();
                int travelflags             = 0;
                int.TryParse(dr["Travelflags"].ToString(), out travelflags);

                bool isSetPrivateMatters = ((AccidentFlags)(travelflags)).HasFlag(AccidentFlags.PrivateMatters);
                bool isSetPolicereport   = ((AccidentFlags)(travelflags)).HasFlag(AccidentFlags.Policereport);

                var repPrivateMatters = ToYesNoString(isSetPrivateMatters); //dr["PrivateMatters"].ToString();
                var repPolicereport   = ToYesNoString(isSetPolicereport);   //["Policereport"].ToString();

                var isSetOpponent      = ToYesNoString(((AccidentFlags)(travelflags)).HasFlag(AccidentFlags.Opponent));
                var repOpponentName    = string.Format("{0}", dr["OpponentName"].ToString());
                var repOpponentAddress = string.Format("{0}", dr["OpponentAddress"].ToString());
                var repOpponentLicence = string.Format("{0}", dr["OpponentLicence"].ToString());


                var isSetLegal     = ToYesNoString(((AccidentFlags)(travelflags)).HasFlag(AccidentFlags.Legal));
                var isSetCompanion = ToYesNoString(((AccidentFlags)(travelflags)).HasFlag(AccidentFlags.Companion));
                var isSetReuptake  = ToYesNoString(((AccidentFlags)(travelflags)).HasFlag(AccidentFlags.Reuptake));

                var repLegalWho       = dr["LegalWho"].ToString();
                var repLegalReference = dr["LegalReference"].ToString();

                var repCompanionName    = dr["CompanionName"].ToString();
                var repCompanionAddress = dr["CompanionAddress"].ToString();

                var repReuptakeDate = dr["fReuptakeDate"].ToString();

                var rpt_format = "PDF";
                /* instantiate and render the rdlc */
                var rpt = new LocalReport()
                {
                    ReportEmbeddedResource = "sherm.rpt.msdbrpt.ReportHardcopyTravelQuestionnaire.rdlc",
                    EnableExternalImages   = true
                };
                rpt.SetParameters(new ReportParameter[]
                {
                    new ReportParameter("RepPersonInfo", RepPersonInfo),     // geb.
                    new ReportParameter("RepAccidentInfo", repAccidentInfo), // Datum in "Unfall vom 01.01.2018"
                    new ReportParameter("RepRepDate", repRepDate),           // report date used to display current date.

                    new ReportParameter("RepPersNr", repPersNr),             // PerNum

                    new ReportParameter("RepRequestorname", repRequestorname),
                    new ReportParameter("RepRequestorPosition", repRequestorPosition),

                    new ReportParameter("RepTravelOrder", repTravelOrder),

                    new ReportParameter("RepTavelStartDatePlace", repTavelStartDatePlace),
                    new ReportParameter("RepReturnDateReturnPlace", repReturnDateReturnPlace),

                    new ReportParameter("RepAccidentLocation", repAccidentLocation),
                    new ReportParameter("RepAccidentRoute", repAccidentRoute),
                    new ReportParameter("RepRouteMatchesOrder", repRouteMatchesOrder),

                    new ReportParameter("RepsObjective", repsObjective),

                    new ReportParameter("RepLastContactBeforeAcc", repLastContactBeforeAcc),
                    new ReportParameter("RepLastContactDate", repLastContactDate),
                    new ReportParameter("RepNextPlannedDest", repNextPlannedDest),

                    new ReportParameter("RepPrivateMatters", repPrivateMatters),
                    new ReportParameter("repPolicereport", repPolicereport),

                    new ReportParameter("Param_22", isSetOpponent),
                    new ReportParameter("RepOpponentName", repOpponentName),
                    new ReportParameter("RepOpponentAddress", repOpponentAddress),
                    new ReportParameter("RepOpponentLicence", repOpponentLicence),

                    new ReportParameter("Param_23", isSetLegal),
                    new ReportParameter("RepLegalWho", repLegalWho),
                    new ReportParameter("RepLegalReference", repLegalReference),

                    new ReportParameter("Param_24", isSetCompanion),
                    new ReportParameter("RepCompanionName", repCompanionName),
                    new ReportParameter("RepCompanionAddress", repCompanionAddress),
                    new ReportParameter("RepReuptakeDate", repReuptakeDate),

                    new ReportParameter("Param_25", isSetReuptake),
                });
                /* rendition - with annoying placeholder table to satisfy the rdlc's data binding */
                var table = new List <ReportHardcopyShim>();
                table.Add(new ReportHardcopyShim());
                var dsTable     = "dsRow";
                var dynDS_Table = new ReportDataSource(dsTable, table);
                rpt.DataSources.Add(dynDS_Table);
                rpt.Refresh();
                string[]  streams;
                Warning[] warnings;
                string    extension;
                string    devinfo = null;
                devinfo = String.Format("<DeviceInfo><DpiX>{0}</DpiX><DpiY>{0}</DpiY></DeviceInfo>", 300);
                var result = rpt.Render(rpt_format, devinfo, PageCountMode.Actual, out mime, out encoding, out extension, out streams, out warnings);
                foreach (var w in warnings)
                {
                    Tracing.WarningCore("Code: {0}, Message: {1}, Objectname: {2}, Objecttype: {3}, Severity: {4}",
                                        w.Code,
                                        w.Message,
                                        w.ObjectName,
                                        w.ObjectType,
                                        w.Severity.ToString()
                                        );
                }
                chunk = new MemoryStream(result);
                if (Debugger.IsAttached)
                {
                    File.WriteAllBytes(uri, result);
                }
                /* succeeded */
                return(true);
            }
            catch (Exception ex)
            {
                Tracing.ErrorCore("{0}", ex.ToString());
                return(false);
            }
        }
예제 #5
0
        /// <summary>
        /// The mighty universal renderer interface method
        /// </summary>
        public bool RenderBuiltinReport(BuiltinReportDescriptor input, out MemoryStream chunk, out string mime, out string encoding, out string uri)
        {
            chunk    = null;
            mime     = null;
            encoding = null;
            uri      = null;
            input.BuiltinReportError       += new ReportErrorEventHandler(input_BuiltinReportError);
            input.BuiltinReportStoreobject += new ReportStoreobjectEventHandler(input_BuiltinReportStoreobject);
            input.BuiltinReportLiteral     += new ReportLiteralEventHandler(input_BuiltinReportLiteral);
            input.BuiltinReportProgress    += new ReportProgressEventHandler(input_BuiltinReportProgress);
            try
            {
                if (input.Render(ref chunk, out mime))
                {
                    if (input.Outputtarget != ReportTarget.Printer)
                    {
                        encoding = System.Text.Encoding.ASCII.EncodingName;
                        uri      = input.TargetFilename;
                        switch (input.GeneratedFileType)
                        {
                        case FileType.ft_xls:
                            mime = sherm.core.formatting.mime.cstMIMEXLS;
                            if (!uri.ToLower().EndsWith(".xlsx"))
                            {
                                uri += ".xlsx";
                            }
                            break;

                        case FileType.ft_pdf:
                            mime = sherm.core.formatting.mime.cstMIMEPDF;
                            if (!uri.ToLower().EndsWith(".pdf"))
                            {
                                uri += ".pdf";
                            }
                            break;

                        case FileType.ft_txt:
                            mime = sherm.core.formatting.mime.cstMIMECSV;
                            if (!uri.ToLower().EndsWith("csv"))
                            {
                                uri += ".csv";
                            }
                            break;

                        case FileType.ft_html:
                            mime = sherm.core.formatting.mime.cstMIMEHTML;
                            if (!uri.ToLower().EndsWith("html"))
                            {
                                uri += ".html";
                            }
                            break;

                        case FileType.ft_zip:
                            mime = sherm.core.formatting.mime.cstMIMEZIP;     /* [dlatikay 20160409] had been wrong: HTML */
                            if (!uri.ToLower().EndsWith("zip"))
                            {
                                uri += ".zip";
                            }
                            break;

                        case FileType.ft_png:
                            mime = sherm.core.formatting.mime.cstMIMEPNG;
                            if (!uri.ToLower().EndsWith("png"))
                            {
                                uri += ".png";
                            }
                            break;

                        case FileType.ft_gif:
                            mime = sherm.core.formatting.mime.cstMIMEGIF;
                            if (!uri.ToLower().EndsWith("gif"))
                            {
                                uri += ".gif";
                            }
                            break;

                        case FileType.ft_bmp:
                            mime = sherm.core.formatting.mime.cstMIMEBMP;
                            if (!uri.ToLower().EndsWith("bmp"))
                            {
                                uri += ".bmp";
                            }
                            break;

                        case FileType.ft_jpg:
                            mime = sherm.core.formatting.mime.cstMIMEJPG;
                            if (uri.ToLower().EndsWith("jpg") == false && uri.ToLower().EndsWith("jpeg") == false)
                            {
                                uri += ".jpg";
                            }
                            break;

                        case FileType.lt_http:
                        case FileType.lt_https:
                            /* added [dlatikay 20150415] */
                            mime = sherm.core.formatting.mime.cstMIMEURL;
                            break;

                        default:
                            mime = sherm.core.formatting.mime.cstMIMETXT;
                            if (!uri.ToLower().EndsWith("txt"))
                            {
                                uri += ".txt";
                            }
                            break;
                        }
                    }
                    /* succeeded */
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            finally
            {
                input.BuiltinReportError       -= new ReportErrorEventHandler(input_BuiltinReportError);
                input.BuiltinReportLiteral     -= new ReportLiteralEventHandler(input_BuiltinReportLiteral);
                input.BuiltinReportStoreobject -= new ReportStoreobjectEventHandler(input_BuiltinReportStoreobject);
                input.BuiltinReportProgress    -= new ReportProgressEventHandler(input_BuiltinReportProgress);
            }
        }
예제 #6
0
        public bool RenderRep0000(string virtualbasepath, string printername, string jobname, bool dinA5, string footerinfoline, string participantname, string participationdatetime, string trainingtopic, string fexpires, out MemoryStream chunk, out string mime, out string encoding, out string uri)
        {
            /* make a direct (synchronous) PDF from training participation certificate data */
            chunk    = new MemoryStream();
            mime     = sherm.core.formatting.mime.cstMIMEPDF;
            encoding = System.Text.Encoding.UTF8.EncodingName;
            uri      = String.Format("Teilnahmezertifikat-{0}-{1}.pdf",
                                     trainingtopic.Replace(" ", "_"),
                                     participantname.Replace(" ", "_")
                                     );
            try
            {
                var rpt_format = "PDF";
                /* instantiate and render the rdlc */
                var rpt = new LocalReport()
                {
                    ReportEmbeddedResource = "sherm.rpt.msdbrpt.ReportHardcopyTrainingCert.rdlc",
                    EnableExternalImages   = true
                };
                if (dinA5)
                {
                    rpt.ReportEmbeddedResource = "sherm.rpt.msdbrpt.ReportHardcopyTrainingCertA5.rdlc";
                }
                /* data binding */
                var Logo = String.Format("{0}{1}",
                                         virtualbasepath,
                                         BuiltinReportDescriptor.MediaURL(sherm.core.formatting.mime.BINGET_NAMEDRESOURCE_CORPORATELOGO, null, null, new FileType[] { FileType.ft_png })
                                         );
                rpt.SetParameters(new ReportParameter[]
                {
                    new ReportParameter("LogoURL", Logo),
                    new ReportParameter("ParticipantName", participantname),
                    new ReportParameter("ParticipationTime", participationdatetime),
                    new ReportParameter("Topic", trainingtopic),
                    new ReportParameter("Expires", fexpires),
                    new ReportParameter("FooterInfoline", footerinfoline)
                });
                /* rendition - with [sic(k)] placeholder table to satisfy the rdlc's data binding */
                var table = new List <ReportHardcopyPSAPlanRow>();
                table.Add(new ReportHardcopyPSAPlanRow());
                var dsTable     = "dsRow";
                var dynDS_Table = new ReportDataSource(dsTable, table);
                rpt.DataSources.Add(dynDS_Table);
                rpt.Refresh();
                string[]  streams;
                Warning[] warnings;
                string    extension;

                /* [pkosec 20140521] set dpi for rdlc (MEA-2014-00207 initiative)
                 * [pkosec 20140506] use the default value (null), if DPI has not been set */
                string devinfo = null;
                devinfo = String.Format("<DeviceInfo><DpiX>{0}</DpiX><DpiY>{0}</DpiY></DeviceInfo>", 300);
                if (printername == null)
                {
                    /* [dlatikay 20180625] can now send directly */
                    var result = rpt.Render(rpt_format, devinfo, PageCountMode.Actual, out mime, out encoding, out extension, out streams, out warnings);
                    foreach (var w in warnings)
                    {
                        Tracing.WarningCore("Code: {0}, Message: {1}, Objectname: {2}, Objecttype: {3}, Severity: {4}",
                                            w.Code,
                                            w.Message,
                                            w.ObjectName,
                                            w.ObjectType,
                                            w.Severity.ToString()
                                            );
                    }
                    chunk = new MemoryStream(result);
                }
                else
                {
                    rpt.PrintToPrinter(printername, jobname);
                }
                /* succeeded */
                return(true);
            }
            catch (Exception ex)
            {
                Tracing.ErrorCore("{0}", ex.ToString());
                return(false);
            }
        }
        /// <summary>
        /// NEW_REPORT
        /// </summary>
        public static BuiltinReportDescriptor Create(BuiltinReport which, BuiltinReportDescriptor.PathParamPackage paths)
        {
            BuiltinReportDescriptor rptdesc = null;

            switch (which)
            {
            case BuiltinReport.Schedule: rptdesc = new ReportSchedule(paths); break;

            case BuiltinReport.LTI_KPI: rptdesc = new ReportKPILTI(paths); break;

            case BuiltinReport.INC_RCA: rptdesc = new ReportINCRCA(paths); break;

            /* [pkosec 20140320] MEA-2014-00099 */
            case BuiltinReport.StatOccupationalSafety: rptdesc = new ReportDescriptorStatOccupationalSafety(paths); break;

            case BuiltinReport.StatPeer2Peer: rptdesc = new ReportDescriptorStatPeer2Peer(paths); break;

            case BuiltinReport.StatIdeas: rptdesc = new ReportDescriptorStatIdeas(paths); break;

            case BuiltinReport.StatInspectionsObservations: rptdesc = new ReportDescriptorStatInspectionsObservations(paths); break;

            case BuiltinReport.StatFindings: rptdesc = new ReportDescriptorStatFindings(paths); break;

            case BuiltinReport.StatMeasures: rptdesc = new ReportDescriptorStatMeasures(paths); break;

            case BuiltinReport.StatMeaFeedback: rptdesc = new ReportMEA001(paths); break;

            case BuiltinReport.StatTrainings: rptdesc = new ReportTRA001(paths); break;

            case BuiltinReport.StatFulfilment: rptdesc = new ReportDescriptorStatFulfilment(paths); break;

            case BuiltinReport.StatDivisionReport: rptdesc = new ReportDescriptorStatDivisionReport(paths); break;

            case BuiltinReport.StatSystemAudits: rptdesc = new ReportDescriptorStatSystemAudits(paths); break; /* added [pkosec 20140908] was missing entirely */

            case BuiltinReport.StatChecklists: rptdesc = new ReportDescriptorStatChecklists(paths); break;     /* [pkosec 20140908] MEA-2014-00388 */

            case BuiltinReport.StatRAR_LTAR: rptdesc = new ReportINCRARLTAR(paths); break;                     /* [dlatikay 20161019] MEA-2016-00476 */

            case BuiltinReport.StatPeer2PeerEx: rptdesc = new ReportSTAP2P(paths); break;                      /* [dlatikay 20161116] */

            /* incident hardcopies */
            case BuiltinReport.Hardcopy_IncidentSafetyPlacard: rptdesc = new ReportHardcopyIncidentSafetyPlacard(paths); break;

            case BuiltinReport.Hardcopy_IncidentPlacard001: rptdesc = new ReportHardcopyIncidentPlacard001(paths); break;

            case BuiltinReport.Hardcopy_IncidentPlacard002: rptdesc = new ReportHardcopyIncidentPlacard002(paths); break;             /* added [pkosec 20140430] MEA-2014-00191 */

            case BuiltinReport.Hardcopy_IncidentPlacard003: rptdesc = new ReportHardcopyIncidentPlacard003(paths); break;             /* added [pkosec 20140430] MEA-2014-00191 */

            case BuiltinReport.Hardcopy_IncidentPlacard004: rptdesc = new ReportHardcopyIncidentPlacard004(paths); break;             /* added [pkosec 20141229] C-1412-0419 */

            case BuiltinReport.Hardcopy_IncidentSafety001: rptdesc = new ReportHardcopyIncidentSafety001(paths); break;               /* added [dlatikay 20130417] MEA-2013-00122 */

            case BuiltinReport.Hardcopy_IncidentSafety002: rptdesc = new ReportHardcopyIncidentSafety002(paths); break;               /* added [pkosec 20140522] MEA-2014-00224 */

            case BuiltinReport.Hardcopy_IncidentSafetySofortmeldung: rptdesc = new ReportHardcopyIncidentSofortmeldung(paths); break; /* added [pkosec 20140603] MEA-2014-00231 */

            case BuiltinReport.Hardcopy_IncidentSafety004: rptdesc = new ReportHardcopyIncidentSafety004(paths); break;               /* added [pkosec 20140603] MEA-2014-00231 */

            case BuiltinReport.Hardcopy_IncidentEnvironment: rptdesc = new ReportHardcopyIncidentEnv001(paths); break;                /* added [dlatikay 20131213] MEA-2013-00825 */

            case BuiltinReport.Hardcopy_IncidentFire: rptdesc = new ReportHardcopyIncidentFire001(paths); break;                      /* added [pkosec 20131213] MEA-2013-00812 */

            case BuiltinReport.Hardcopy_IncidentSafetyVerbose: rptdesc = new ReportHardcopyIncidentSafetyVerbose(paths)
            {
                    Victim = false
            }; break;

            case BuiltinReport.Hardcopy_IncidentSafetyVictim: rptdesc = new ReportHardcopyIncidentSafetyVerbose(paths)
            {
                    Victim = true
            }; break;

            case BuiltinReport.Hardcopy_AUVA: rptdesc = new ReportHardcopyAccidentAUVA(paths); break;                       /* added [dlatikay 20120625]; made this a built-in report */

            case BuiltinReport.Hardcopy_ZOU: rptdesc = new ReportHardcopyAccidentZoU(paths); break;                         /* added [dlatikay 20121211]; made this a built-in report */

            case BuiltinReport.Hardcopy_BG: rptdesc = new ReportHardcopyAccidentBG(paths); break;                           /* added [dlatikay 20130110]; made this a built-in report */

            case BuiltinReport.Hardcopy_BGDraft: rptdesc = new ReportHardcopyAccidentBG(paths, true); break;                /* added [ekaya 20190205]; made this a built-in report */

            case BuiltinReport.Hardcopy_BGMaster: rptdesc = new ReportHardcopyAccidentBGMaster(paths); break;               /* added [ahirov 20190306]; */

            case BuiltinReport.Hardcopy_BGInstantMessage: rptdesc = new ReportHardcopyAccidentInstantMessage(paths); break; /* added [yyavorsk 20190307]; */

            case BuiltinReport.Hardcopy_BGHappendJournal: rptdesc = new ReportHardcopyAccidentHappendJournal(paths); break; /* added [yyavorsk 20190307]; */

            case BuiltinReport.Hardcopy_SUVA: rptdesc = new ReportHardcopyAccidentSUVA(paths); break;                       /* added [dlatikay 20130110]; made this a built-in report */

            /* non-incident hardcopies added [dlatikay 20130422] MEA-2013-00143 */
            case BuiltinReport.Hardcopy_Systemaudit: rptdesc = new ReportHardcopyAud001(paths); break;

            case BuiltinReport.Hardcopy_Observation: rptdesc = new ReportHardcopyObs001(paths); break;

            case BuiltinReport.Hardcopy_Inspection: rptdesc = new ReportHardcopyIns001(paths); break;

            case BuiltinReport.Hardcopy_Meeting: rptdesc = new ReportHardcopyMet001(paths); break;

            case BuiltinReport.Hardcopy_Peer2peer: rptdesc = new ReportHardcopyP2P001(paths); break;

            case BuiltinReport.Hardcopy_WorkplaceRiskAssessment: rptdesc = new ReportHardcopyWRA(paths); break;  /* added [dlatikay 20131218] MEA-2013-00553 */

            case BuiltinReport.Hardcopy_WRA_PL_MT_Verbose: rptdesc = new ReportHardcopyWra002Long(paths); break; /* added [dlatikay 20150605] MEA-2015-00175.2 */

            case BuiltinReport.Hardcopy_WRA_CZ_MT_Brief: rptdesc = new ReportHardcopyWra002Brief(paths); break;  /* added [dlatikay 20150605] MEA-2015-00175.2 */

            case BuiltinReport.Hardcopy_PPEPlan: rptdesc = new ReportHardcopyPPEPlan001(paths); break;           /* added [dlatikay 20151030] VDM */

            case BuiltinReport.Hardcopy_PPEPlan2: rptdesc = new ReportHardcopyPPEPlan002(paths); break;          /* added [dlatikay 20170117] VDM */

            case BuiltinReport.Hardcopy_PPEPlanActivity: rptdesc = new ReportHardcopyPPEPlan001a(paths); break;  /* added [dlatikay 20180430] MPT */

            /* employee and training hardcopies */
            case BuiltinReport.Hardcopy_TrainingAudience: rptdesc = new ReportHardcopyTrainingAudience(paths); break;

            case BuiltinReport.Hardcopy_TrainingSignature: rptdesc = new ReportHardcopyTrainingSignature(paths); break;

            case BuiltinReport.Hardcopy_TravelQuestionnaire: rptdesc = new ReportHardcopyTravelquestionnaire(paths); break;

            case BuiltinReport.Hardcopy_EmployeeProofOfTraining: rptdesc = new ReportHardcopyEmployeeProofOfTraining(paths); break;

            case BuiltinReport.Hardcopy_DutyOverviewPerson: rptdesc = new ReportHardcopyDutyoverviewPerson(paths); break;

            case BuiltinReport.Hardcopy_DutyOverviewOrg: rptdesc = new ReportHardcopyDutyoverviewOrg(paths); break;

            /* safety data sheets */
            case BuiltinReport.Hardcopy_SDSPlacard: rptdesc = new ReportHardcopySDSPlacard001(paths); break;

            case BuiltinReport.Hardcopy_SDSPlacard002: rptdesc = new ReportHardcopySDSPlacard002(paths); break;     /* added [pkosec 20140428] MEA-2014-00190 */

            case BuiltinReport.Hardcopy_SDSPlacard003: rptdesc = new ReportHardcopySDSPlacard003(paths); break;     /* added [dlatikay 20160930] BP variant one-pager */

            case BuiltinReport.Hardcopy_SDSLabel: rptdesc = new ReportHardcopySDSLabel(paths); break;

            case BuiltinReport.Hardcopy_CLPLabel: rptdesc = new ReportHardcopyCLPLabel(paths); break;

            /* work permits */
            case BuiltinReport.Hardcopy_Workpermit: rptdesc = new ReportHardcopyWpt001(paths); break;

            /* specialities */
            case BuiltinReport.LicencePackage: rptdesc = new ReportLicencePackage(paths); break;

            case BuiltinReport.AttachedSafetyDataSheet: rptdesc = new ReportAttachedSafetyDataSheet(paths); break;

            case BuiltinReport.GDPR_Delete: rptdesc = new ReportHardcopyGDPRDeld(paths); break;

            case BuiltinReport.GDPR_Info: rptdesc = new ReportDownloadGDPRInfo(paths); break;

            /* stand-alone hardcopies */
            case BuiltinReport.Hardcopy_Finding: rptdesc = new ReportHardcopyFin001(paths); break;         /* added [pkosec 20141029] MEA-2014-00464 */

            case BuiltinReport.Hardcopy_Hazard: rptdesc = new ReportHardcopyHaz001(paths); break;          /* added [pkosec 20141031] MEA-2014-00464 */

            case BuiltinReport.Hardcopy_Measure: rptdesc = new ReportHardcopyMea001(paths); break;         /* added [pkosec 20141029] MEA-2014-00464 */

            case BuiltinReport.Hardcopy_Controlmeasure: rptdesc = new ReportHardcopyCtl001(paths); break;  /* added [dlatikay 20171121] I-1710-9871 */

            case BuiltinReport.Hardcopy_AUDCustom: rptdesc = new ReportHardcopyAUDCustom001(paths); break; /* added [dlatikay 20180509] */

            default:
                throw new NotSupportedException(which.ToString());
            }
            return(rptdesc);
        }
예제 #8
0
        public void RenderMetadata(BuiltinReportDescriptor descriptor, bool meta_creation, bool meta_criteria, bool meta_qrcode)
        {
            var s = LoadTemplate("builtinreport_meta.ent", descriptor.m);

            meta = s.AsStringBuilder;
        }