@@ -1973,17 +1973,17 @@ public class HomePage extends AbstractExcelView {
1973
1973
1974
1974
// Go to the first sheet
1975
1975
// getSheetAt: only if wb is created from an existing document
1976
- //sheet = wb.getSheetAt( 0 );
1976
+ // sheet = wb.getSheetAt(0 );
1977
1977
sheet = wb.createSheet("Spring");
1978
- sheet.setDefaultColumnWidth((short)12);
1978
+ sheet.setDefaultColumnWidth((short) 12);
1979
1979
1980
1980
// write a text at A1
1981
- cell = getCell( sheet, 0, 0 );
1982
- setText(cell,"Spring-Excel test");
1981
+ cell = getCell(sheet, 0, 0);
1982
+ setText(cell, "Spring-Excel test");
1983
1983
1984
- List words = (List ) model.get("wordList");
1984
+ List words = (List) model.get("wordList");
1985
1985
for (int i=0; i < words.size(); i++) {
1986
- cell = getCell( sheet, 2+i, 0 );
1986
+ cell = getCell(sheet, 2+i, 0);
1987
1987
setText(cell, (String) words.get(i));
1988
1988
1989
1989
}
@@ -1997,21 +1997,21 @@ public class HomePage extends AbstractExcelView {
1997
1997
1998
1998
// imports omitted for brevity
1999
1999
2000
- public class HomePage extends AbstractExcelView {
2000
+ public class HomePage extends AbstractJExcelView {
2001
2001
2002
2002
protected void buildExcelDocument(Map model,
2003
2003
WritableWorkbook wb,
2004
2004
HttpServletRequest request,
2005
2005
HttpServletResponse response)
2006
2006
throws Exception {
2007
2007
2008
- WritableSheet sheet = wb.createSheet("Spring");
2008
+ WritableSheet sheet = wb.createSheet("Spring", 0 );
2009
2009
2010
- sheet.addCell(new Label(0, 0, "Spring-Excel test");
2010
+ sheet.addCell(new Label(0, 0, "Spring-Excel test")) ;
2011
2011
2012
- List words = (List)model.get("wordList");
2013
- for (int i = - ; i < words.size(); i++) {
2014
- sheet.addCell(new Label(2+i, 0, (String)words.get(i));
2012
+ List words = (List) model.get("wordList");
2013
+ for (int i = 0 ; i < words.size(); i++) {
2014
+ sheet.addCell(new Label(2+i, 0, (String) words.get(i) ));
2015
2015
}
2016
2016
}
2017
2017
}</programlisting >
0 commit comments