//creacion de la funcion
<%
String exportToExcel = request.getParameter("exportToExcel");
if (exportToExcel != null
&& exportToExcel.toString().equalsIgnoreCase("YES")) {
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "inline; filename="
+ "MyFile.xls");
}
%>
//boton que llama la funcion y nos exporta a excel
<%@ page import="java.io.*,java.util.*,java.net.*,java.sql.*" %>
<center>
<%
if (exportToExcel == null) {
%>
<a href="index.jsp?exportToExcel=YES">Exportar a Excel</a>
<%
}
%>
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.