File tree Expand file tree Collapse file tree 4 files changed +57
-2
lines changed Expand file tree Collapse file tree 4 files changed +57
-2
lines changed Original file line number Diff line number Diff line change 198
198
/ScriptletsJSP /target /
199
199
/DeclaracionesJSP /target /
200
200
/DocumentosJSP /target /
201
+ /ExcelJSP /target /
Original file line number Diff line number Diff line change
1
+ package utilerias ;
2
+
3
+ import java .text .SimpleDateFormat ;
4
+ import java .util .Date ;
5
+
6
+ public class Conversiones {
7
+ private static final String FORMATO_FECHA = "dd-MM" ;
8
+
9
+ public static String format (Date fecha ){
10
+ SimpleDateFormat formateador = new SimpleDateFormat (FORMATO_FECHA );
11
+ return formateador .format (fecha );
12
+ }
13
+ }
Original file line number Diff line number Diff line change 1
1
<!DOCTYPE html>
2
2
< html >
3
3
< head >
4
- < title > Start Page </ title >
4
+ < title > Generacion de Reposrte Excel </ title >
5
5
< meta http-equiv ="Content-Type " content ="text/html; charset=UTF-8 ">
6
6
</ head >
7
7
< body >
8
- < h1 > Hello World!</ h1 >
8
+ < h1 > Generacion de Reposrte Excel</ h1 >
9
+ < br /> <!-- comment -->
10
+ < a href ="reporteExcel.jsp "> Link al reporte de Excel</ a >
11
+
9
12
</ body >
10
13
</ html >
Original file line number Diff line number Diff line change
1
+ <%@page import =" utilerias.Conversiones, java.util.Date" %>
2
+ <%@page contentType =" aplication/vnd.ms-excel" %>
3
+ <%
4
+ String nombreArchivo = " reporte.xls" ;
5
+ response. setHeader(" Content-Disposition" , " attachment;filename" + nombreArchivo);
6
+
7
+ % >
8
+
9
+ <!DOCTYPE html>
10
+ <html >
11
+ <head >
12
+ <title >Reporte de Excel</title >
13
+ </head >
14
+ <body >
15
+ <h1 >Reporte de Excel</h1 >
16
+ <table border =" 1" >
17
+ <tr >
18
+ <th >CURSO</th >
19
+ <th >DESCRIPCION</th >
20
+ <th >FECHA</th >
21
+ </tr >
22
+ <tr >
23
+ <th >1. Fundamento de Java </th >
24
+ <th >Aprenderemos la sitaxis basica de Java</th >
25
+ <th ><%= Conversiones . format(new Date ()) % > </th >
26
+ </tr >
27
+
28
+ <tr >
29
+ <th >2. Fundamento con Java </th >
30
+ <th >Pondemos en pranctica conceptos de la programacion POO</th >
31
+ <th ><%= Conversiones . format(new Date ()) % > </th >
32
+ </tr >
33
+
34
+
35
+
36
+ </table >
37
+ </body >
38
+ </html >
You can’t perform that action at this time.
0 commit comments