Can JSP using apachi POI handle the very complicated JSP?

Can JSP using apachi POI handle the very complicated JSP?

Can the following jsp handle the very complicated excel: such as, multiple sheet,

tree structure, with chart in the excell file, etc.

<%@page import="java.io.*"%>
<%@page import="java.util.*"%>
<%@page import="org.apache.poi.xssf.usermodel.XSSFSheet"%>
<%@page import="org.apache.poi.xssf.usermodel.XSSFWorkbook"%>
<%@page import="org.apache.poi.xssf.usermodel.XSSFRow"%>
<%@page import="org.apache.poi.xssf.usermodel.XSSFCell"%>
<table border="1">
<%  
    short a=0;  
    short b=1;  
    short c=2;  
    short d=3;  
    int i=0;    
        String   value1="", value2="",value3=" ", value4="";    
        String filename ="C:/hello.xls";     
        if(filename != null && !filename.equals("")){
        try{    
        FileInputStream fs =new FileInputStream(filename);    
        XSSFWorkbook wb = new XSSFWorkbook(fs);   
        for(int k = 0; k < wb.getNumberOfSheets(); k++){    
         int j=i+1;    
         XSSFSheet sheet = wb.getSheetAt(k);    
         int rows  = sheet.getPhysicalNumberOfRows();    
         for(int r = 0; r < rows; r++){    
         XSSFRow row   = sheet.getRow(r);    
         int cells = row.getPhysicalNumberOfCells();    
         out.write("<br>");    
            XSSFCell cell1  = row.getCell(a);      
            value1 = cell1.getStringCellValue();   
            XSSFCell cell2  = row.getCell(b);     
            value2 = cell2.getStringCellValue();    
            XSSFCell cell3  = row.getCell(c);      
            value3 = cell3.getStringCellValue();    
            XSSFCell cell4  = row.getCell(d);     
            value4 = cell4.getStringCellValue();    
%>    
<tr><td><%=value1%></td><td><%=value2%></td><td><%=value3%></td><td><%=value4%></td></tr>    
<%    
}       
 i++;   
}    
}catch(Exception e){  
  System.out.println(e);   
 }   
 }   
 %>    
</table>
View Answers

May 19, 2011 at 1:32 PM

Mostly it can solved.









Related Tutorials/Questions & Answers:
Can JSP using apachi POI handle the very complicated JSP?
JSP1
Advertisements
JSP2
Handle mail function using JSP & Servlet
JSP handle runtime exceptions
ModuleNotFoundError: No module named 'jspp'
ModuleNotFoundError: No module named 'JSPy'
Using POI - Date Calendar
JSP handle run-time exceptions
Error in reading Excel data using jsp even having .xls and POI Library in respective folders
Html/JavaScript code - JSP-Servlet
Apache POI Excel Maximum Row - JSP-Servlet
How to read a rows which have a values in a excel file using apache poi - JSP-Servlet
Very Very Urgent -Image - JSP-Servlet
Help Very Very Urgent - JSP-Servlet
JSP and AJAX very urgent - Ajax
Pop up Very Very Urgent - JSP-Servlet
can any one give the frogort password code using jsp,
How to handle Transaction IN and OUT in Inventory using java
Using poi hwpf,how to create table in word document. - Java Beginners
How i can send mail by using jsp.............. - JavaMail
JSP and AJAX- very urgent - Ajax
Program Very Urgent.. - JSP-Servlet
Excel Created using POI and HSSF - Development process
insert checkbox in cell using POI api in java
ModuleNotFoundError: No module named 'complicated'
JSps - JSP-Interview Questions
JSP,JDBC and HTML(Very Urgent) - JSP-Servlet
Using MYSQL Database with JSP & Servlets.
Need to remove duplicated rows from excel using apache POI API
How to set background of an excel sheet using POI - Java Magazine
JSPs : Declarations
Basic problem but very urgent - JSP-Servlet
User Registration Form Using JSP(JspBeans) after that how i can insert in database
Programming help Very Urgent - JSP-Servlet
Radio Buttons in DB Very Urgent - JSP-Servlet
versions of servlets and JSPs?
Popup very urgent plz - JSP-Servlet
Simple Program Very Urgent.. - JSP-Servlet
Edit word document Headers and Footers using POI Library in java?
Validating Number Very Urgent - JSP-Servlet
How to hide text in Word Document using Apache POI library
How to handle the text using Key Listener Interface
Very urgent Image Selection - JSP-Servlet
Simple problem Very Urgent - JSP-Servlet
How can you handle form in Spring 3.2 MVC?
Is JSF using JSP?
How can I access databse through JSP. I am using postgresql-8.4.4-1-windows as database and jboss-4.0.5.GA as server.
JSPs : Directives
ScatterPlot using jsp

Ads