Reading excel via JSP

Ads
 

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".

Ads









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
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
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
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
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
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
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
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
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
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
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
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
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.
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 to Excel
Jsp to Excel     ... an excel file and write data into it using jsp. For this, you have to import...; }  %> The excel sheet is created in the C drive
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
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
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

Ads