ASP - Necesito generar con ASP un archivo excel con mult

 
Vista:

Necesito generar con ASP un archivo excel con mult

Publicado por luis jara (1 intervención) el 07/09/2006 16:14:45
Necesito generar con ASP un archivo excel con multiples hojas, hasta el momento genero el archivo excel con multiples hojas pero sólo genero datos en una sóla hoja. ¿Cómo puede generar datos en todas las hojas?

Tengo el siguiente código:

<%
sFileName = "temporary.xls"
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "filename=" & sFileName
Dim sSpreadsheet
sSpreadsheet = "Interago export"
Response.Write "<html xmlns:x=""urn:schemas-microsoft-com:office:excel"">"
Response.Write "<head>"
Response.Write "<!--[if gte mso 9]><xml>"
Response.Write "<x:ExcelWorkbook>"
' Primera Hoja
Response.Write "<x:ExcelWorksheets>"
Response.Write "<x:ExcelWorksheet>"
Response.Write "<x:Name>" & sSpreadsheet & "1</x:Name>"
Response.Write "<x:WorksheetOptions>"
Response.Write "<x:Print>"
Response.Write "<x:ValidPrinterInfo/>"
Response.Write "</x:Print>"
Response.Write "</x:WorksheetOptions>"
Response.Write "</x:ExcelWorksheet>"

' Segunda Hoja
Dim sSsheet
sSsheet = "excel3.htm"
Response.Write "<x:ExcelWorksheet>"
Response.Write "<x:Name>" & sSpreadsheet & "2</x:Name>" Response.write "<x:WorksheetSource HRef=" & sSsheet & "/>"
Response.Write "<x:WorksheetOptions>"
Response.Write "<x:Print>"
Response.Write "<x:ValidPrinterInfo/>"
Response.Write "</x:Print>"
Response.Write "</x:WorksheetOptions>"
Response.Write "</x:ExcelWorksheet>"
' Tercera hoja
sSsheet = "excel4.htm"
Response.Write "<x:ExcelWorksheet>"
Response.Write "<x:Name>" & sSpreadsheet & "3</x:Name>"
Response.write "<x:WorksheetSource HRef=" & sSsheet & "/>"
Response.Write "<x:WorksheetOptions>"
Response.Write "<x:Print>"
Response.Write "<x:ValidPrinterInfo/>"
Response.Write "</x:Print>"
Response.Write "</x:WorksheetOptions>"
Response.Write "</x:ExcelWorksheet>"

Response.Write "</x:ExcelWorksheets>"
Response.Write "</x:ExcelWorkbook>"
Response.Write "</xml>"
Response.Write "<![endif]--> "
response.write "<style>"
response.write ".textclass{mso-number-format:\@;}"
response.write "</style>"
Response.Write "</head>"
Response.Write "<body>"

sPrint = "<table>"
For I=1 TO 10
sPrint = sPrint & "<tr>"
sPrint = sPrint & "<td><strong>jara " & I & "</strong></td>"
sPrint = sPrint & "</tr>"
Next

sPrint = "</table>"
response.write "</body></html>"

%>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Necesito generar con ASP un archivo excel con mult

Publicado por Sara (1 intervención) el 25/01/2017 09:47:12
Sé que es un post de hace mucho tiempo, pero me gustaría saber si conseguiste escribir en las dos hojas del libro Excel porque yo tengo el mismo problema que tú. ¿Cómo lo hiciste?

Muchas gracias y un saludo,
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar