Thanks a lot Swastik for taking time and working on grey cells to find a solution.You solved my problem partially.
The problem is I have many reports to be generated containing these kind of tables and at the end on the last row I have computed the total and stuff like that.So I can't create a common loop structure for all the reports as shown in your page2.jsp
So what I wanted was a common page with response type set to excel which all these reports can refer.
Below is given a common code that I am using to print the reports.Notice the use of div tag.I want something similar to it to work for my export feature as well like a jsp that can include just the contents of the div tag,etc
Pl. find a solution soon ...