
the following program will create the test.xlsx file, how can i display the content of the test.xlsx file in the web browser?
thanks,
%@ 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("TwA");
XSSFSheet sheet2 = wb.createSheet("TwM");
XSSFSheet sheet3 = wb.createSheet("XwFA");
XSSFSheet sheet4 = wb.createSheet("OTHERS");
FileOutputStream fileOut = new FileOutputStream
("c:\\excel\\test.xlsx");
wb.write(fileOut);
fileOut.close();
} catch ( Exception ex ) {
}
%>
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.