aspose file tools*
The moose likes Other Open Source Projects and the fly likes Read the particular row/record from Excel and output as HTML table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Read the particular row/record from Excel and output as HTML table" Watch "Read the particular row/record from Excel and output as HTML table" New topic
Author

Read the particular row/record from Excel and output as HTML table

Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 55
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: 55
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: 2408
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: 55
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Read the particular row/record from Excel and output as HTML table