| Author |
Read the particular row/record from Excel and output as HTML table
|
Rajesh Balu
Ranch Hand
Joined: Nov 07, 2011
Posts: 50
|
|
Hi,
I want to read the data from the excel sheet and to display it in the HTML table as output.
I want to read a specific row from the excel based some unique value. (Say an example of EmpID).
I have tried the below code:
FileInputStream fileInputStream = new FileInputStream("d:/Test.xls");
HSSFWorkbook workbook = new HSSFWorkbook(fileInputStream);
HSSFSheet worksheet = workbook.getSheet("Test");
HSSFRow row1 = worksheet.getRow(0);
HSSFCell cellA1 = row1.getCell((short) 0);
String a1Val = cellA1.getStringCellValue();
HSSFCell cellB1 = row1.getCell((short) 1);
String b1Val = cellB1.getStringCellValue();
HSSFCell cellC1 = row1.getCell((short) 2);
String c1Val = cellC1.getStringCellValue();
Using this i can retrieve the first row of the excel. But i want to read the particular column based on the key value.
Could someone please help me?
Thanks,
Rajesh.B
|
 |
Rajesh Balu
Ranch Hand
Joined: Nov 07, 2011
Posts: 50
|
|
Hi,
I am still struggling with this issue.
Could someone please help me on this?
Thanks,
Rajesh.B
|
 |
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2329
|
posted

0
|
i want to read the particular column based on the key value.
What does that mean?
|
 |
Rajesh Balu
Ranch Hand
Joined: Nov 07, 2011
Posts: 50
|
|
It means, to search the record based on some unique value.
Example; It there is a table of values with emp name, emp id, emp address, i want to fetch the record based on the emp id.
Hope this clarifies your question.
|
 |
 |
|
|
subject: Read the particular row/record from Excel and output as HTML table
|
|
|