aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes jsp 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 » Engineering » HTML, CSS and JavaScript
Bookmark "jsp table" Watch "jsp table" New topic
Author

jsp table

phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
I want to display a jsp report in a table with rows and columns like below. How would I do it? Can anyone please help me?
Values should populate from data base like below

hashatble ht = wda.getdatadatabase(cat,mon,year));






thank a lot

[ March 24, 2008: Message edited by: lakshmi manepally ]

[ March 24, 2008: Message edited by: lakshmi manepally ]
[ March 24, 2008: Message edited by: lakshmi manepally ]
naga raaju
Greenhorn

Joined: Mar 14, 2008
Posts: 29
you need jsp code with databse acess.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

There are a couple examples in the JSP FAQ that print data as tables.
One uses JSTL and EL.
One of the others uses legacy scriptlets.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ajith Prasad
Ranch Hand

Joined: Aug 22, 2006
Posts: 66
There are many samples available in online, you can look at that and you will solve your problem by youself

http://portalandportlets.blogspot.com/
phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
I am trying to display the below report.I am not able to display properly. Can anyone help me? I am getting below, but it should be like the second one. The values should be write beside the cloumn names





phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
In jsp table, Can I switch coloumn to display as verically and row as horizontal. Can anyone answer my question?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
I am getting below, but it should be like the second one. The values should be write beside the cloumn names

Wrap both in a TABLE having one row (TR) and two cells (TD). The first cell would contain the text, and the second cell would contain the numbers.

Moving to the HTML forum, since this has nothing to do with JSPs.


Ping & DNS - my free Android networking tools app
phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
Could please give me some examples?

Here is my code,


I want to display the values form html row vertically and column horizontally like below

HITS 222 333 444 4555 55566 666 666 777 777 888 888
REISSUED 33 111 22 22 33 333 444 444 555 5666 666 777
ADDCOLL 000 00 0.0 90 000 8888 99999 777 666 666 555
CHANGEFEE 00 000 00 00 00 000 00 0 000 0 00 0 00000

Here is the code below. I don't understand in this code, How can I display like above output. Could you please help me in this case?



Can anyone please help me?



Thanks a lot
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
For something like this

you need to generate code like

[ March 27, 2008: Message edited by: Ulf Dittmer ]
phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
Could you please tell me, where do I have to make changes in my code please?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by lakshmi manepally:
Could you please tell me, where do I have to make changes in my code please?


lakshmi,
Folks here are happy to help out but nobody is going to write your code for you. Ulf has already spent a lot of time showing you one approach. Why don't you take some time to try applying it to your code and see what you come up with. Then, if you have a more specific question or if get stuck on a more specific issue, feel free to post back for some more tips.
phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
Thanks for your help.In the code I am able to print the values, I have tried puting in the same way, what he was mentioned? But it didn't work for me. In my code the column valuesshould be out the loop only Data should be inside the do loop.

for example with my code I can print like below format

hits reissued
222 444
44 444
44 44

But I could not print reverse of that format for example

hit 222 444
reissued 222 555

Is the html table approach is good or do you have any other way to just make the data in loop not the columns

I need your help please.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
If you look at the example HTML I posted you'll see that the column labels are not printed together with the values. So you can print the labels before you enter the loop that prints the values. The code you posted before already does it that way. You just need to change it to print the HTML tags a bit differently so that it matches what I posted.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp table