
How to present the content of the newly created excel file in the following jsp to the web browser:
print("code sample");
<%@ page import="java.io.InputStream" %>
<%@ page import="org.apache.poi.xssf.usermodel.XSSFSheet"%>
<%@ page import="org.apache.poi.xssf.usermodel.XSSFWorkbook"%>
<%@ page contentType="application/vnd.ms-excel" %>
<%@ page import="java.io.*" %>
<%
try {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet1 = wb.createSheet("TA");
XSSFSheet sheet2 = wb.createSheet("TM");
XSSFSheet sheet3 = wb.createSheet("XFA");
XSSFSheet sheet4 = wb.createSheet("OTHERS");
FileOutputStream fileOut = new FileOutputStream
("c:\\excel\\aqtemplate.xlsx");
wb.write(fileOut);
fileOut.close();
} catch ( Exception ex ) {
}
%>
print("code sample");
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.