【问题标题】:Oracle Apex: A specific item in the Email trigger to be displayed in a tabular formatOracle Apex:电子邮件触发器中的特定项目以表格格式显示
【发布时间】:2017-03-22 07:59:40
【问题描述】:

我是编码和 oracle apex 5.0 以及开发触发电子邮件的应用程序的初学者。我正在尝试以表格格式排列名为“问题列表”的项目之一,因为它有多行。

项目(P1_LIST_OF_ISSUES)的样本输出值=(它在特定时间有一系列问题)

<p> Column1 || Column2 || Column3
Column1.1 || Column2.1|| Column3.1 
Column1.2 || Column2.2  || Column3.2
Column1.3 || Column2.2  || Column3.3 
</p>

我希望这些数据以表格格式显示在我的电子邮件中。 我当前用于此项目的电子邮件代码是

[ <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px #000000;" align="center"> 
  <tr><td width="100%" height="7"  ></td></tr> 
  <tr><td> </td></tr> 
  <tr><td><table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0"><tr><td>                 

   <p><font size="3" face="Arial, Helvetica, sans-serif"><strong> Issues: </strong> </font>  <br> ' || replace(:P1_LIST_OF_ISSUES,chr(10),'<BR>') ||  ' <br> <br><font size="3" face="Arial, Helvetica, sans-serif"><strong>  </td></tr></table></td></tr> </td></tr></table></td></tr>  
  <tr><td> </td></tr> 
</table> ]

谢谢。

【问题讨论】:

  • 页面项的类型是什么,P1_LIST_OF_ISSUES?此外,它是否是一个包含多个问题描述的列表,这些问题描述以字符串形式连接在一起并由分隔符分隔?
  • 嗨 Kapiell,是的,它是一个字符串。通过一个函数查询此项目,该函数进一步提取具有多个问题描述的列表,这些问题描述以字符串形式连接在一起,并由“空格”分隔符分隔。为了清楚起见,我试图在我的电子邮件代码中以表格形式排列这些数据。
  • 所以您希望在每行的一列或三列中显示此数据?
  • 每行一列..
  • 根据你的cmets检查我的答案,希望对你有帮助:)

标签: oracle-apex oracle-apex-5 oracle-apex-5.1


【解决方案1】:

1. Create one page item like P1_LIST_OF_ISSUES
2. Create one page button like submit and placed the button position in edit
3. Create one Region and change the region type like PL/SQL Dynamic Content
4. Copy paste the below source code in PL/SQL Code
<code>
begin
htp.p('<table style="width:50%; border-collapse:collapse;" border="1" align="center" cellpadding="7" cellspacing="7">
<tr>
   <td>
	   <strong> Issues: </strong>
   </td>
   <td>' ||   replace(:P1_LIST_OF_ISSUES,chr(10),'<BR>') ||'
   </td>
</tr>
</table>');
end;
</code>

5. Enter the text in P1_LIST_OF_ISSUES text box and then click the submit button, you will get the output
6. Basically the input value need to assign the texbox, so that we have to use the page button submit action
7. The page submit action asign the input box value to page item id...
8. Finally we got the output.

【讨论】:

  • 您好 Parthi,感谢您的及时帮助。我正在尝试你的代码,很快就会更新你。
【解决方案2】:

希望这会有所帮助..

DECLARE

  L_BODY   VARCHAR2(32767);

BEGIN

  L_BODY   := '<html> Here I give the HTML Code For Example <p>';
  L_BODY   := L_BODY || '<table align="center" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px #000000;" width="100%"><tr><td>';
  L_BODY   := L_BODY || REPLACE(:P1_LIST_OF_ISSUES,CHR(10),'</strong></font></p></td></tr><tr><td><font face="Arial, Helvetica, sans-serif" size="3"><strong><p>');
  L_BODY   := L_BODY || '</td></tr></table></html>';

  // call APEX_MAIL.SEND code

END;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-14
    • 1970-01-01
    • 2018-07-01
    • 1970-01-01
    相关资源
    最近更新 更多