Basically, what I'm trying to do is add an image into a HTML table, this HTML table was exported from a b4xTable format so i can print it or see as a PDF file.
But looks like my image doesn't exist, also i add this IMG to the project and set it directly like a normal HTML line of code but this doesn't work.
What am i doing wrong?
But looks like my image doesn't exist, also i add this IMG to the project and set it directly like a normal HTML line of code but this doesn't work.
What am i doing wrong?
Print Table to HTML:
Public Sub PrintTable(Table As B4XTable, FileName As String)
Dim printer As Printer
printer.Initialize("printer")
Dim PrintString As String = $"
<!DOCTYPE html>
<html>
<head>
<style>
Table
{
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th
{
border: 1px solid #dddddd;
''text-align: right;
padding: 25px;
}
tr:nth-child(even)
{
background-color: #dddddd;
}
</style>
</head>
<body>
<img src="file:///android_asset/logo.png" alt="IMG" height ="1000" width ="1000"> ''//////////HERE
<h2 align = "left">Proyecto: ${FileName}</h2>
<h4 align = "right">Fecha: ${DateUtils.TicksToString(DateTime.Now)}</h4>
<h4 align = "right">Empresa: ${Crear.Empresa} Encargado DCA: ${Crear.EncargadoDCA} Folio: ${Folio.Text}</h4>
<h4 align = "right">Fecha Inicio: ${Crear.DATEIn} Fecha Fin: ${Crear.DATEFin}</h4>
<h4 align = "right">Deposito Final: ${TotalDepositos} Gasto Final: ${TotalGastos} Total: ${TotalSum}</h4>
<Table><tr>
"$
'"file:///android_asset/buttonpopup.png"
'File:///android_asset/ldlogo.jpg"
For Each Column As B4XTableColumn In Table.Columns
PrintString = PrintString & $"<th>${Column.Title}</th>${CRLF}"$
Next
PrintString = PrintString & "</tr>"
For i = 1 To Table.Size
PrintString = PrintString & "<tr>"
For Each Column As B4XTableColumn In Table.Columns
Dim Row As Object = Table.GetRow(i).Get(Column.Title)
PrintString = PrintString & $"<td>${Row}</td>${CRLF}"$
Next
PrintString = PrintString & "</tr>"
Next
PrintString = PrintString & "</table>"
printer.PrintHtml("job", $"${PrintString}"$)
End Sub