retrieving of value from excel file 2 Answer(s) 3 years and a month ago
Posted in : JSP-Servlet
Dear sir, Thanks for sending a code now i am getting a particular column value i.e EmailId column for snding a massmails,now i have to get a particular column values i.e Name(A),EL(B),CL(C),Bonus(D),EmailId(E) soon...(A,B,C,D,E.. are column names) i have to get and send a mail that contains a matter i.e
Dear A, U r CL is C ,EL is B,and bonus is D. Thanks and Regards, Hr.
i have to send this message to all the employees that are in the excel sheet.So in the previous code i have got onl single column value i.e EmailId values to send for a different employees mailids,so how to get a different column values please help me sir,giveme some code or if any modification in the previous code tell me sir.
Thanks in advance sir... Regards harini.
View Answers
April 28, 2010 at 11:15 AM
Hi Friend,
Try the following code: 1)column.jsp: <%@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"%> <form action="mail.jsp"> <% short a=0; short b=1; short c=2; short d=3; short e=4; String filename ="C:/excelFile.xls"; if (filename != null && !filename.equals("")) { try{ FileInputStream fs =new FileInputStream(filename); HSSFWorkbook wb = new HSSFWorkbook(fs); for (int k = 0; k < wb.getNumberOfSheets(); k++){ HSSFSheet sheet = wb.getSheetAt(k); int rows = sheet.getPhysicalNumberOfRows(); for (int r = 1; r < rows; r++){ HSSFRow row = sheet.getRow(r); if (row != null) { int cells = row.getPhysicalNumberOfCells(); %><br><% HSSFCell cell1 = row.getCell(a); if (cell1 != null){ String value = null; switch (cell1.getCellType()){ case HSSFCell.CELL_TYPE_FORMULA : value = "FORMULA "; break; case HSSFCell.CELL_TYPE_NUMERIC : value = ""+cell1.getNumericCellValue(); break; case HSSFCell.CELL_TYPE_STRING : value = cell1.getStringCellValue(); break; default : } %> <input type="text" name="name" value="<%=value%>"> <% } HSSFCell cell2 = row.getCell(b); if (cell2 != null){ String value = null; switch (cell2.getCellType()){ case HSSFCell.CELL_TYPE_FORMULA : value = "FORMULA "; break; case HSSFCell.CELL_TYPE_NUMERIC : value = ""+cell2.getNumericCellValue(); break; case HSSFCell.CELL_TYPE_STRING : value = cell2.getStringCellValue(); break; default : } %> <input type="text" name="el" value="<%=value%>"> <% } HSSFCell cell3 = row.getCell(c); if (cell3 != null){ String value = null; switch (cell3.getCellType()){ case HSSFCell.CELL_TYPE_FORMULA : value = "FORMULA "; break; case HSSFCell.CELL_TYPE_NUMERIC : value = ""+cell3.getNumericCellValue(); break; case HSSFCell.CELL_TYPE_STRING : value = cell3.getStringCellValue(); break; default : } %> <input type="text" name="cl" value="<%=value%>">
April 28, 2010 at 11:16 AM
continue..
<% } HSSFCell cell4 = row.getCell(d); if (cell4 != null){ String value = null; switch (cell4.getCellType()){ case HSSFCell.CELL_TYPE_FORMULA : value = "FORMULA "; break; case HSSFCell.CELL_TYPE_NUMERIC : value = ""+cell4.getNumericCellValue(); break; case HSSFCell.CELL_TYPE_STRING : value = cell4.getStringCellValue(); break; default : } %> <input type="text" name="bonus" value="<%=value%>"> <% } HSSFCell cell5 = row.getCell(e); if (cell5 != null){ String value = null; switch (cell5.getCellType()){ case HSSFCell.CELL_TYPE_FORMULA : value = "FORMULA "; break; case HSSFCell.CELL_TYPE_NUMERIC : value = ""+cell5.getNumericCellValue(); break; case HSSFCell.CELL_TYPE_STRING : value = cell5.getStringCellValue(); break; default : } %> <input type="text" name="email" value="<%=value%>"> <% } } } } } catch (Exception ex){ ex.printStackTrace(); } } %> <input type="submit" value="submit"> </form>
<tr><td>Content</td><td><textarea rows="5" cols="40">Dear <%=name[i]%>, Your CL is <%=cl[i]%> ,EL is <%=cl[i]%>, and bonus is <%=bonus[i]%>. Thanks and Regards, Hr. </textarea></td></tr> <%
}
%> </table>
Thanks
Related Pages:
retrieving of value from excel file - JSP-Servlet retrieving of valuefromexcel file Dear sir,
Thanks for sending... this message to all the employees when i upload a file then it fetch a data from that excel sheet i.e this matter will take a para meter values from the excel
retrieving of value from excel file - JSP-Servlet retrieving of valuefromexcel file Dear sir,
Thanks for sending... this message to all the employees when i upload a file then it fetch a data from that excel sheet i.e this matter will take a para meter values from the excel
retrieving of value from excel file - JSP-Servlet retrieving of valuefromexcel 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
Retrieving specific data from excel Retrieving specific data from excel Hello everyone, i have written a simple code to retrieve data fromexcel sheet and working fine, the excelfile... to be printed. here is my sample code
try {
FileInputStream file = new
Retrieving attribute value from XML Retrieving attribute valuefrom XML I have an XML as below to parse...;
.....
But am not able to fetch the value of LoadTicketId attribute.
My code...-values-from-a-nodel.shtml
http://www.roseindia.net/xml/dom/GetData.shtml
Thanks
retrieving excel data when file uploading retrievingexcel data when file uploading <%@page import...);
}
}
%>
when i gave full path name i got excel data but when file...\\hp\\Desktop\\Book1.xls";
String filename=request.getParameter("excel
importing excel file and drawing multiple graphs from one excel file
importing excelfile and drawing multiple graphs from one excel file  ... time from one excelfile using different columns..and instead of passing column... can i do that??
and also help me how can i get date and time valuefromexcel
check radio button on retrieving the value from database.
check radio button on retrieving the valuefrom database. HI
i am new to jsp.In my applcation i having a problem. I am retrieving
user payment from... checked.If user has done payment through cash then when i
am retrieving user
Retrieving value from multiple table in database Retrievingvaluefrom multiple table in database Hi fnds, I want... FROM (
SELECT * FROM month1
UNION ALL
SELECT * FROM month2
UNION ALL
SELECT * FROM month3
) AS somealias
GROUP BY uname
reading data from excel file and plotting graph
reading data fromexcelfile and plotting graph I am doing a project using NetBeans in which i have to take input an excelfile and then using... at the same time from one excelfile using different columns..how can i do that?
waiting
insert rows from Excel sheet into a database by browsing the file
insert rows fromExcel sheet into a database by browsing the file hello, I am trying to insert rows fromExcel sheet into SQL database by browsing Excelfile in java(JSP). I can insert rows using ODBC connetion. But using odbc
insert excel value in to oracle data base
the data from the excelfile using JDBC. For this you need to create dsn...insert excelvalue in to oracle data base Hi All
I am using this code for saving excelvalue to oracle database table. code is working properly
JavaScript get excel file data
is the
example which gets the data from the excelfile with the cell and row index... from this sheet. It works with Internet
Explorer browser.
Excelfile data...
JavaScript get excelfile data
retrieving from db - JSP-Servlet retrievingfrom db hello'
I am trying to write my first application...; Hi
Retrive valuefrom database
Retrive data from...: rst=stmt.executeQuery("select * from books_details");
27: %>
28
retrieving from oracle database using jsp combo box retrievingfrom oracle database using jsp combo box hi this is my... name of the server has to display in the process name field from the oracle... error = "";
if (!(document.getElementById("startpath").value
insert values from excel file into database
insert values fromexcelfile into database hi i want to insert values fromExcelfile into database.Whatever field and contents are there in excel... the following link:
Insert values fromexcelfile to database
read excel file from Java - Java Beginners
read excelfilefrom Java How we read excelfile data with the help of java? Hi friend,
For read more information on Java POI visit to :
http://www.roseindia.net/java/poi/
Thanks
How to upload a large excel file - JSP-Servlet
How to upload a large excelfile Dear sir ,
How to upload a large excelfile and how to read a that large excelfile or how to get a each column values from that large excel file.For small file i am getting values
Access Excel file through JDBC
Access Excelfile through JDBC
In this section, you will learn how to access excelfile through Jdbc and
display records in JTable. As you know Excel comes... and the excelfile. Here the
name of the worksheet is equivalent to any database
Insert data in Excel File from Database using JSP
Insert data in ExcelFilefrom Database using
JSP ... developed a application to
insert data in excelfilefrom database in JSP. We... the data from database, create an excelfile and data
insert into newly
Create and Save Excel File in JSP
and saving Excelfilefrom JSP application.
In this example we are going... Create and Save ExcelFile in JSP
 ... file.
To create an excel sheet we can use third party API which is Apache
how to display the data from excel to webpage
search for the value 4024 in a excelfile and to display the remaining values...how to display the data fromexcel to webpage Hi,
I need help... that reads the excelfile and store data into table.
<%@page import="java.io.*"%>
importing excel file
importing excel file Hi All
I am developing a java application whre we upload a excelfile in to database and
all excelvalue should import...
it is not showing real excel sheet value.
please suggest good way to solve this problem
excel file using JDBC java.? excelfile using JDBC java.? hey, i am a telecomm. engineer , and i am try to develop a tool which reads from a excelfile and then appends the same... used JDBC ODBC to read fromexcelfile. i am not able to append it using
get values from Excel to database
get values fromExcel to database hi i want to insert values fromExcelfile into database.Whatever field and contents are there in excelfile that should go to database which exists. am using SQL Server management studio
Saving and Retrieving The Preferences
("Got PrefsValue '" + prefs_value + "' from prefs");
// This prints the got... Saving and Retrieving The Preferences
Preference values are the constant key/value pairs. In the pairs of key
and value the key
Retrieving Tables from a Database Retrieving Tables from a Database
 ... for retrieving
tables from a specific database through an example. In relational... the connection
between the MySQL
database and Java file. We will retrieve
Read data from excel file and update database using jsp
Read data fromexcelfile and update database using jsp read data fromexcelfile and update database using jsp
Hi, I am using a MySQL database for scientific research analysis. My team members sends research data in excelfile
Retrieving JTree structure from database Retrieving JTree structure from database
This example shows how to retrieving data from... the steps required to create tree retrieving the data from the
database.
Here
Linking an Excel File with the Application tool
on the questions that are in the excelfile like extracting the questions from the excelfile...Linking an ExcelFile with the Application tool I have to link an excelfile with a application software which I am developing.I have this code
Retrieving XML Data Using GWT Retrieving XML Data Using GWT
This Example Describes the way of retrieving XML file
Data from... are describing below is explained here
in stepwise:-
Step1:-Create a java File
retrieving of data from one jsp to another jsp - JSP-Servlet retrieving of data from one jsp to another jsp using jsp i m displaying a table ,in table i m displaying a radio button then values like id,name etc ,if i click on an radio button i have to get a corresponding id value
Retrieve Data from the database and write into excel file
Retrieve Data from the database and write into excelfile.
In this section, we are going to retrieve data from the database and write into the excelfile...);
fileOut.close();
System.out.println("Data is saved in excelfile
excel
excel how to read columns values of excelfile in java and store in array list in java
like
col1 col2
2 3
1 7
7 9
then list1 have values of col1 and list2 have values of col2...
 
excel
excel how to save excel sheet data into the database using poi api... into person(Name,Address) value('"+name+"','"+address+"')");
System.out.println...=stat.executeUpdate("insert into person(Name,Address) value('"+name+"','"+address
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
read excel data from jsp - JSP-Servlet
read excel data from jsp Hi
how to read excelfilefrom jsp? Excelfile is created manually entered data having many sheets? and read the entire...)excel.jsp:
Read And Edit Excel File continue
excel to database excel to database How to export data fromexcel sheet to mysql database by using java with request parameter
Here q=40 is a request parameter...();
Workbook workbook = Workbook.getWorkbook(new File("C:/data.xls"), ws
Wrong parameter values while exporting data from jsp to excel
Wrong parameter values while exporting data from jsp to excel  ..., specifically, if the parameter value is ALL, it gets translated to NO in excel...();
out.println("Data is saved in excelfile.");
}catch ( Exception ex ){
}
%>
Retrieving XML Data Using GWT Retrieving XML Data Using GWT
This Example Describes the way of retrieving XML file
Data from the server using GWT. The basic building
block for running
retrieving data from database to the textbox depending upon the id in jsp retrieving data from database to the textbox depending upon the id in jsp Hi,
our project involves fetching of data from database into textbox depending upon another textbox value which is productid.First the id entered by us