Hey guys,
I'm trying to enhance an HTML page that has fixed headers and footers and where the content displayed between the two does not conflict, that is, they are not overlapping. In the model I made, the header and footer are fixed but the content collides with both to the point that when there is a page break, the content overlaps the footer.
Partial Class ci_relatorios_relMeuDoc
Inherits System.Web.UI.Page
Private Documentos As New CENTEC.objDocumento
Private Fn As New Funcoes.classFuncao
Private Sub RecebeParametros()
If Not Request("relID") Is Nothing Then
ViewState("vlrID") = Request("relID")
Else
If Request("relID") Is Nothing Then
ViewState("vlrID") = 0
End If
End If
If Not Request("relTdoc") Is Nothing Then
ViewState("vlrdoc") = Request("relTdoc")
Else
If Request("relTdoc") Is Nothing Then
ViewState("vlrTdoc") = 0
End If
End If
End Sub
Private Sub PovoaDocumentos()
Dim Ds As Data.DataSet
Dim pSQL As String = "SET LANGUAGE BRAZILIAN " &
" SELECT A.ID, A.ASSUNTO, " &
" NUMERODOC = CONCAT(REPLICATE('0', 3 - LEN(CAST(A.NUMERO AS VARCHAR))) + CAST(A.NUMERO AS VARCHAR), '/', YEAR(A.DTCRIACAO)), " &
" USUORIGEM = B.NOME, SETOR_ORIGEM = H.DESCRICAO, USUDESTINO = C.NOME, SETOR_DESTINO = L.DESCRICAO, " &
" DATA_CRIACAO = CONVERT(VARCHAR(10), A.DTCRIACAO, 103), TIPO_DOCUMENTO = D.NOME, TEXTO = CONVERT(VARCHAR(MAX), A.TEXTO) " &
" FROM ZMDDOCUMENTO A(NOLOCK) " &
" INNER JOIN PFUNC B(NOLOCK) ON (B.CHAPA = A.CODUSUARIOORIGEM) " &
" INNER JOIN PFCOMPL BB(NOLOCK) ON (BB.CHAPA = B.CHAPA And BB.CODCOLIGADA = B.CODCOLIGADA) " &
" INNER JOIN PFUNC C(NOLOCK) ON (C.CHAPA = A.CODUSUARIOADESTINO) " &
" INNER JOIN PFCOMPL CC(NOLOCK) ON (CC.CHAPA = C.CHAPA And CC.CODCOLIGADA = C.CODCOLIGADA) " &
" INNER JOIN ZMDTIPODOCUMENTO D (NOLOCK) ON (D .ID = A.TIPODOCUMENTO) " &
" INNER JOIN PSECAO E(NOLOCK) ON (E.CODIGO = B.CODSECAO And E.CODCOLIGADA = B.CODCOLIGADA) " &
" INNER JOIN PFUNCAO F(NOLOCK) ON (F.CODIGO = B.CODFUNCAO And F.CODCOLIGADA = B.CODCOLIGADA) " &
" INNER JOIN GDEPTO G(NOLOCK) ON (G.CODDEPARTAMENTO = E.CODDEPTO And G.CODFILIAL = E.CODFILIAL And G.CODCOLIGADA = E.CODCOLIGADA) " &
" INNER JOIN GCONSIST H ON (H.CODCLIENTE = BB.SETORCENTEC And H.CODTABELA = 'SETCENTEC') " &
" INNER JOIN PSECAO I(NOLOCK) ON (I.CODIGO = C.CODSECAO AND I.CODCOLIGADA = C.CODCOLIGADA) " &
" INNER JOIN PFUNCAO J(NOLOCK) ON (J.CODIGO = C.CODFUNCAO AND J.CODCOLIGADA = C.CODCOLIGADA) " &
" INNER JOIN GDEPTO K(NOLOCK) ON (K.CODDEPARTAMENTO = I.CODDEPTO AND K.CODFILIAL = I.CODFILIAL AND K.CODCOLIGADA = I.CODCOLIGADA) " &
" INNER JOIN GCONSIST L ON (L.CODCLIENTE = CC.SETORCENTEC AND L.CODTABELA = 'SETCENTEC') " &
" WHERE A.ID IN (" & ViewState("vlrID") & ") " &
" ORDER BY A.ID "
Ds = Documentos.ConsultaGenerica(pSQL)
If Not Ds Is Nothing Then
Dim pHeader As String = DBNull.Value.ToString
Dim pConteudo As String = DBNull.Value.ToString
Dim pFooter As String = DBNull.Value.ToString
If Ds.Tables(0).Rows.Count > 0 Then
pHeader = "<table width='100%' border='1' cellpadding='0' cellspacing='0'>" &
"<tr>" &
"<td colspan = '2' style='font-size:14pt; text-align:center; font-weight:bold; padding:10px; font-family: Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;' >" & UCase(Ds.Tables(0).Rows(0)("TIPO_DOCUMENTO")) & "</td>" &
"</tr>" &
"<tr>" &
"<td valign='top' width='50%' style='font-size:11pt; text-align:left; padding:0px 5px 0px 5px; border:1px solid #000; font-family: Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;' ><b>De:</b> " & Ds.Tables(0).Rows(0)("USUORIGEM") & "<br />" & Ds.Tables(0).Rows(0)("SETOR_ORIGEM") & "</td>" &
"<td valign='top' width='50%' style='font-size:11pt; text-align:left; padding:0px 5px 0px 5px; border:1px solid #000; font-family: Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;' ><b>Para:</b> " & Ds.Tables(0).Rows(0)("USUDESTINO") & "<br />" & Ds.Tables(0).Rows(0)("SETOR_DESTINO") & "</td>" &
"</tr>" &
"<tr>" &
"<td valign='top' colspan='2' style='font-size:11pt; text-align:left; border:1px solid #000; font-family: Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;' ><b>Assunto:</b> " & Ds.Tables(0).Rows(0)("ASSUNTO") & "</td>" &
"</tr>" &
"</table>"
pConteudo = "<br /><br />" & Server.HtmlDecode(Ds.Tables(0).Rows(0)("TEXTO"))
Dim htmlContent As String = "<html>" & vbCrLf &
"<head>" & vbCrLf &
"<style>" & vbCrLf &
"header { height: auto; position: fixed; top: 0; left: 0; width: 100%; }" & vbCrLf &
"footer { height: 50px; position: fixed; bottom: 0; left: 0; width: 100%; }" & vbCrLf &
"footer .page:after { content: counter(page); }" & vbCrLf &
"</style>" & vbCrLf &
"</head>" & vbCrLf &
"<body>" & vbCrLf &
"<header>" & pHeader & "</header>" & vbCrLf &
"<div style='margin-top: 80px; margin-bottom: 50px;'>" & pConteudo & "</div>" & vbCrLf &
"<footer><div class='page'>Page</div></footer>" & vbCrLf &
"</body>" & vbCrLf &
"</html>"
' Write the HTML content to a file
'File.WriteAllText("page.html", htmlContent)
LbConteudo.Text += htmlContent
End If
End If
End Sub
Private Sub ci_relatorios_relMeuDoc_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
RecebeParametros()
PovoaDocumentos()
End If
End Sub
End Class
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="relMeuDoc.aspx.vb" Inherits="ci_relatorios_relMeuDoc" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:Label ID="LbConteudo" runat="server" ></asp:Label>
</form>
</body>
</html>
Can someone help me?
Grateful.