Can JSP using apachi POI handle the very complicated JSP?

Ads
 

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.

Ads









Related Tutorials/Questions & Answers:
Can JSP using apachi POI handle the very complicated JSP?
JSP1
Advertisements
JSP2
can any one give the frogort password code using jsp,
JSP handle run-time exceptions
Error in reading Excel data using jsp even having .xls and POI Library in respective folders
How to read a rows which have a values in a excel file using apache poi - JSP-Servlet
ModuleNotFoundError: No module named 'jspp'
ModuleNotFoundError: No module named 'JSPy'
User Registration Form Using JSP(JspBeans) after that how i can insert in database
Need to remove duplicated rows from excel using apache POI API
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.
How to handle Transaction IN and OUT in Inventory using java
insert checkbox in cell using POI api in java
In JSP page, inside a javascript function, can I place a java code using scriptlet tag?
JSps - JSP-Interview Questions
displaying List of records from database in a jsp using ajax, onclick it should display the results ?? its urgent can u help me
ScatterPlot using jsp
ModuleNotFoundError: No module named 'complicated'
Is JSF using JSP?
How can you handle form in Spring 3.2 MVC?
JSPs : Declarations
tree using jsp code
Identify Excel's cell data type
BMI by using JSP Languange
BMI by using JSP Languange
video uploading using jsp
A Java Program by using JSP
Jsp using mvc - JSP-Servlet
Very urgent Image Selection - JSP-Servlet
Tiemsheet using jsp

Ads