Amiguinho,
Este forum é uma verdadeira biblioteca de informações, vou tentar lhe apresentar algumas dicas:
Relatorio perfeito e simples...Na postagem acima, mostro um código genérico para correr uma impressão, onde, à partir de variáveis você define como os relatórios irão se comportar. Se vão apenas listar, se vão somatizar ou sintetizar.
nfHTML - Gera arquivos HTMLNa postagem acima, faço uso de código puro, usando o que se tem na própria linguagem xBase.
Aqui é usado o
tBrowse() do Clipper e ele existe no Harbour também. Voce apenas terá de filtrar seus dados, apresentá-los no
tBrowse() e consequentemente comandar a geração da saida em HTML pelas funções
TB2HTML ou se quiser a saida em outro formato,
TB2XML.
Temos também outras funções, e se você trabalhar com vontade sobre elas poderá oferecer em seu sistema opções variadas ao seu usuário.
nfRTF - Gera arquivos para WordnfXLS - Gera arquivos XLS - SimplesXLS - Gerando arquivos XLS complexos usando OLE.Em primeiro lugar para se trabalhar com impressos, mesmo que
HTML temos que verificar como é dividida a estrutura de geração.
Todo impresso possui 3 partes principais e fixos, sendo cabeçalho, corpo e rodapé.
Vou apresentar a forma que uso para apresentar meus impressos em formato
HTML onde faço o inxerto das informações em cada parte do mesmo:
Vou apresentar os trechos com as funções que uso em Fivewin(voce pode adaptá-las com as funções existentes em seu ambiente).
Function HTMLPedido( _num_, _oque_, l2Vias )
// Parametros:
// _num_ - numero de pedido
// _oque_ - tipo do impresso
// l2Vias - quantidades de vias
// Pego informações para compor o cabeçalho
Cl_Nome := VerifyINI( "CLIENTE" , "NOME" , "NOME DA EMPRESA" , cPath+"nfw.ini" )
Cl_Endereco := VerifyINI( "CLIENTE" , "ENDERECO" , "ENDERECO DA EMPRESA" , cPath+"nfw.ini" )
Cl_Bairro := VerifyINI( "CLIENTE" , "BAIRRO" , "BAIRRO DA EMPRESA" , cPath+"nfw.ini" )
Cl_Cidade := VerifyINI( "CLIENTE" , "CIDADE" , "SP " , cPath+"nfw.ini" )
Cl_Telefone := VerifyINI( "CLIENTE" , "TELEFONE" , "(0xx11)0000-0000" , cPath+"nfw.ini" )
Cl_Cep := VerifyINI( "CLIENTE" , "CEP" , "00000-000" , cPath+"nfw.ini" )
Cl_Estado := VerifyINI( "CLIENTE" , "ESTADO" , "SP" , cPath+"nfw.ini" )
Cl_Fax := VerifyINI( "CLIENTE" , "FAX" , "(0xx11)0000-0000" , cPath+"nfw.ini" )
Cl_Cnpj := VerifyINI( "CLIENTE" , "CGC" , "00.000.000/0000-00" , cPath+"nfw.ini" )
Cl_Inscricao:= VerifyINI( "CLIENTE" , "IE" , "00.000.000-00" , cPath+"nfw.ini" )
Cl_Email := VerifyINI( "CLIENTE" , "EMAIL" , "email@provedor.com.br" , cPath+"nfw.ini" )
l2Vias := .f. // Default é via unica
if MsgYesNo( "Deseja impressao em duas vias?" )
l2Vias := .t.
endif
// Seleção do arquivo principal
dbSelectArea( "PN" )
OrdSetFocus( 2 )
// Busca do primeiro parametro
dbSeek(STR(_num_,6,0))
if .not. found()
MsgStop( "Nada encontrado com o numero(" + STR(_num_,6,0) + ")" )
return .t.
endif
// Carrego variaveis iniciais
M->IDCLIENTE := PN->IDCLIENTE
M->IDFUNC := PN->IDFUNC
M->OBS2 := PN->OBS2
M->PRN_DATAPED := PN->DATAPED
M->PRN_IDCONDICAO := PN->IDCONDICAO
M->PRN_AVALIACAO := PN->AVALIACAO
M->PRN_FRETE := PN->FRETE // Valor de desconto
M->PRN_IDFUNC := PN->IDFUNC // Codigo do funcionario
M->PRN_IDTRANSP := PN->IDTRANSP // codigo da transportadora em PN
M->PRN_IDCLIENTE := PN->IDCLIENTE // Codigo do cliente
// Carrego outras veriaveis através de pesquisa em outras tabelas
M->PRN_CONDICAO := PESQ( M->PRN_IDCONDICAO, "CONDICAO", 1, "CONDICAO" )
//
M->PRN_NOME := PESQ( STR(M->PRN_IDCLIENTE,5,0), "CLIENTES", 2, "NOME" )
M->PRN_ENDERECO := PESQ( STR(M->PRN_IDCLIENTE,5,0), "CLIENTES", 2, "ENDERECO" )
M->PRN_BAIRRO := PESQ( STR(M->PRN_IDCLIENTE,5,0), "CLIENTES", 2, "BAIRRO" )
M->PRN_CIDADE := PESQ( STR(M->PRN_IDCLIENTE,5,0), "CLIENTES", 2, "CIDADE" )
M->PRN_CEP := PESQ( STR(M->PRN_IDCLIENTE,5,0), "CLIENTES", 2, "CEP" )
M->PRN_ESTADO := PESQ( STR(M->PRN_IDCLIENTE,5,0), "CLIENTES", 2, "ESTADO" )
M->PRN_INSCR := PESQ( STR(M->PRN_IDCLIENTE,5,0), "CLIENTES", 2, "INSCR" )
M->PRN_CGC := PESQ( STR(M->PRN_IDCLIENTE,5,0), "CLIENTES", 2, "CGC" )
// Segundo parametro define o tipo do impresso
// define o arquivo template usado para o cabeçalho
cHTMLFile := STR( Random(), 8 ) + ".HTM"
do case
case _oque_ = "V" // Pedido
cTPLFile := "PEDIDOC.TPL"
cHTMLName := "PEDIDO DE VENDA"
cHTMLFile := "PE"+STRZERO(M->IDPEDIDO,6)+".HTM"
case _oque_ = "O" // Orcamento
cTPLFile := "PEDIDOC.TPL"
cHTMLName := "ORCAMENTO"
cHTMLFile := "OC"+STRZERO(M->IDPEDIDO,6)+".HTM"
case _oque_ = "N" // Pre-Nota
cTPLFile := "PEDIDOC.TPL"
cHTMLName := "PRE-NOTA"
cHTMLFile := "NF"+STRZERO(M->IDPEDIDO,6)+".HTM"
endcase
// Verifico a existencia do template CABECALHO para fazer uso
if !file( cTPLFile )
MsgStop( "Template de cabecalho "+cTPLFile+" nao encontrado." )
dbSelectArea( "PN" )
OrdSetFocus( 1 )
return .t.
endif
// Faco o carregamento do template de CABECALHO
cHTMLFile1 := MemoRead( cTPLFile )
// Preenchimento de algumas variaveis a serem usadas
Cl_Nome := VerifyINI( "CLIENTE" , "NOME" , "NOME DA EMPRESA" , cPath+"nfw.ini" )
Cl_Endereco := VerifyINI( "CLIENTE" , "ENDERECO" , "ENDERECO DA EMPRESA" , cPath+"nfw.ini" )
Cl_Bairro := VerifyINI( "CLIENTE" , "BAIRRO" , "BAIRRO DA EMPRESA" , cPath+"nfw.ini" )
Cl_Cidade := VerifyINI( "CLIENTE" , "CIDADE" , "SP " , cPath+"nfw.ini" )
Cl_Telefone := VerifyINI( "CLIENTE" , "TELEFONE" , "(0xx11)0000-0000" , cPath+"nfw.ini" )
Cl_Cep := VerifyINI( "CLIENTE" , "CEP" , "00000-000" , cPath+"nfw.ini" )
Cl_Estado := VerifyINI( "CLIENTE" , "ESTADO" , "SP" , cPath+"nfw.ini" )
Cl_Fax := VerifyINI( "CLIENTE" , "FAX" , "(0xx11)0000-0000" , cPath+"nfw.ini" )
Cl_Cnpj := VerifyINI( "CLIENTE" , "CGC" , "00.000.000/0000-00" , cPath+"nfw.ini" )
Cl_Inscricao:= VerifyINI( "CLIENTE" , "IE" , "00.000.000-00" , cPath+"nfw.ini" )
Cl_Email := VerifyINI( "CLIENTE" , "EMAIL" , "email@provedor.com.br" , cPath+"nfw.ini" )
// Neste momento faço o inxerto de variaveis via MERGE, com conteudos ja capturados
// Cada uma das linhas abaixo fara a troca das variaveis com conteudos
cHTMLFile1 := StrTran( cHTMLFile1, "{#impresso#}" , cHTMLName )
cHTMLFile1 := StrTran( cHTMLFile1, "{#empresa#}" , Cl_Nome )
cHTMLFile1 := StrTran( cHTMLFile1, "{#endereco#}" , Cl_Endereco )
cHTMLFile1 := StrTran( cHTMLFile1, "{#bairro#}" , Cl_Bairro )
cHTMLFile1 := StrTran( cHTMLFile1, "{#cidade#}" , Cl_Cidade )
cHTMLFile1 := StrTran( cHTMLFile1, "{#pais#}" , "Brasil" )
cHTMLFile1 := StrTran( cHTMLFile1, "{#telefone#}" , Cl_Telefone )
cHTMLFile1 := StrTran( cHTMLFile1, "{#fax#}" , Cl_Fax )
cHTMLFile1 := StrTran( cHTMLFile1, "{#website#}" , "www.website.com" )
cHTMLFile1 := StrTran( cHTMLFile1, "{#email#}" , Cl_Email )
cHTMLFile1 := StrTran( cHTMLFile1, "{#idpedido#}" , str( M->IDPEDIDO, 6 ) )
cHTMLFile1 := StrTran( cHTMLFile1, "{#situacao#}" , M->PRN_AVALIACAO )
cHTMLFile1 := StrTran( cHTMLFile1, "{#dataped#}" , dtoc( M->PRN_DATAPED ) )
cHTMLFile1 := StrTran( cHTMLFile1, "{#idcondicao#}" , M->PRN_IDCONDICAO )
cHTMLFile1 := StrTran( cHTMLFile1, "{#identrega#}" , M->PRN_TR_NOME )
cHTMLFile1 := StrTran( cHTMLFile1, "{#barcode#}" , "BARCODE" )
cHTMLFile1 := StrTran( cHTMLFile1, "{#ClienteNome#}" , OemToAnsi( FDecripta( M->PRN_NOME ) ) )
cHTMLFile1 := StrTran( cHTMLFile1, "{#ClienteEmail#}" , M->PRN_EMAIL )
cHTMLFile1 := StrTran( cHTMLFile1, "{#ClienteTelefone#}" , M->PRN_TELEFONE )
cHTMLFile1 := StrTran( cHTMLFile1, "{#ClienteFax#}" , M->PRN_FAX )
cHTMLFile1 := StrTran( cHTMLFile1, "{#ClienteEndereco#}" , M->PRN_ENDERECO )
cHTMLFile1 := StrTran( cHTMLFile1, "{#ClienteBairro#}" , M->PRN_BAIRRO )
cHTMLFile1 := StrTran( cHTMLFile1, "{#ClienteCidade#}" , M->PRN_CIDADE )
cHTMLFile1 := StrTran( cHTMLFile1, "{#ClienteEstado#}" , M->PRN_ESTADO )
cHTMLFile1 := StrTran( cHTMLFile1, "{#ClienteCep#}" , M->PRN_CEP )
cHTMLFile1 := StrTran( cHTMLFile1, "{#ClienteINSCR#}" , M->PRN_INSCR )
cHTMLFile1 := StrTran( cHTMLFile1, "{#ClienteCGC#}" , M->PRN_CGC )
// Momento de impressao dos dados do corpo usando mais um template
// Promovo a selecao do arquivo, indice e filtragem dos itens
dbSelectArea( "ES" )
OrdSetFocus( 3 )
dbSeek(str(_num_,6,0))
OrdScope(0,STR(_num_,6,0))
OrdScope(1,STR(_num_,6,0))
dbGoTop()
// Zeramento de variaveis de somatoria usada no rodapé
M->SUBTOTAL := 0
M->DESCONTO := 0
// Verifico a existencia do template CORPO para fazer uso
cTPLFile := "PEDIDOI.TPL"
if !file( cTPLFile )
MsgStop( "Template de itens "+cTPLFile+" nao encontrado." )
dbSelectArea( "PN" )
OrdSetFocus( 1 )
return .t.
endif
// Faco o carregamento do template de geracao do CORPO do impresso
cHTMLFile2 := MemoRead( cTPLFile )
// A variavel cHTMLFile22 irá comportar todos os registros do corpo
// ou seja irá usar o template de corpo varias vezes conforme o numero
// de registros
cHTMLFile22 := ""
DO WHILE .NOT. EOF()
cHTMLFile21 := ""
cHTMLFile21 := StrTran( cHTMLFile2 , "{#Resumido#}" , SUBSTR(ES->RESUMIDO,1,10) )
cHTMLFile21 := StrTran( cHTMLFile21, "{#Descricao#}" , ALLTRIM(SUBSTR(ES->DESCRICAO,1,45)) )
cHTMLFile21 := StrTran( cHTMLFile21, "{#Medida#}" , ES->MEDIDA )
cHTMLFile21 := StrTran( cHTMLFile21, "{#Quantidade#}", TRANSF(ES->QUANTIDADE,ES->MASCARA) )
cHTMLFile21 := StrTran( cHTMLFile21, "{#Unitario#}" , TRANSF(ES->VALORVENDA,"@E 99,999.99") )
cHTMLFile21 := StrTran( cHTMLFile21, "{#Desconto#}" , TRANSF(ES->DESCONTO,"@E 99,999.99") )
cHTMLFile21 := StrTran( cHTMLFile21, "{#SubTotal#}" , TRANSF(ES->SUBTOTAL,"@E 99,999.99") )
cHTMLFile22 := cHTMLFile22 + cHTMLFile21
// Subtotalizacao dos registros
M->SUBTOTAL := M->SUBTOTAL + ES->SUBTOTAL
M->DESCONTO := M->DESCONTO + ES->DESCONTO
SKIP
ENDDO
// Verifico a existencia do template RODAPE para fazer uso
cTPLFile := "PEDIDOR.TPL"
if !file( cTPLFile )
MsgStop( "Template de rodape "+cTPLFile+" nao encontrado." )
dbSelectArea( "PN" )
OrdSetFocus( 1 )
return .t.
endif
// Faco o carregamento do template de geracao do RODAPE do impresso
cHTMLFile3 := MemoRead( cTPLFile )
// Neste momento faço o inxerto de variaveis via MERGE, com conteudos ja capturados
// Cada uma das linhas abaixo fara a troca das variaveis com conteudos
cHTMLFile31 := StrTran( cHTMLFile3 , "{#Observacao1#}", substr(M->OBS2,01,54) )
cHTMLFile31 := StrTran( cHTMLFile31, "{#Observacao2#}", substr(M->OBS2,55,54) )
cHTMLFile31 := StrTran( cHTMLFile31, "{#tt_SubTotal#}", TRANSF(M->SUBTOTAL,"@E 99,999.99") )
cHTMLFile31 := StrTran( cHTMLFile31, "{#tt_Desconto#}", TRANSF(M->DESCONTO,"@E 99,999.99") )
cHTMLFile31 := StrTran( cHTMLFile31, "{#tt_Total#}" , TRANSF((M->SUBTOTAL-M->DESCONTO),"@E 99,999.99") )
// Caso use 2 vias, promovo a separacao dos dois impressos
if l2Vias
cTracejado := [<table cellpadding="0" cellspacing="0" width="705" border="0">]
cTracejado := cTracejado + [<tr><td width="700" style="border: #444444; border-style: solid; border-width: 0px" align="center">]
cTracejado := cTracejado + [<p></p><p></p><p></p><p></p><p></p><p></p><p></p>]
cTracejado := cTracejado + [-<hr size="1" noshade="noshade"></hr>]
cTracejado := cTracejado + [<p></p>-]
cTracejado := cTracejado + [<p></p><p></p><p></p><p></p><p></p><p></p></td></tr></table>]
MemoWrit( cHTMLFile, cHTMLFile1 + cHTMLFile22 + cHTMLFile31 + cTracejado + cHTMLFile1 + cHTMLFile22 + cHTMLFile31 )
else
MemoWrit( cHTMLFile, cHTMLFile1 + cHTMLFile22 + cHTMLFile31 )
endif
// Nome do HTML que contem o impresso
cEndereco := cHTMLFile
// Chamada de função do Windows para apresentacao do impresso
// Pode se usar RUN( "START " + cEndereco )
ShellExecute(7, "open", cEndereco, , , 1)
SysRefresh()
//
dbSelectArea( "PN" )
OrdSetFocus( 1 )
return .t.
O codigo acima deve ser adaptado ao seu gosto e suas necessidades.
Abaixo apresento os templates que devem ser estudados e adaptados a sua necessidade.
Codigo do template de cabecalho:
<HTML>
<head>
<style>
.form-title {
background-color: #ffffff;
color: #141414;
font-weight: bold;
}
.form-field-caption {
font-style:italic;
}
.table-row {
background-color: #f1f3f7;
}
.table-head {
background-color: #bbbbbb;
}
</style>
</head>
<body>
<style type="text/css">
body,th,td,tt,p,div,span {
color: #000000;
font-family: tahoma, verdana, arial, sans-serif;
font-size: 11px;
}
p,ul {
margin-top: 6px;
margin-bottom: 6px;
}
.form-field-caption {
font-style:italic;
}
.form-title {
background-color: #ffffff;
color: #141414;
font-weight: bold;
}
</style>
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>
<td>
<img src="logo.gif" width="1" height="1" border="0" alt="" />
</td>
<td width="600" style="border: #444444; border-style: solid; border-width: 2px" align="center">
<table cellpadding="10" cellspacing="0" width="100%" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td valign="top"><p></p>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="top">
<img src="logo.gif" border="0" alt="5V-Cart.com" />
</td>
<td> </td>
<td valign="top" style="font-family: Verdana,Tahoma; font-size:10px">
<div style="font-family: Arial; font-size:14px"><b>{#empresa#}</b></div>
{#endereco#}<br />
{#cidade#}<br />
{#pais#}<br />
<b>Telefone</b>: {#telefone#}<br />
<b>Telefone 2</b>: {#fax#}<br />
<b>Web site</b>: {#website#}<br />
<b>E-mail</b>: <u>{#email#}</u><br />
</td>
</tr>
</table>
</td>
<td valign="top" align="right">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="top" style="font-family: Tahoma,Arial, Verdana,Tahoma; font-size:11px">
<div align="center" style="font-size:22px; font-family: Tahoma,Arial; text-transform: uppercase;" nowrap="nowrap"><b>{#impresso#}</b></div>
<b>Pedido:</b> {#idpedido#}<br />
<b>Status:</b> {#situacao#}<br />
<b>Data:</b> {#dataped#}<br />
<b>Método de pagamento:</b> {#idcondicao#}<br />
<b>Método de remessa:</b> {#identrega#}<br />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<!-- td valign="right" style="font-family: Code39; font-size:14px"><b>{#idpedido#}</b></td -->
<!-- td align="right" colspan="2"><img src='"file://C:\Meus Arquivos\eudora\Embedded\csimg21.png"' alt="BarCode" width="250" height="60" / -->
</tr>
</table>
<p></p>
<br />
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td valign="top" width="50%">
<table cellpadding="1" cellspacing="1" border="0" width="100%">
<tr>
<td colspan="2" class="form-title">Informação de contato<hr size="1" noshade="noshade" /></td>
</tr>
<tr>
<td class="form-field-caption" width="30%" nowrap="nowrap">Nome: </td>
<td>{#ClienteNome#}</td>
</tr>
<tr>
<td class="form-field-caption" width="30%" nowrap="nowrap">E-mail: </td>
<td>{#ClienteEmail#}</td>
</tr>
</table>
</td>
<td width="1%"> </td>
<td valign="top" width="49%">
<table cellpadding="1" cellspacing="1" border="0" width="100%">
<tr>
<td colspan="2" class="form-title"> <hr size="1" noshade="noshade" /></td>
</tr>
<tr>
<td class="form-field-caption" width="30%" nowrap="nowrap">Telefone: </td>
<td>{#ClienteTelefone#}</td>
</tr>
<tr>
<td class="form-field-caption" width="30%" nowrap="nowrap">Fax: </td>
<td>{#ClienteFax#}</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<p></p>
<table cellpadding="1" cellspacing="1" border="0" width="100%">
<tr>
<td colspan="2" class="form-title">Endereço de pagamento<hr size="1" noshade="noshade" /></td>
</tr>
<tr>
<td class="form-field-caption" width="30%" nowrap="nowrap">Endereço: </td>
<td>{#ClientePEndereco#}</td>
</tr>
<tr>
<td class="form-field-caption" width="30%" nowrap="nowrap">Cidade: </td>
<td>{#ClientePCidade#}</td>
</tr>
<tr>
<td class="form-field-caption" width="30%" nowrap="nowrap">Estado: </td>
<td>{#ClientePEstado#}</td>
</tr>
<tr>
<td class="form-field-caption" width="30%" nowrap="nowrap">CEP: </td>
<td>{#ClientePCep#}</td>
</tr>
</table>
</td>
<td> </td>
<td valign="top">
<p></p>
<table cellpadding="1" cellspacing="1" border="0" width="100%">
<tr>
<td colspan="2" class="form-title">Endereço de remessa<hr size="1" noshade="noshade" /></td>
</tr>
<tr>
<td class="form-field-caption" width="30%" nowrap="nowrap">Endereço: </td>
<td>{#ClienteREndereco#}</td>
</tr>
<tr>
<td class="form-field-caption" width="30%" nowrap="nowrap">Cidade: </td>
<td>{#ClienteRCidade#}</td>
</tr>
<tr>
<td class="form-field-caption" width="30%" nowrap="nowrap">Estado: </td>
<td>{#ClienteREstado#}</td>
</tr>
<tr>
<td class="form-field-caption" width="30%" nowrap="nowrap">CEP: </td>
<td>{#ClienteRCep#}</td>
</tr>
</table>
</td>
</tr>
</table>
<p></p><br />
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td valign="top">
<table cellpadding="2" cellspacing="1" border="0" width="100%" bgcolor="#000000">
<tr>
<td width="10%" align="center" bgcolor="#dddddd"><b>CODIGO</b></td>
<td width="50%" bgcolor="#dddddd"><b>Produto</b></td>
<td width="10%" bgcolor="#dddddd" nowrap="nowrap"><b>Medida</b></td>
<td width="10%" align="center" bgcolor="#dddddd"><b>Quantidade</b></td>
<td width="10%" align="center" bgcolor="#dddddd" nowrap="nowrap"><b>Unitario</b></td>
<td width="10%" align="center" bgcolor="#dddddd"><b>Desconto</b></td>
<td width="10%" align="center" bgcolor="#dddddd"><b>Subtotal</b></td>
</tr>
Codigo do template de corpo:
<tr>
<td bgcolor="#ffffff">{#Resumido#}</td>
<td bgcolor="#ffffff">{#Descricao#}</td>
<td bgcolor="#ffffff"> {#Medida#}</td>
<td bgcolor="#ffffff" align="center">{#Quantidade#}</td>
<td bgcolor="#ffffff" align="right">R$ {#Unitario#}</td>
<td bgcolor="#ffffff" align="right">R$ {#Desconto#}</td>
<td align="right" bgcolor="#ffffff"><b>R$ {#SubTotal#}</b> </td>
</tr>
Codigo do template de rodape:
</table>
</td>
</tr>
</table>
<div align="right">
<table>
<tr>
<td align="right" nowrap="nowrap"><b>Subtotal:</b> </td>
<td align="right" nowrap="nowrap">R$ {#tt_SubTotal#}</td>
</tr>
<tr>
<td nowrap="nowrap" align="right"><b>Desconto incluso:</b> </td>
<td nowrap="nowrap" align="right">
R$ {#tt_Desconto#}</td>
</tr>
<!-- tr>
<td align="right" nowrap="nowrap"><b>Custo de remessa:</b> </td>
<td align="right" nowrap="nowrap">R$ {#tt_Frete#}</td>
</tr -->
<tr>
<td colspan="2"><div style="border: solid #444444 0px;border-bottom-width: 2px;padding-top:2px"><img src="logo.gif" width="1" height="1" border="0" alt="" /></div></td>
</tr>
<tr>
<td align="right" nowrap="nowrap"><b>Custo Total:</b> </td>
<td align="right" nowrap="nowrap">R$ {#tt_Total#}</td>
</tr>
</table><br />
</div>
</td>
</tr>
</table>
</td>
<td>
<img src="logo.gif" width="1" height="1" border="0" alt="" /></td>
</tr>
</table>
</body>
</html>
Complementando voce pode usar o código na postagem
PEROLA: Clipper Puro manipulando arquivos .INI para manipular arquivos
.INI.
Separei o tópico
Super seleção de dados com ordenação dos registros para agregar idéias que voce pode usar em suas filtragens.