i'm developing a tracker application in web. everything went fine. But the final stage has to show data in tabular format, the regular tabular format i'm able to generate table like below(by using select * from DB).
Name ID Salary
Ravi 1 10000
Raj 2 10000
Ram 3 20000
But i want to see the reports like below.
Ravi Raj Ram
ID 1 2 3
Salary 10000 10000 20000
some guys suggested me to use pivot tables. but i don't know the concept of. and i'm unable to find a simple reference for this. and i'm using excel as backend and i want to display the reports in my browser. please let me know any simple tutorial where i can learn forming pivot tables in jsp. or any small example explaining so.
Forget about pivot tables, then, and start working on either something which transforms that data matrix on the server, or some JSP which generates the HTML in that way.
You're generating HTML, right? And HTML doesn't support pivot tables. So the advice those guys gave you was worthless.
Hi Paul, thanks for the response, i mentioned the output to be in browser.
i want to display the reports in my browser.
but no where i've mentioned as html. and also the question was about asking ranchers(you guys) for a reference, but not which technology(if i'm not wrong) to be used. Thanks again.
Rakesh Keerthi wrote:and also this post was posted in jsp page.
JSP is a templating mechanism for creating HTML. So, you're still using HTML.
So rather than getting snippy with Paul, I suggest you follow his advice. Figure out what the HTML that displays what you want should be, and then write a JSP that produces that HTML.
generate table like below(by using select * from DB).
In any case, I assume you are somehow getting the data out of Excel and into Java structures. What are those structures?
Unless you just plan to let the users download the Excel spreadsheet directly?
So when you read the data from the resultset, how are you storing it?
That's a bad practice that has been obsolete for over 12 years. You need to unlearn that bad habit immediately.
you should be fetching the data in a Java class that you can call from the page controller.
Please read this article to understand how modern web applications should be structured. If you're fairly new to JSP, read this article first.
I'm not understanding what it is that you "do not know" that's keep you from structuring things properly rather than hacking the code into a JSP.