> How is creating HTML simpler than CSV for simple tables.

I thought the original post was referring to HTML vs. SYLK files and was
concerning outputting formatted text - which csv files cannot do.

Here is a simple report we generate in html.  Excel happily opens it with
formatting intact.

      crt 'Generating html version of batch report...'
      open 'FILETRANS.REPORTS' to f.reports else stop
204,'FILETRANS.REPORTS'

      pieces = 0
      amount = 0

      html = "<html><head><title>Bath Report for
":DATE2:"</title></head>":@am
      html = html:"<body>":@am
      html = html:"<table>":@am
      html = html:"   <tr><td align=center><font size=5>Batch Report for
":DATE2:"</font><br>"
      html = html:"<i>--- Printed at ":TIME:" ---</i></td></tr>":@am
      html = html:"</table>":@am:@am
      html = html:"<br><br>":@am:@am
      html = html:"<table>":@am
      html = html:"   <tr>":@am
      html = html:"      <td bgcolor=84c1ff width=150>Batch</td>":@am
      html = html:"      <td bgcolor=84c1ff width=25
align=right>Pieces</td>":@am
      html = html:"      <td bgcolor=84c1ff width=100
align=right>Total</td>":@am
      html = html:"   </tr>":@am

      for i = 1 to dcount(BATCH,@am)
         if not(mod(i,3)) then bg = " bgcolor=ffffb0" else bg = ""
         html = html:"   </tr>":@am
         html = html:"      <td":bg:">":BATCH<i,1>:"</td>":@am
         html = html:"      <td":bg:" align=right>":BATCH<i,2>:"</td>":@am
         html = html:"      <td":bg:"
align=right>":BATCH<i,3>'R26$,':"</td>":@am
         html = html:"   </tr>":@am
         pieces = pieces + BATCH<i,2>
         amount = amount + BATCH<i,3>
      next i

      html = html:"   <tr>":@am
      html = html:"      <td>&nbsp;</td>":@am
      html = html:"      <td align=right><hr width=80%></td>":@am
      html = html:"      <td align=right><hr width=80%></td>":@am
      html = html:"   </tr>":@am:@am

      html = html:"   <tr>":@am
      html = html:"      <td>&nbsp;</td>":@am
      html = html:"      <td align=right>":pieces:"</td>":@am
      html = html:"      <td align=right>":amount'R26$,':"</td>":@am
      html = html:"   </tr>":@am:@am
      html = html:"</table>":@am
      html = html:"</body></html>"
      write html on f.reports,"Batch_":DATE2:".htm"

      crt
      crt
      crt @(-5):'Report: "Batch_':DATE2:'.htm" is ready on the R
drive.':@(-6):;input q

      go PROG.START

-- 
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to