' clsHtmlWriter - class with routines to create HTML output
'
' A1880
'
'
' History:
'
' 0.0 A1880 08-Oct-2002 1st draft
' A1880 28-Dec-2002 ported from Evaluation to Dictionary
' A1880 06-Sep-2009 ported from VB6 to Jabaco
'
Option Explicit
Private reportFile As String
Private reportWriter As java#io#PrintWriter
Private htmlOutputLines As Long
Private started As Long
Private VMLNamespace As String
Private htmlBuffer As String
Public Function cr2br(s As String) As String
' convert carriage return characters into
Dim pos As Integer
Dim posMax As Integer
Dim t As String
Dim c As String
posMax = Len(s)
t = ""
For pos = 1 To posMax
c = Mid(s, pos, 1)
If Asc(c) < 32 Then
If c = vbCr Then
c = "
"
ElseIf c = vbLf Then
c = ""
Else
c = "[0x" & Hex(Asc(c)) & "]"
End If
End If
t = t & c
Next pos
cr2br = t
End Function
Public Function escapeXML(s As String) As String
Dim ret As String
ret = Replace(s, Chr(34), ""e;")
ret = Replace(ret, "'", "'")
ret = Replace(ret, "-", "-")
ret = Replace(ret, "&", "&")
ret = Replace(ret, ">", ">")
ret = Replace(ret, "<", "<")
escapeXML = ret
End Function
Private Sub generateHtmlStyleForVML()
html ""
End Sub
Public Sub html(s As String)
If Left(s, 1) = ">" Then
htmlBuffer = htmlBuffer & Mid(s, 2)
ElseIf htmlBuffer <> "" Then
If Len(s) + Len(htmlBuffer) > 72 Then
reportWriter.println htmlBuffer
htmlBuffer = s
Else
htmlBuffer = htmlBuffer & vbCrLf & s
End If
Else
htmlBuffer = s
End If
If (s = "") Or (Len(htmlBuffer) > 72) Then
reportWriter.println htmlBuffer
htmlOutputLines = htmlOutputLines + 1
htmlBuffer = ""
End If
End Sub
Public Sub htmlBox(left As Integer, top As Integer, _
txt As String, title As String)
html "
" & txt & "
" Else html "" & txt & "
" End If html "" html "" html IIF(bEnglish, "created ", "erzeugt ") html "in " & sElapsed & "s, " html df.format(New java#util#Date) html IIF(bEnglish, "by a hand-crafted tool of ", "durch ein Programm aus der Feder von ") html "" html "xxx@yyy.com" html "" html "