oracle 将行转换为列的RTF模板

fhity93d  于 2023-10-16  发布在  Oracle
关注(0)|答案(1)|浏览(99)
<EMPLOYEE_INFORMATION_REC>
<PERSON_NUMBER>31</PERSON_NUMBER>
<Payroll_Relationship_Number>531</Payroll_Relationship_Number>
<Payroll_ID>322623279</Payroll_ID>
<PersonID>305634180</PersonID>
<Payroll>
<PERSONAL_PAYMENTS>
    <Payroll_Relationship_Rec>
    <Payroll_Relationship_Action_ID>326491</Payroll_Relationship_Action_ID>
    <Payroll_Interface_Effective_Date>2023-05-25T00:00:00.000Z</Payroll_Interface_Effective_Date>
    <Payroll_Interface_Base_Run_Type_Name>Regular Normal</Payroll_Interface_Base_Run_Type_Name>
    <Tax_Reporting_Unit>Saskatchewan Workers' Compensation Board</Tax_Reporting_Unit>
    <Action_Type>Q</Action_Type>
<Run_Results>
<Run_Results_Rec>
    <Input_Values_Base_Name>Hours</Input_Values_Base_Name>
    <Run_Result_Value>2.45</Run_Result_Value>
    <Base_Element_Name>Overtime 2x Result</Base_Element_Name>
    <Start_date>2023-05-15</Start_date>
    <End_date>2023-05-15</End_date>
    <Run_Result_ID>1530959</Run_Result_ID>
    <Primary_Classification_Name>Standard Earnings</Primary_Classification_Name>
    <PERSONID>300000015630330</PERSONID>
</Run_Results_Rec>
</Run_Results>
<Run_Results>
<Run_Results_Rec>
    <Input_Values_Base_Name>Hours</Input_Values_Base_Name>
    <Run_Result_Value>4.45</Run_Result_Value>
    <Base_Element_Name>Overtime 2x Result</Base_Element_Name>
    <Start_date>2023-05-17</Start_date>
    <End_date>2023-05-17</End_date>
    <Run_Result_ID>1530949</Run_Result_ID>
    <Primary_Classification_Name>Standard Earnings</Primary_Classification_Name>
    <PERSONID>300000015630330</PERSONID>
</Run_Results_Rec>
</Run_Results>
</Payroll_Relationship_Rec>
</PERSONAL_PAYMENTS>
</Payroll>
</EMPLOYEE_INFORMATION_REC>

我想显示在这样一种方式,这些输入_值_基地_名称,运行_结果_值,基地_元素_名称等上述XML来列,而不是行在RTF模板。
如何调整下面的模板相同?

Person_number                                                   Input_Values_Base_Name          Base_Element_Name                                                           
<?for-each:EMPLOYEE_INFORMATION_REC?> <PERSON_NUMBER>           <Input_Values_Base_Name>         <Base_Element_Name> <?end for-each?>

期望-
| 人员编号|Input_values_base_name|基本元素名称|开始日期|
| --|--|--|--|
| 31 |小时|加班结果|2023-05-17 2023-05-17 2023-05-17|
| 31 |小时|值结果|2023-05-15|

des4xlb0

des4xlb01#

如果您使用Word创建RTF模板,然后创建表格,创建重复组并添加列。BI Publisher属性为红色:

如果你需要应用xsl代码来样式化你的xml,那么:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  <body>
    <xsl:for-each select="//EMPLOYEE_INFORMATION_REC">
        <br/>
        <table>
          <tr>
            <th align="right" style="border: solid black 1px;">PERSON_NUMBER</th>
            <th align="left" style="border: solid black 1px;">Input_Values_Base_Name</th>
            <th align="left" style="border: solid black 1px;">Base_Element_Name</th>
            <th align="left" style="border: solid black 1px;">Start_date</th>
          </tr>
          <xsl:for-each select="//Run_Results_Rec">
              <tr>
                <td style="border: solid black 1px;"><xsl:value-of select="//PERSON_NUMBER" /></td>
                <td style="border: solid black 1px;"><xsl:value-of select="Input_Values_Base_Name" /></td>
                <td style="border: solid black 1px;"><xsl:value-of select="Base_Element_Name" /></td>
                <td style="border: solid black 1px;"><xsl:value-of select="Start_date" /></td>
              </tr>
          </xsl:for-each>
        </table>
    </xsl:for-each>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

相关问题