Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet retrieving excel data when file uploading
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


subha
retrieving excel data when file uploading
0 Answer(s)      2 years and 5 months ago
Posted in : JSP-Servlet


<%@page import="java.io.*"%>
<%@page import="java.util.*"%>
<%@page import="org.apache.poi.hssf.usermodel.HSSFSheet"%>
<%@page import="org.apache.poi.hssf.usermodel.HSSFWorkbook"%>
<%@page import="org.apache.poi.hssf.usermodel.HSSFRow"%>
<%@page import="org.apache.poi.hssf.usermodel.HSSFCell"%>


<%
 short a=0;
  short b=1;
  short c=2;
  short d=3;
  int i=0;
   String   value1="", value2="",value3=" ", value4="";
   //String filename ="C:\\Users\\hp\\Desktop\\Book1.xls";
   String filename=request.getParameter("excel");

    if (filename != null && !filename.equals("")) {
    try{
    FileInputStream fs =new FileInputStream(filename);
    HSSFWorkbook wb = new HSSFWorkbook(fs);
       HSSFSheet sheet = wb.getSheetAt(0);
    int rows  = sheet.getPhysicalNumberOfRows();
    out.println(rows);
    for (int r = 0; r < rows; r++){
    HSSFRow row   = sheet.getRow(r);
    HSSFCell cell1  = row.getCell(0);

      value1 = cell1.getStringCellValue();
      out.println(value1);


    }
    }
    catch(Exception e){
    System.out.println(e); 
    }
    }
    %>

when i gave full path name i got excel data but when file uploading not getting the excel data


Advertisement
View Answers

Related Tutorials/Questions & Answers:
retrieving excel data when file uploading
retrieving excel data when file uploading  <%@page import...); } } %> when i gave full path name i got excel data but when file uploading not getting the excel data
Retrieving specific data from excel
Retrieving specific data from excel  Hello everyone, i have written a simple code to retrieve data from excel sheet and working fine, the excel file... to be printed. here is my sample code try { FileInputStream file = new
Advertisements
retrieving of value from excel file - JSP-Servlet
this message to all the employees when i upload a file then it fetch a data from...retrieving of value from excel file  Dear sir, Thanks for sending... file so please help me how to take a parameter after uploading a file... Thanks
retrieving of value from excel file - JSP-Servlet
this message to all the employees when i upload a file then it fetch a data from...retrieving of value from excel file  Dear sir, Thanks for sending... file so please help me how to take a parameter after uploading a file
jsp with excel sheet data uploading into database
jsp with excel sheet data uploading into database  how to upload data in excel sheet with jsp into oracle 10g database
uploading and reading the excel daa
uploading and reading the excel daa  uploading the excel file not getting the data of the excel
Uploading Excel sheet record in JSP to insert data in MySql
Uploading Excel sheet record in JSP to insert data in MySql  Need Help how to upload Excel (.xls) file and insert data in Mysql using JSP it wil be wonder for me if any help me
excel uploading in jsp
excel uploading in jsp  could you provide the source code for: 1)have to upload an empty excel sheet at client side i.e if client clicks an excel icon an empty excel sheet should open 2)when they fill data in that sheet and click
retrieving of value from excel file - JSP-Servlet
retrieving of value from excel file  Dear sir, Thanks for sending a code now i am getting a particular column value i.e EmailId column... to all the employees that are in the excel sheet.So in the previous code i have got
Exception when opening a excel file in JFrame
Exception when opening a excel file in JFrame  Hello, I have a problem when trying to display a Excel file in a Jframe. The exception is like this: com.jniwrapper.LibraryNotFoundException. here is my code public jexcelTest1
JavaScript get excel file data
JavaScript get excel file data...; By the use of JavaScript we can get the excel file data as well. Here is the example which gets the data from the excel file with the cell and row index
how to make a radiobutton selected when retrieving data from database using struts framework and spring jdbc
how to make a radiobutton selected when retrieving data from database using struts framework and spring jdbc  how to make a radio button selected when retrieving data from database using struts framework and spring jdbc
connection of java file to excel file and put data from excel file into oracle db
connection of java file to excel file and put data from excel file into oracle... give action to that button excel sheet? how we connect excel file to java file as wellas to oracle db to insert excel data into database
Inserting data in Excel File - Java Beginners
Inserting data in Excel File  Dear Sir, How can we fill the excel with fetched data from the database like Oracle, DB2? Is it possible to create an excel with filled data? Kindly give me the solutions to questions
How to open excel sheet when excel file is placed in some folder in desktop
How to open excel sheet when excel file is placed in some folder in desktop  How to open an excel sheet using windows.open in IE... I am getting an error msg that the path is not correct.. But i have specified the correct path
reading data from excel file and plotting graph
reading data from excel file and plotting graph  I am doing a project... the data in excel file, i have to plot graphs based on CELL ID selected. please help... that reads an excel file using POI api and using the data of excel file
uploading a file
uploading a file  When I am trying to upload a file to another system in lan at a location "http://192.168.12.5:8080/tomcat-docs/myapps",then it is giving the following error message "http://192.168.12.5:8080/tomcat-docs/myapps
How to export data from html file to excel sheet by using java
How to export data from html file to excel sheet by using java    How to export data from html file to excel sheet by using java
Excel File data upload into postgresql database in struts 1.x
Excel File data upload into postgresql database in struts 1.x  Dear members please explain how Excel Files data upload into postgresql database in struts 1.x
Read data from excel file and update database using jsp
Read data from excel file and update database using jsp  read data from excel file and update database using jsp Hi, I am using a MySQL database for scientific research analysis. My team members sends research data in excel file
How to export data from html file to excel sheet by using java
How to export data from html file to excel sheet by using java   reading the data from Html file
uploading audio file iphone
uploading audio file iphone  uploading audio file iphone
How to Retrieve Data from the database and write into excel file using Java
How to Retrieve Data from the database and write into excel file using Java  Hi, I am trying to develop an small application where i trying to retrieve Data from the database and store the details in excel file. Please can
file uploading
file uploading  How to upload music files onto the server and save the file information to the mysql database fetch and play the music files on a display page without download thus streaming the files
How to import data from sql server table into an excel file by creating the rows dynamically in the excel according to the dataabase??
How to import data from sql server table into an excel file by creating... data from sql server table into an excel file by creating the rows dynamically... to create an excel file according to that and keep updating the same
Struts file uploading - Struts
Struts file uploading   Hi all, My application I am uploading... can again download the same file in future. It is working fine when I upload the file with nominal size like 1 mb. But this functionality is breaking when
convert excel file data into different locales while converting exclile file to csv file
convert excel file data into different locales while converting exclile file to csv file   can any one provide the code for how to convert excel file data into different locales while converting exclile file to csv file
Uploading a file using UploadBean
Uploading a file using UploadBean  Dear sir, In my project i have to upload the file and use the same file for getting a values from that uploaded .xls file.I used UploadBean for uploading .For the first time when i
Retrieve Data from the database and write into excel file
Retrieve Data from the database and write into excel file. In this section, we are going to retrieve data from the database and write into the excel file...); fileOut.close(); System.out.println("Data is saved in excel file
retrieving query data
retrieving query data   Blockquote I am new to java or hibernate... Trying to get data from database...it does not pick up the data... even though the User table has data   Please go through the following
Uploading File on Server
Uploading File on Server  Hello, Can someone explain or suggest example. How do i uploading files on the FTP Server. Thanks
Advertisements
 

 

 

DMCA.com