Question How to add html tables in progress 4gl

varunvarunks

New Member
I created a temp table in Progress4gl and I need to email the data from temp table using html syntax. Which means I need to link all the fields in temp table to html table and email.
The fields in temp table are:
Part_ID, CustomerPartID, customer

Please help.
 

Cecil

19+ years progress programming and still learning.
This is a very basic sample code. to get you started. It's not perfect as it does not encode any non web safe characters i.e. '&'.

Code:
define stream sOutput.

output stream sOutput to SESSION:TEMP-DIR + 'htmlTable.html'.

put stream sOutput unformatted '<table>' skip.

put stream sOutput unformatted '<thead>' skip.

put stream sOutput unformatted '<th>Part ID</th><th>Customer Part ID</th><th>Customer</th>' skip.

put stream unformatted '</thead>' skip.

put stream unformatted '<tbody>' skip.

FOR EACH ttYourTempTable:

put stream unformatted '<tr>' skip

put stream unformatted '<td>'  ttYourTempTable.Part_ID '</td>'.   

put stream unformatted '<td>'  ttYourTempTable.CustomerPartID  '</td>'.

put stream sOutput unformatted '<td>'  ttYourTempTable.customer '</td>'.

put stream sOutput unformatted '</tr>' skip.

END.

put stream sOutput unformatted '</tbody>' skip.

put stream sOutput unformatted '</table>' skip.

output stream sOutput close. /* Ta Da */
 
Top