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.

Ads









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
import statement in the beginning of the source file just to specify... 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  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... illustrate an example from 'Mysql Loader Control File'.To grasp this example we

Ads