import file

import file

public void importFile(BlobDomain fileData) { InputStream inStr = fileData.getInputStream(); Workbook workbook = Workbook.getWorkbook(inStr); Sheet sheet = workbook.getSheet(0); int colCount = sheet.getColumns(); int rowCount = sheet.getRows(); Cell a,b,c,d,e,f,g,h; LabelCell lc; NumberCell nc; for (int r=1; r < rowCount; r++) { h = sheet.getCell(0,r); a = sheet.getCell(1,r); g = sheet.getCell(4,r); b = sheet.getCell(6,r); c = sheet.getCell(7,r); d = sheet.getCell(8,r); e = sheet.getCell(9,r); f = sheet.getCell(11,r);

if (h.getType() == CellType.LABEL)
{
lc = (LabelCell) h;
trxId = new Number(lc.getString().trim());
} else if (h.getType() == CellType.NUMBER) 
{
nc = (NumberCell) h;
trxId = new Number(nc.getValue());
}

} }

View Answers

February 29, 2012 at 12:03 PM

Please visit the following links:

http://www.roseindia.net/tutorial/java/poi/readExcelFile.html

http://www.roseindia.net/answers/viewqa/JSP-Servlet/9741-read-excel-data-from-jsp.html

You need POI library.

Download zip file from the following link:

http://download.nextag.com/apache/poi/release/bin/

Then put the poi-3.2-FINAL-20081019.jar,poi-contrib-3.2-FINAL-20081019.jar and poi-scratchpad-3.2-FINAL-20081019.jar files into lib folder of your jdk version.









Related Tutorials/Questions & Answers:
import file
import file    public void importFile(BlobDomain fileData) { InputStream inStr = fileData.getInputStream(); Workbook workbook... need POI library. Download zip file from the following link: http
jfree missing import file
jfree missing import file  hi....... i have checked the jar file of jfree that import file of RECTANGLEINSETS is not there then what to do now? how.... This jar contains the required class file
Advertisements
jfree missing import file
jfree missing import file  hi....... i have checked the jar file of jfree that import file of RECTANGLEINSETS is not there then what to do now? how.... This jar contains the required class file
jfree missing import file
jfree missing import file  hi....... i have checked the jar file of jfree that import file of RECTANGLEINSETS is not there then what to do now? how.... This jar contains the required class file
jfree missing import file
jfree missing import file  hi....... i have checked the jar file of jfree that import file of RECTANGLEINSETS is not there then what to do now? how.... This jar contains the required class file
Import MYSQL file in PHP - PHP
Import MYSQL file in PHP  i wanted to import the mysql file in PHP5 on button click. is it possible to do it? Is there any possibility of data security
ModuleNotFoundError: No module named 'file-import'
ModuleNotFoundError: No module named 'file-import'  Hi, My Python... 'file-import' How to remove the ModuleNotFoundError: No module named 'file-import' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'import_file'
ModuleNotFoundError: No module named 'import_file'  Hi, My Python... 'import_file' How to remove the ModuleNotFoundError: No module named 'import_file' error? Thanks   Hi, In your python environment
In netbean jdk, it does not import the file,"java.nio.file.Paths". why?.
In netbean jdk, it does not import the file,"java.nio.file.Paths". why?.  it shows error file does not exist
ModuleNotFoundError: No module named 'import-env-file'
ModuleNotFoundError: No module named 'import-env-file'  Hi, My... named 'import-env-file' How to remove the ModuleNotFoundError: No module named 'import-env-file' error? Thanks   Hi, In your python
Import Excel file(date) into mysql database in php
Import Excel file(date) into mysql database in php  I try to import excel file which contains data date(yyyy-mm-dd) into mysql database in php..._select_db("DBA",$connect); //select the table //$file = $_FILES['data.csv
How do I import a CSV file in R?
How do I import a CSV file in R?  Hi, I have a CSV file with 900000 records and I want to load it for analytics. How do I import a CSV file in R... file: data = read.csv("data.csv", header = TRUE) Above code loads the data
How to import txt file using SQL
How to import txt file using SQL  Hai, I have a log file in .txt format and format of the log is given below. From the log i want to pick up some particular words and insert onto a table using SQL. I want the output of the table
ModuleNotFoundError: No module named 'odoo10-addon-account-bank-statement-import-save-file'
-import-save-file'  Hi, My Python program is throwing following error...-import-save-file' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-account-bank-statement-import-save-file' error? Thanks
ModuleNotFoundError: No module named 'odoo10-addon-account-bank-statement-import-save-file'
-import-save-file'  Hi, My Python program is throwing following error...-import-save-file' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-account-bank-statement-import-save-file' error? Thanks
ModuleNotFoundError: No module named 'odoo8-addon-account-bank-statement-import-save-file'
-import-save-file' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-account-bank-statement-import-save-file' error? Thanks  ... can install odoo8-addon-account-bank-statement-import-save-file python
ModuleNotFoundError: No module named 'odoo8-addon-account-bank-statement-import-save-file'
-import-save-file' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-account-bank-statement-import-save-file' error? Thanks  ... can install odoo8-addon-account-bank-statement-import-save-file python
Creating a File I/O using import scanner, io.* and text.*
Creating a File I/O using import scanner, io.* and text.*  open a file for reading and open another file for writing data. input file hours-int, hourly rate-double, name-string. output file name-string, hours-int, hourly rate
I have netbeans jdk 7.0, till it cann't import the file,"java.nio.file.Paths". Why?
I have netbeans jdk 7.0, till it cann't import the file,"java.nio.file.Paths". Why?  it shows message file "java.nio.file.Paths" does not exist
where are the all library files of netbeans 7.0 ? Because it does not import the file,"java.nio.file.Paths"
where are the all library files of netbeans 7.0 ? Because it does not import the file,"java.nio.file.Paths"  it shows message file does not exist
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 the rows dynamically in the excel according to the dataabase??  How to import data from sql server table into an excel file by creating the rows dynamically
The import keyword
names. Use import statement in the beginning of the source file just... The import keyword       The import statement make available one or all the classes in a package
FILE
the content of the file. import java.io.*; public class Appliance { public...;Java Read content of File import java.io.*; public class Appliance { public...FILE  There is a file named Name.txt that contains information
File
File  How to create .Exe file in jana
file
file  how can copy the information in the file to the string?   Store file data into String
file
file  Could anyone please help me to write a code that does the following: Opens a file named MyName.txt, reads the first line from the file and displays it, and then closes the file. Thank you so much
file
file  how can add the information to the graphic file
file
file  Hi,what can delet some of the information of the file
file
file  Hi,how can delet some of the information of the file
File
File   How to find all files in our local computer using java
file
file  hi i want read special line of file. what am i doing ? I write... read data from file. please help me! void maketree(BtNode root,int i) throws... at the following link: Read specific line from file
Mysql Loader Control File
Mysql Loader Control File       Mysql Loader Control File is the mean to import a data... control file of Table named employee1: The Query below is used to import
Mysql Loader Control File
Mysql Loader Control File       Mysql Loader Control File is the mean to import a data... file of Table named employee1: The Query below is used to import the table
import package.subpackage.* does not work
import package.subpackage.* does not work  I have 3 class files...("funA"); } } C.java:- import com.test.*; class C { public static...: cannot access A bad class file: .\A.java file does not contain class A Please remove
Import attribute of page directive
Import attribute of page directive   How use import attribute of page directive ?   The import attribute is used to import all the classes... that the JSP page wants to import, the programmer can use import more than once
Problem of Import JWorkbook
Problem of Import JWorkbook  Hi... i can't use the jworkbook in my project.what types of library files in import
ModuleNotFoundError: No module named 'import-it'
ModuleNotFoundError: No module named 'import-it'  Hi, My Python... 'import-it' How to remove the ModuleNotFoundError: No module named 'import... have to install padas library. You can install import-it python with following
Java static import
Java static import  What is the use of static import
import org.hibernate.Session error
import org.hibernate.Session error  I am new to hibernate. I have.... Downloaded file contains the Eclipse project. 3. Started the Eclipse project and selected Java Project. 4. Created a new project browsing the file. 5. Copied
TensorFlow 2.0 import keras
TensorFlow 2.0 import keras  Hi, How to correctly import keras... have installed TensorFlow 2.0 then you can import it in your project with following code: from __future__ import absolute_import, division, print_function
TensorFlow 2.0 import keras
TensorFlow 2.0 import keras  Hi, How to correctly import keras... have installed TensorFlow 2.0 then you can import it in your project with following code: from __future__ import absolute_import, division, print_function
TensorFlow 2.0 import keras
TensorFlow 2.0 import keras  Hi, How to correctly import keras... have installed TensorFlow 2.0 then you can import it in your project with following code: from __future__ import absolute_import, division, print_function
import package - JSP-Servlet
import package  how to import a package into a jsp page...pls reply with an example..  Hi friend, To import a package in Jsp use the import Attribute of page Directive In JSP The package name folder is putted
python requests module import
python requests module import  Hi, How to import the requests... the internet for this I have to import this library in my Python code. I want the steps for python requests module import. Thanks   Hi, Python requests
python requests module import
python requests module import  Hi, How to import the requests... the internet for this I have to import this library in my Python code. I want the steps for python requests module import. Thanks   Hi, Python requests
The import javax.validation cannot be resolved
The import javax.validation cannot be resolved  Hi, I have a web application and due to missing maven dependency it is giving following error in Eclipse: The import javax.validation cannot be resolved. What maven dependency
Cannot import XSSF in Apache POI
Cannot import XSSF in Apache POI  Hi, I am trying to import the following library in code: import org.apache.poi.xssf.usermodel.XSSFWorkbook; But the class is not present and Cannot import XSSF in Apache POI. How to solve
swing application to import a object in a excel
swing application to import a object in a excel  Hi sir, I want to make a swing application where I can import a object in a cell of a excel... 'create from file' window>browse (this browse path I want to give inside the swing
Reply to the mail(import files error)
Reply to the mail(import files error)  Hi! Thank you. That error has...: duplicate import: roseindia.tutorial.hibernate.Contact... In the Hibernate application is it necessary to place the contact.hbm.xml file in class path
JSP import
JSP import         An import is the attribute of the page directive in JSP that imports... packagename.classname or import all classes of the package by using packagename

Ads