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



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


NareshChowdary
import file
1 Answer(s)      2 years and 9 months ago
Posted in : Java Beginners


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());
}

} }


Advertisement
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
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
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 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
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
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
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
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
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
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
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
import org.hibernate.Session error
import org.hibernate.Session error  I am new to hibernate. I have... rose india and extracted the content in a directory. 2. Downloaded file contains.... 4. Created a new project browsing the file. 5. Copied contact.hbm.xml
Java static import
Java static import  What is the use of static import
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
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 Its already there in the bin. If its class path should be set , how can i do dat?   Hi, Wait for 20 minutes. I will send you link to download new project file. You should
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... is it necessary to place the contact.hbm.xml file in class path. So, you can
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
Import My Own Package (Automatically)
Import My Own Package (Automatically)   How can I import my own package in every java program ( automatically )....? For example :- java.lang.String... automatically imported, we need not to import
Import Data to SQL database in Java
Import Data to SQL database in Java  Hi, I'm a beginner and I'm wondering how to Import Data to SQL database in Java? Thanks (Platform: Eclipse/SQL
unable to import class com.opensymphony.xwork2.ActionContext not found
unable to import class com.opensymphony.xwork2.ActionContext not found  Imported class com.opensymphony.xwork2.ActionContext not found gettin the above error
import user-define package - Applet
import user-define package  how to import user-define package to the frame/graphic of the applet. could i create a new frame or not ?? please help me ...  Hi friend, import java.io.*; import java.awt.*; import
Page Directive attribute - import
Page Directive attribute - import This tutorial  contains description of import attribute of page Directive. import  Attribute : This attribute... and classes . For multiple import you can use comma(,) for separation. By default
Import java IO - Java Beginners
Import java IO  for example i know java IO is for input and output. I am using Netbeans5.5.1. How can i see all the classes related to java IO for example; stream reader, buffer reader
about static import - Java Beginners
to ask that "static import" syntax is correct or not package mypackage1... A { protected static int i=5; } package mypackage2; import static mypackage1.A....)TestABC.java import static mypack.TestA; public class TestABC { public static
Advertisements
 

 

 

DMCA.com