Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

rafaeldupalio

formatação xls em asp

Recommended Posts

Galera uso o DW+asp+access, hoje tenho uma pagina que exporta uma consulta para o excel até ae normal o problema é colocar no layout da empresa que trabalho!
existe alguma maneira de fazer esse processo automatizado? ja tenho a planilha em excel criada tentei fazer pelo dreamweaver ficou uma M... bem grande segue o codigo no DW:

 

<%
VAR_STATUS=("DEV")
Response.ContentType="application/vnd.ms-excel"
response.AddHeader "content-disposition", "inline; filename=Devolução.xls"
vSql = "SELECT * FROM TAB_QUADRO_BRASFELS WHERE STATUS='"&vAR_STATUS&"' ORDER BY CT,CODIGO ASC"
Set myRst = Server.CreateObject("ADODB.Recordset")
myRst.Open vSql, conn, 3, 3
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sem título</title>
<style type="text/css">
.Texto_saída {
font-size: 10px;
text-align: center;
font-family: Calibri;
}
.Calibri12 {
font-family: Calibri;
font-weight: bold;
font-size: 16px;
}
.CALIBRI_ESQUERDA_12 {
font-family: Calibri;
text-align: left;
font-size: 11px;
}
.CALIBRI_12_ESQUERDA_SIMPLES {
font-family: Calibri;
font-size: 11px;
font-weight: bold;
}
.CALIBRI_ESQUERDA_12 .CALIBRI_12_ESQUERDA_SIMPLES .CALIBRI_12_ESQUERDA_SIMPLES {
font-weight: normal;
}
.CALIBRI_12_ESQUERDA_SIMPLES {
font-family: Calibri;
}
.NEGRIYO {
font-weight: bold;
}
.RED {
color: #F00;
font-family: Calibri;
font-size: 12px;
font-weight: bold;
text-align: center;
}
.CALIBRI12NEGRITO {
font-family: Calibri;
font-size: 12px;
font-weight: bold;
color: #000;
text-align: center;
}
.CENTRALIZAR {
text-align: center;
}
.NO-NEGRITO {
font-weight: normal;
}
.CALIBRI12NEGRITO {
text-align: center;
}
.CALIBRI12NEGRITO .CALIBRI12NEGRITO {
text-align: center;
}
</style>
</head>
<body>
<table width="100%" border="1" align="center">
<tr>
<td width="800" height="679" align="center" valign="top"><table width="100%" border="1">
<br />
<tr>
<td height="17" colspan="9" class="CALIBRI_ESQUERDA_12"><table width="100%" border="1" align="left" cellpadding="0">
<tr>
<th width="23%" rowspan="2" scope="col"> </th>
<th width="58%" height="69" class="Calibri12" scope="col">AUTORIZAÇÃO PARA EMISSÃO DE NOTA FISCAL</th>
<th width="12%" scope="col"> </th>
<th width="7%" valign="bottom" class="Texto_saída" scope="col">AENF</th>
</tr>
<tr>
<th height="21" class="Texto_saída" scope="col">Contrato: CL069/08</th>
<th class="Texto_saída" scope="col">Data</th>
<th scope="col"> </th>
</tr>
</table></td>
</tr>
<tr>
<th colspan="9" class="CALIBRI_ESQUERDA_12" scope="col">PARA: SETOR FISCAL</th>
</tr>
<tr>
<td colspan="9" class="CALIBRI_ESQUERDA_12">DE: BRASFELS</td>
</tr>
<tr>
<td width="13%" class="CALIBRI_12_ESQUERDA_SIMPLES"><span class="NEGRIYO">DATA DE EMISSÃO:</span></td>
<td colspan="2" class="CALIBRI_ESQUERDA_12"> </td>
<td colspan="6" class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">MEIO DE TRANSPORTE:</span></td>
</tr>
<tr>
<td colspan="9" class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">NATUREZA DA OPERAÇÃO:</span></td>
</tr>
<tr>
<td class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">DESTINATÁRIO:</span></td>
<td colspan="8" class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">CYDER TECNOLOGIA LTDA</span></td>
</tr>
<tr>
<td class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">ENDEREÇO:</span></td>
<td width="22%" align="left" valign="middle" class="CALIBRI_12_ESQUERDA_SIMPLES"><span class="NEGRIYO">RUA PROFESSORA ESTER DE MELO - BENFICA</span></td>
<td width="7%" align="left" valign="middle" class="CALIBRI_12_ESQUERDA_SIMPLES"><span class="NEGRIYO">NUMERO:</span></td>
<td colspan="6" class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">74 </span></td>
</tr>
<tr>
<td class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">MUNICÍPIO</span></td>
<td class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">RIO DE JANEIRO</span></td>
<td class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">ESTADO:</span></td>
<td colspan="6" class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">RJ</span></td>
</tr>
<tr>
<td class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">TELEFONE:</span></td>
<td class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">(21)3860-6115</span></td>
<td class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">CEP:</span></td>
<td colspan="6" class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">20930-010</span></td>
</tr>
<tr>
<td height="17" class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">EMAIL:</span></td>
<td colspan="8" class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">SECRETARIA@CYDER.COM.BR</span></td>
</tr>
<tr>
<td height="17" class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">INSC. CNPJ:</span></td>
<td colspan="2" class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">00.726.628/0001-79</span></td>
<td width="10%" class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">INSC.EST.:</span></td>
<td width="48%" class="CALIBRI_ESQUERDA_12"> </td>
<td width="48%" colspan="4" class="CALIBRI_ESQUERDA_12"><span class="NEGRIYO">85.599.216</span></td>
</tr>
<tr>
<td height="17" colspan="9" class="CALIBRI_ESQUERDA_12"><span class="CALIBRI12NEGRITO">DESCRIÇÃO DAS MERCADORIAS</span></td>
</tr>
<tr>
<td height="17" class="CALIBRI_ESQUERDA_12">.<span class="CENTRALIZAR"><span class="CALIBRI12NEGRITO">QT.</span></span></td>
<td colspan="2" class="CALIBRI_ESQUERDA_12"><span class="CENTRALIZAR"><span class="CALIBRI12NEGRITO">UND.</span></span></td>
<td class="CALIBRI_ESQUERDA_12"><span class="RED"><span class="CALIBRI12NEGRITO">CÓD</span></span></td>
<td class="CALIBRI_ESQUERDA_12"><span class="RED">MATERIAL OU EQUIPAMENTO</span></td>
<td class="CALIBRI_ESQUERDA_12"><span class="RED">Nº CT</span></td>
<td class="CALIBRI_ESQUERDA_12"><span class="RED">Nº NOTA FISCAL</span></td>
<td class="CALIBRI_ESQUERDA_12"><span style="text-align: center"><span class="CALIBRI12NEGRITO">UNITÁRIO</span></span></td>
<td class="CALIBRI_ESQUERDA_12"><span class="CALIBRI12NEGRITO" style="text-align: center">TOTAL</span></td>
</tr>
<%
do while not myRst.EOF
var_codigo = myRst.fields("codigo")
var_ct = myRst.fields("CT")
var_Descricao = myrst.fields("Descricao")
var_Nfiscal = myrst.fields("Nfiscal")
var_Vunitario = myrst.fields("Valor_uni")
var_QNT = ("1")
var_UND =("UND")
%>
<tr>
<td height="17" class="CALIBRI_ESQUERDA_12"><%=var_QNT%></td>
<td colspan="2" class="CALIBRI_ESQUERDA_12"><%=var_UND%></td>
<td class="CALIBRI_ESQUERDA_12"> </td>
<td class="CALIBRI_ESQUERDA_12"><%=var_DESCRICAO%></td>
<td class="CALIBRI_ESQUERDA_12"><%=var_ct%></td>
<td class="CALIBRI_ESQUERDA_12"><%=var_NFISCAL%></td>
<td class="CALIBRI_ESQUERDA_12"><%=var_VUNITARIO%></td>
<td class="CALIBRI_ESQUERDA_12"><%=var_VUNITARIO%></td>
<td align="center" valign="middle"><table width="100%" border="1">
</tr></TD>
</table>
<% myRst.MoveNext
loop
%>
<tr>
<th colspan="3" class="CALIBRI12NEGRITO" scope="col">OBSERVAÇÃO: MATERIAL DE VOSSA PROPRIEDADE QUE ORA SEGUE POR TÉRMINO DE LOCAÇÃO, CONFORME NF. FAVOR INFORMAR OS CTS NA NOTA FISCAL.</th>
</tr>
<tr>
<td width="51%" class="CALIBRI12NEGRITO"> </td>
<td width="32%" class="CALIBRI12NEGRITO">VALOR TOTAL DESTA NOTA FISCAL R$</td>
<td width="17%" class="CALIBRI12NEGRITO"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="2" class="CALIBRI12NEGRITO"><span class="CALIBRI12NEGRITO">TRANSPORTADOR: PRÓPRIO</span></td>
<td><span class="CALIBRI12NEGRITO">ENDEREÇO:</span></td>
</tr>
<tr>
<td colspan="2" class="CALIBRI12NEGRITO"><span class="CALIBRI12NEGRITO">VEÍCULO: MASTER-FURGÃO</span></td>
<td align="left" class="CALIBRI12NEGRITO"><span class="CALIBRI12NEGRITO">PLACA: KXI4920</span></td>
</tr>
<tr>
<td colspan="3" align="center"><span class="CALIBRI12NEGRITO">CARACTERÍSTICA DOS VOLUMES</span></td>
</tr>
</table>
<table width="100%" border="1">
<tr class="CALIBRI12NEGRITO">
<th scope="col">NÚMERO</th>
<th scope="col">QTD.</th>
<th scope="col">ESPÉCIE</th>
<th scope="col">LÍQUIDO</th>
<th scope="col">BRUTO</th>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<table width="100%" border="1">
<tr class="CALIBRI12NEGRITO">
<th scope="col">SOLICITANTE</th>
<th scope="col">CARIMBO</th>
<th scope="col">APROVAÇÃO DO SECTION MANAGER</th>
<th scope="col">CARIMBO</th>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

vc pode usar um componente tipo o OWC, e gerar como se fosse o excel.

Compartilhar este post


Link para o post
Compartilhar em outros sites

isso. geralmente este componente é comum para vários host

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.