Reading excel via JSP

Reading excel via JSP

The problem is while reading cells values which all are having "space" between the word, I can read only till space after that space the word has been dropped.

for Example  
Name                 CareerStart
gopinath Ashokan     December 2005

after read 
Name         CareerStart
gopinath     December 

can you help me in that and tell me how to ignore the space between words and get full cell value? I am reading the value as follows


HSSFCell cell2 = row.getCell(1);
if (cell2 != null) {                            
switch (cell2.getCellType()) {
case HSSFCell.CELL_TYPE_NUMERIC:name = ""+ cell2.getNumericCellValue();     
break;  
case HSSFCell.CELL_TYPE_STRING:name = cell2.getStringCellValue();
break;  
}   
}
HSSFCell cell5 = row.getCell(4);
if (cell5 != null) {
switch (cell5.getCellType()) 
{   
case HSSFCell.CELL_TYPE_NUMERIC:CareerStart = ""+ cell5.getNumericCellValue();
break;
case HSSFCell.CELL_TYPE_STRING:CareerStart = cell5.getStringCellValue();
break;
}
}

<td><input type="text" name="name" value=<%=name%>></td>
<td><input type="text" name="CareerStart" value=<%=CareerStart%>></td>

anyone please help me to resolve that space issue(means while reading the cell values space should be ignored between the words)

View Answers

January 30, 2013 at 3:33 PM

Hi Team, I have found the solution for my question. The problem happended because I getting the values inside "text" field. So the "text" field taking the value after space as text field's "attribute value". To avoid this get the value as follows

<input type="text" name="name" value='<%=name%>'></td>
<input type="text" name="careerstart" value='<%=careerstart%>'></td>

Note: simply I have added single quotes for the value field in the "text".









Related Tutorials/Questions & Answers:
Reading excel via JSP
Reading excel via JSP   The problem is while reading cells values... the space between words and get full cell value? I am reading the value...(means while reading the cell values space should be ignored between the words
excel sheet reading and using that data - JSP-Servlet
excel sheet reading and using that data  i have to do a read a excel sheet file of a employee record and then i have to use a employee details to send mail to those employees how to do in jsp sir please help me sir.. Thanks
Advertisements
Error in reading Excel data using jsp
Error in reading Excel data using jsp  ERROR while executing bellow...) at org.apache.jsp.AdminSaaS.excelreading_jsp._jspService(excelreading_jsp.java:71... is not a proper xls file. It's a text file with a .xls extension s.t. Excel can quietly
uploading and reading the excel daa
uploading and reading the excel daa  uploading the excel file not getting the data of the excel
Reading an excel file into array
Reading an excel file into array  Hi, I'm trying to read in an excel file, search a column for containing key words (entered by a user) and then displaying the matching rows in a table. I'm fairly new to JavaScript. Can anyone
reading excel sheet in java
reading excel sheet in java  can anyone tell me a proper java code to read excel sheet using poi   Here is a java code that reads an excel file using POI api and display the data on the console. import java.io.
Error in reading Excel data using jsp even having .xls and POI Library in respective folders
Error in reading Excel data using jsp even having .xls and POI Library in respective folders  Hi, hello.xls and POI library files are there in respective folders. the printStackTrce() method shows the following Error message
Reading and querying an Excel file in JavaScript
Reading and querying an Excel file in JavaScript  Hi, I'm trying to read in an excel file, search a column for containing key words (entered by a user) and then displaying the matching rows in a table. I'm fairly new
Excel sheet image reading issue
Excel sheet image reading issue   Hello every one.I?m trying to read images from an excel sheet using OleDbDataReader. My excel file has 6... reading the record, It?s doing fine on the first 5 columns but return me
JSP TO EXCEL
JSP TO EXCEL  Hi sir/mam, How to import data to excel using jsp without retrieving database.   friend, you can't import excel data into the middle of an HTML pages (your JSP will result in an HTML page
JSP to Excel - JSP-Servlet
JSP to Excel  Need an example of JSP and Excel database connection. Thanks
jsp to excel - JSP-Servlet
jsp to excel  Hi All, I'm writing a program of jsp to Excel conversion with Using POI. My problem is i'm unable to put multiple data into excel...)); } FileOutputStream fileOut = new FileOutputStream("c:\\excel\\wct.xls
Reading cookies in jsp
Reading cookies in jsp   How read cookies in jsp ?   Creates a cookie, a small amount of information sent by a servlet to a Web browser, saved by the browser, and later sent back to the server. A cookie's value can
External file reading in jsp
External file reading in jsp  i have written a jsp page(ReadExt.jsp) in my application which reads a text file content from a system... used java code in jsp page ... and tel me how can i make it work in other system
jsp excel code - JSP-Servlet
jsp excel code  hi how to store html form data into excel sheet by using jsp? and repeat this process continuously for entire sheet
External file reading in jsp
External file reading in jsp  i have written a jsp page(ReadExt.jsp) in my application which reads a text file content from a system .. but this ReadExt.jsp page is not working in other system when i open that application
Reading the Date and time values from excel sheet
Reading the Date and time values from excel sheet  hi guys , iam trying to read excel sheet data using apache poi api .my problem is i cant read the date(dd/mm/yy) and time(hh:mm:ss) values concurrently from two different cells
Export data in excel sheet via Browse and upload button into mysql database
Export data in excel sheet via Browse and upload button into mysql database  how to create a Browse & Upload Buttons and then save the information from it in mysql database's Table Am using struts2,hibernate for making
reading data from excel file and plotting graph
reading data from excel file and plotting graph  I am doing a project using NetBeans in which i have to take input an excel file and then using the data in excel file, i have to plot graphs based on CELL ID selected. please help
JSP/Servlet to read and update Excel
JSP/Servlet to read and update Excel  Hi Team, My requirement is based upon my input(name) value via one jsp, the program(jsp/servlet) should fetch all the column values which is related to my input(name) from Excel(.xls
Excel - JSP-Servlet
Excel  How to export data from jsp to excel sheet. I am using struts1.2 in my application.  Hi friend, Code to data from Jsp to excel... "success.jsp" For more information on excel sheet Using
jsp excel code - JSP-Servlet
jsp excel code  Hi how to insert form data into excel file using jsp?  Hi Friend, Try the following code: 1)register.jsp: Registration Form First Name: Last Name: User Name: Password
Reading a xml file - JSP-Servlet
Reading a xml file  how to read a xml file using jsp and then i have to retrive a data from that file use it in code?  Hi Friend, Please visit the following link: http://www.roseindia.net/jsp/parsing-xml.shtml
jsp data in excel - JSP-Servlet
and this query data has come from beans and using beans i put it in excel jsp in table...jsp data in excel  i have create jsp page which has button for excel.this calls jsp which contains code which has and then code for present data
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
reading dropdown values from properties file in jsp
reading dropdown values from properties file in jsp  reading dropdown values from properties file in jsp
Remember me on this computer (via cookies) in jsp servlet
Remember me on this computer (via cookies) in jsp servlet  Remember me on this computer (via cookies) in jsp servlet   Hi, Here is the detail of using cookies to identify the user.ADS_TO_REPLACE_1 In Servlet or JSP
export to excel - JSP-Servlet
export to excel  Hi this is priti. I need a help. What is my question is i have a report page here i need a button cllaed "Export to excel". After clicking the button all the values from the jsp page will save to a excel file
Reading a xml file - JSP-Servlet
Reading a xml file  Thanks for ur answer sir but problem is that i have to do a reading a xml file of a employee record and then i have to use a employee details to send mail to those employees how to do i sir please help me
update excel sheet using jsp::
update excel sheet using jsp::   Hi Sir,... I have a excel... given excel sheet and display it into another excel sheet using jsp" i am using 'session' to get the empid from one page to another jsp
Create Bar Graph from reading excel sheet in Java
Create Bar Graph from reading excel sheet in Java  I'm New to Java and I have to create a java program where I have to read data from multiple excel... in the different excel sheets (data can change and based on that graph should also get
reading data using struts and jsp java
reading data using struts and jsp java  how can i read data entered by user into a textbox (jsp page) into struts action class ex emp id,so that after reading emp_id it can be read into struts action class for retrieving other
jsp - excel generating problem - JSP-Servlet
jsp - excel generating problem  Hi, I worked with the creating excel through jsp, which is the first example in this tutorial...://www.roseindia.net/jsp/poi/generatingExcelSheet.shtml In this page create excel sheet
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
read excel data from jsp - JSP-Servlet
read excel data from jsp  Hi how to read excel file from jsp? Excel file is created manually entered data having many sheets? and read the entire sheet and also edit with jsp? pls suggest me?   Hi Friend, 1
Reading And Writing Excel File
reading and writing excel file   ... words, we can say that it is used to read the excel file. After reading the excel... the excel sheet  using java . The package we need to import is : java.io.
excel report fro jsp mysql
excel report fro jsp mysql  Dear Sir, I am facing some problem while generating excel report form mysql database using jsp code. With the help from your site, I can able to generate excel file for all data types other than blob
how to access element added via javascript dynamically using jsp code
how to access element added via javascript dynamically using jsp code  Urgent..Anyone please Assist how to access data from the elements added via javascript dynamically using the jsp code. i am adding empty records on .jsp page
JSP Excel Tutorial
JSP And Excel Examples       Display output in excel format using JSP We can create excel sheet in the .xls format using jsp. In this example we create
Jsp to Excel
Jsp to Excel     ... an excel file and write data into it using jsp. For this, you have to import...; }catch ( Exception ex ){  }  %> The excel sheet
convert html to excel using jsp
convert html to excel using jsp   i want to convert a html page into mcrosoft excel page using jsp.how i do
How to export chart(graph) generated by jsp into a excel?
How to export chart(graph) generated by jsp into a excel?  How to export chart(graph) generated by jsp into a excel? I have a jsp page which generates charts . Now I need those charts to be exported into an excel.please help
reading a file on server side - JSP-Servlet
reading a file on server side  Thank you sir for replying with the solution of my first question. Now i am facing some problem in renameing & reading a word file in JSP which is uploaded by client. please help me
To save table format data in pdf/excel in jsp
To save table format data in pdf/excel in jsp  Hello, I am doing web application project in jsp. In webform ,I am displaying database data in html table. So my question is ,I want so save this html format data in pdf/excel format
Dynamic table data to Excel in JSP
Dynamic table data to Excel in JSP   Iam trying to export dynamic data to excel . But it is displaying only static data .Kindly help viewtrial.jsp.../vnd.ms-excel"); response.setHeader("Content-Disposition", "inline
Apache POI Excel Maximum Row - JSP-Servlet
Apache POI Excel Maximum Row  I am using Apache POI lib for export jsp results to excel file. I am getting error : Row number must be between 0... row value ? and How can I change that ? Thanks in advance Regards
create html of word ,excel,ppt - JSP-Servlet
create html of word ,excel,ppt  Plzz tell me how to create html page of word , excel ,ppt document dynamically using jsp because in my project I have to store uploaded files as html page
how to create a jave version excel in jsp
how to create a jave version excel in jsp  I would like to create a java version excel in JSP. so the excel like document can be published in the internet. the user will be able to enter the information and click the save button
how to present the excel to the web browser in jsp
how to present the excel to the web browser in jsp  How to present the content of the newly created excel file in the following jsp to the web...="org.apache.poi.xssf.usermodel.XSSFWorkbook"%> <%@ page contentType="application/vnd.ms-excel
export data to excel sheet - JSP-Servlet
export data to excel sheet  Hi.. how to export data to excel sheet from jsp? and how to update the excel sheet from jsp? and how to get the data from excel sheet? and how to make calculations in excel sheet like total avg

Ads