0
votes

I am a beginner in coding and oracle apex 5.0 and developing an application which triggers an email. I am trying to arrange one of the Item named 'LIST OF ISSUES' in a tabular format since it has multiple rows.

A sample output value of item (P1_LIST_OF_ISSUES) = (it has series of issues at a particular time)

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

I want this data to appear in a tabular format in my email. My current email code for this ITEM is

[ <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> ]

Thank you.

2
What is the type of page item, P1_LIST_OF_ISSUES? Also, is it a list with multiple issue descriptions that are concatenated together as a string and separated by delimiter?kapiell
Hi Kapiell, Yes it is a string. This Item is queried through a function, which further extracts a list with multiple issue descriptions that are concatenated together as a string and separated by 'space' delimiter. I am trying to arrange these data in a tabular form in my Email code for clarity.Ammy Prabhu
so you are looking to display this data in one column of each row or three columns?kapiell
one column of each row..Ammy Prabhu
check my answer based on your comments, hope it helps :)kapiell

2 Answers

0
votes

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.
0
votes

Hope this helps ..

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;