Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp table

 
phani kon
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need jsp code with databse acess.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ajith Prasad
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In jsp table, Can I switch coloumn to display as verically and row as horizontal. Can anyone answer my question?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
phani kon
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For something like this

you need to generate code like

[ March 27, 2008: Message edited by: Ulf Dittmer ]
 
phani kon
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please tell me, where do I have to make changes in my code please?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic