import PSXP_RPTDEFNMANAGER:*;
Declare Function DeleteLocalFile PeopleCode PSXPFUNCLIB.FUNCLIB FieldFormula;
Declare Function GetDirSeparator PeopleCode PSXPFUNCLIB.FUNCLIB FieldFormula;
Declare Function GetFileNameFromPath PeopleCode PSXPFUNCLIB.FUNCLIB FieldFormula;
Declare Function GetDirectoryFromPath PeopleCode PSXPFUNCLIB.FUNCLIB FieldFormula;
Declare Function GetFileExtension PeopleCode PSXPFUNCLIB.FUNCLIB FieldFormula;
Declare Function ReportDefn PeopleCode TW_XML_FUNCTION.REPORT_YN FieldFormula;
Declare Function CopyReport PeopleCode TW_XML_FUNCTION.REPORT_YN FieldFormula;
Declare Function changedUpperDateWithPrefix PeopleCode TW_XML_FUNCTION.REPORT_YN FieldFormula;
Declare Function OutTypeFunction PeopleCode TW_XML_FUNCTION.REPORT_YN FieldFormula;
&in_PROCESS_INSTANCE = TW_RPT_039_AET.PROCESS_INSTANCE.Value;
&in_RUN_CNTL_ID = TW_RPT_039_AET.RUN_CNTL_ID.Value;
&in_OPRID = TW_RPT_039_AET.OPRID.Value;
&in_TW_BU = TW_RPT_039_AET.TW_BU.Value;
&in_TW_DEPT_SELECT = TW_RPT_039_AET.TW_DEPT_SELECT.Value;
&in_TW_WF_SELECTED = TW_RPT_039_AET.TW_WF_SELECTED.Value;
&in_TW_INS_SELECT = TW_RPT_039_AET.TW_INS_SELECT.Value;
&in_PRD_BGN_DT = TW_RPT_039_AET.PRD_BGN_DT.Value;
&in_PRD_END_DT = TW_RPT_039_AET.PRD_END_DT.Value;
&sqlString = "SELECT * FROM PS_JOB WHERE BUSINESS_UNIT = :1 AND EFFDT >= :2 AND EFFDT <= :3";
&xmldocRoot = CreateXmlDoc("<?xml version='1.0' encoding = 'UTF-8'?><roots></roots>");
&nodeDocRoot = &xmldocRoot.DocumentElement;
&nodeRoot = &nodeDocRoot.AddElement("Root");
&nodeCurrent = &nodeRoot.AddElement("BU");
&nodeCurrent.NodeValue = &in_TW_BU;
&nodeCurrent = &nodeRoot.AddElement("LAB_HEAL");
If &in_TW_INS_SELECT = "NHI" Then
REM 健保;
&nodeCurrent.NodeValue = "健保";
Else
REM 勞保;
&nodeCurrent.NodeValue = "勞保";
End-If;
&sql = CreateSQL(&sqlString, &in_TW_BU, &in_PRD_BGN_DT, &in_PRD_END_DT, �te);
&rec = CreateRecord(Record.TW_RPT_039_DEV);
While &sql.Fetch(&rec)
&nodeCurrent = &nodeRoot.AddElement("COMPANY_DESCR");
&nodeCurrent.NodeValue = &rec.COMPANY.Value;
&nodeCurrent = &nodeRoot.AddElement("ACT_YM");
&nodeCurrent.NodeValue = &ym;
&nodeCurrent = &nodeRoot.AddElement("PRINT_DT");
&nodeCurrent.NodeValue = DateTimeToLocalizedString(�te, "yyyy/MM/dd");
&nodeCurrent = &nodeRoot.AddElement("PRINT_TIME");
&nodeCurrent.NodeValue = DateTimeToLocalizedString(�tetime, "HH/mm/ss");
&sql2String = "SELECT * FROM PS_JOBCODE_TBL WHERE ...";
&sql2 = CreateSQL(&sql2String);
&rec2 = CreateRecord(Record.TW_RPT_039_DEV);
While &sql2.fetch(&rec2)
&nodeBody = &nodeRoot.AddElement("BODY");
&nodeCurrent = &nodeBody.AddElement("AMOUNT");
&nodeCurrent.NodeValue = &rec2.TW_INS_AMOUNT.Value;
REM ADD BY ZTF @ 11/08 ;
&nodeCurrent = &nodeBody.AddElement("DEPT_CODE");
&nodeCurrent.NodeValue = &rec2.TW_BU_DEPT_PRER_CD.Value;
&nodeCurrent = &nodeBody.AddElement("DEPT_DESCR");
&nodeCurrent.NodeValue = &rec2.DESCR4.Value;
REM END MOD ;
&nodeCurrent = &nodeBody.AddElement("EMPLID");
&nodeCurrent.NodeValue = &rec.EMPLID.Value;
&nodeCurrent = &nodeBody.AddElement("BU_PERS_NUM");
&nodeCurrent.NodeValue = &rec2.TW_PRER_NUM_BU.Value;
&nodeCurrent = &nodeBody.AddElement("NAME_NAME");
SQLExec(" SELECT NAME_FORMAL FROM PS_PERSON_NAME WHERE EMPLID = :1 ", &rec2.EMPLID.Value, &name);
&nodeCurrent.NodeValue = &name;
&nodeCurrent = &nodeBody.AddElement("NATIONALID");
SQLExec(" SELECT NATIONAL_ID FROM PS_PERS_NID WHERE EMPLID = :1 AND COUNTRY = 'TWN' ", &rec2.EMPLID.Value, &nationalID);
&nodeCurrent.NodeValue = &nationalID;
&nodeCurrent = &nodeBody.AddElement("DEP_NAT_ID");
&nodeCurrent.NodeValue = &rec2.NATIONAL_ID.Value;
REM ADD BY ZTF @ 11/08 ;
&nodeCurrent = &nodeBody.AddElement("DEP_RELAT");
&nodeCurrent.NodeValue = &rec2.TW_NHI_DEP_CD.ShortTranslateValue;
REM END MOD ;
&nodeCurrent = &nodeBody.AddElement("ACT_DT");
&nodeCurrent.NodeValue = DateTimeToLocalizedString(&rec2.EFFDT.Value, "yyyy/MM/dd");
End-While;
End-While;
&nodeCurrent = &nodeRoot.AddElement("TOTAL_COUNT");
&nodeCurrent.NodeValue = &pageRecCount;
&wkprocess = TW_RPT_039_AET.PROCESS_INSTANCE.Value;
&wkrpt = "TW_RPT_039";
&DATEPART = DateTimeToLocalizedString(�te, "yyyyMMdd");
&OutFormat = OutTypeFunction(&wkrpt, &wkprocess);
rem &filename = &wkrpt | "_" | &DATEPART | "_" | &wkprocess | "." | &OutFormat;
&filename = "xxxxx表_" | &wkprocess | "." | &OutFormat;
ReportDefn(&wkrpt, &wkprocess, &xmldocRoot, &OutFormat);
CopyReport(&wkrpt, &wkprocess, &filename, &OutFormat);
利用PSXPFUNCLIB中的函数 生成XMLP report
最新推荐文章于 2021-06-23 07:26:43 发布