Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet how to print headings horizontally in jsp

Have Programming Question? Ask it here!
 
 
 


Arya
how to print headings horizontally in jsp
1 Answer(s)      2 years and 5 months ago
Posted in : JSP-Servlet


In one of my jsp i have used for loop. in every iteration it will fetch value from db and print it on heading section, it prints vertically but my requirement is to print it horizontally, can anyone suggest any idea. please see the code which i have used below :

<% for(int Count = 0; Count < numberOfcase; Count++){
            String Name = (String)List.get(Count);%>         
             <dd/>
         <table border = "1">
          <tr style = "background-color:Navy;color:White;">
            <th></th>
            <th><%= Name %></th>
            <th></th>
          </tr>
          <tr>
            <th>Time</th>   
            <th>Successful</th>
            <th>Unsuccessful</th>
          </tr>       
              <%
              try{
                 rs = stmt.executeQuery(queries[Count]);
                 while (rs.next()) {
                    startDate = rs.getString(1);
                    endDate = rs.getString(2);
                    ID = rs.getString(3);
                    successCount = rs.getString(4);
                    failureCount = rs.getString(5);             
                    //out.println(startDate+" "+endDate+" "+ID+" "+successCount+" "+failureCount); %><br/>          
                    <tr>            
                        <th><%= endDate %></th>
                        <th><%= successCount %></th>
                        <th><%= failureCount %></th>
                    </tr>
                <% }
                }catch(Exception e){

Thanks in advance


Advertisement
View Answers

April 4, 2012 at 12:56 PM


<%@ page import="java.sql.*"%>
<html>
<body>

<form method="POST">
        <%
        int l=0;
        int rowcu=0;
        int totalRecords=0;
        ResultSetMetaData rsmt=null;
        ResultSet rs=null;
        String query="select * from person";
        try{
            Class.forName("com.mysql.jdbc.Driver");
           Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
            Statement st1=conn.createStatement();
            Statement st2=conn.createStatement();
            Statement st3=conn.createStatement();
            ResultSet rs1=st1.executeQuery(query);
            ResultSet rs2=st3.executeQuery(query);
            int x=0;
            while(rs2.next()){
            x++;
            }
            rs1.next();
            rsmt=rs1.getMetaData();
            l=rsmt.getColumnCount();
            rs=st2.executeQuery(query);
        %>
        <table border="1" >
        <tr>
            <%for(int v=1;v<=l;v++){
                String cnames=rsmt.getColumnName(v);
            %>
          <td ><%=cnames.toUpperCase()%></td>
          <%
                }
          %>
          </tr>
          <%
          while(rs.next()){
          %>
          <tr>
          <%
          for(int vc=1;vc<=l;vc++){
          %>
          <td><%=rs.getString(vc)%></td><%
          }
            }%>
          </tr>

  </table>
  <%
      }
        catch(Exception e1){
        }
  %>

</body>

</html>

For more information, visit the following link:

Visit Here



Related Tutorials/Questions & Answers:
how to print headings horizontally in jsp
how to print headings horizontally in jsp  In one of my jsp i have used for loop. in every iteration it will fetch value from db and print it on heading section, it prints vertically but my requirement is to print it horizontally
How to display a record containing 30 fields in jsp without scrolling the page horizontally?
How to display a record containing 30 fields in jsp without scrolling the page horizontally?  I want to display records containing 30 fields in a table row.Is it possible in jsp without scrolling the page horizontally
Advertisements
How to make a horizontally Scrollable grid in jsp using div, table, css, javascript?
How to make a horizontally Scrollable grid in jsp using div, table, css, javascript?  In a jsp page InsertUpdate.jsp (say) there is a button Insert... distorted to accommodate 30 fields.How can I make it Horizontally scrollable
How to print a webpage without url and date in jsp ?
How to print a webpage without url and date in jsp ?  How to print a webpage without url and date in jsp
How to print contents of a web page in jsp?
How to print contents of a web page in jsp?  I have generated a pay slip using jsp.How do I print the contents of the slip
how to print the server time
how to print the server time  how to print the server time in jsp and update time in fix interval
How to print this Format exactly?
How to print this Format exactly?   * * * & reverse
How to print this in java?
How to print pattern in Java?  How to print a particular pattern in Java...;  How to print this in java
how to print the server time
how to print the server time  i want to print database time in clintside and update time in every secound without creating connection to database for each time. how can i do
how to print data(From databse Oracle10g) in preformatted A4 and A3 paper using jsp
how to print data(From databse Oracle10g) in preformatted A4 and A3 paper using jsp  how to print data(From databse Oracle10g) in preformatted A4 and A3 paper using jsp. I am inserting analysis report into a database using
how to print - Java Beginners
how to print  how to print something on console without using System.out.print() method ?  Hi Friend, You can use PrintWriter to write anything on the console. import java.io.*; public class Print{ public static
how to print the following pattern
how to print the following pattern  Hello hEllo heLlo helLo hellO pls reply soon its an emergency   class StringPattern { public static void main(String[] args) { String st="hello
how to print pdf format
how to print pdf format  Hi every body iam doing school project iam using backend as oracle front end java .how to print student marks list /attendence in pdf format. please help me. thanks in advance.   Here
How to design a foot print on the sand, print on the sand, print
How to design a foot print on the sand       You might have seen foot prints on the sand field. Do you think, it can be design in the photoshop, yes I have done here. I have used
how to print JInternal frame component ?
how to print JInternal frame component ?  hello sir, i devalop a swing application .but problem is that how display report & print it. some data prefech from database & keep to jtable but how it is print with table
How can print integer in method
How can print integer in method   a method call process public process(int jobid,int remain){ } how to print int jobid ,int remain in for loop jobid in proc[0],remain in proc[1],both show in text file how to print proc[0
how to print on pre-printed cheque - Development process
how to print on pre-printed cheque  I want to print on pre-printed cheques using java and jsp .please provide me the source code which help me to resolve this problem
How to print the following pattern in java?
How to print the following pattern in java?  How to print the following pattern in java? he he is he is going he is going in   import java.io.*; class StringPattern { public static void main(String[] args
How to Print a Stack Trace Message
How to Print a Stack Trace Message  Debugging of Java program requires... times you have to print the detailed error message on the console... will print the detailed message on the console. You can use
Clear the print button after onclicking the print - JSP-Servlet
Clear the print button after onclicking the print  rate_print.document.writeln(" "); hai sir, this is my java script code, i ask how to clear the printbutton image when after onclicking the print button....  Hi
how to print of hours and minutes of 8725 seconds
how to print of hours and minutes of 8725 seconds  how to print of hours and minutes of 8725 seconds
how to print all colors using awt
how to print all colors using awt  how to print all colors using awt
How to pretty print XML from Java?
How to pretty print XML from Java?  How to pretty print XML from Java
how to print from right to left in java????
how to print from right to left in java????   can anyone pls tell how to print from right to left in java
print
print  How to print JFrame All Componant?   Please visit the following link: http://www.roseindia.net/java/example/java/swing/Print.shtml
How to call print dialog box through JMenuItem?
How to call print dialog box through JMenuItem?  What is the way to call the print dialog box through JMenuItem to print the current page like we can do in javascript by calling window.print() function
how to call the print dialog box through JMenuItem
how to call the print dialog box through JMenuItem  What is the way to call the print dialog box through JMenuItem to print the current page...could you please help me by sending code
How to Print Array in JavaScript
How to Print Array in JavaScript In this section you will learn about Array...=mycity.indexOf["Agra"]//return the index of Agra Now, here is the example how...;<h2>Click to print the array element</h2></p><p><input
How to print a equilateral triangle patren with numbers
How to print a equilateral triangle patren with numbers  I figure out how to use for loop to print the triangle but i couldn't get the exact values as this http://im37.gulfup.com/FzrOb.jpg could you please help me
How to print differences of two text files
How to print differences of two text files  I have the code to compare 2 different text files, however How can I put the difference of 2 text files in other file or print the difrference in the console?? Thanks
how to print HTML using javascript or Jquery
how to print HTML using javascript or Jquery  is there any way to print a document(created using Html and javascript) without using window.print... used Iframe for print, but this only work in chrome, but I have required one
How to print list of files in client system
How to print list of files in client system  have some list of files in server.i just want to print that files in client machine with out opening the file.i give the option for user like printall.if user click printall prints
how can i print the selected content of a frame
how can i print the selected content of a frame  hello sir, I am designing a bill calculate program. I want to print the bill in crystal form. I want to skip all the text fields shapes and all the button from the frame.. but all
How to print the following output using c program
How to print the following output using c program  1) 4 3 4 2 3 4 1 2 3 4 2) A B C D E F G H I J
Print
into the stream and, as opposed to print() method, gets you to the new line after the text
how to check and print the no of times an integer is repeated in an array
how to check and print the no of times an integer is repeated in an array  how to check and print the no of times an integer is repeated in an array??? suppose my input is 2 4 2 5 2 4 3 4 5 2 then my output should be 2-4
how to print all possible combination that sum to zero??
how to print all possible combination that sum to zero??  ?.... Print all possible combinations that sum to zero Example Enter a num : 7 1... each of the digits so that the resultant sum is zero. Print all posible
How to Manipulate List to String and print in seperate row
How to Manipulate List to String and print in seperate row  I am trying to export the 4 columns with the below code.the last column organization...,UserName,WorkforceID,Organization dthomas,dthomas001,12345,Finance,HR How do i
how to fill up a form automaically from database and print it
how to fill up a form automaically from database and print it  sir,i...)should automatically fill up in the form and on cliking print button it shoulg give a print out. i need code for this in jsp .plsss help me sir   Have
how to fill up a form automaically from database and print it
how to fill up a form automaically from database and print it  sir,i...)should automatically fill up in the form and on cliking print button it shoulg give a print out. i need code for this in jsp .plsss help me sir   Have
how to fill up a form automaically from database and print it
how to fill up a form automaically from database and print it  sir,i...)should automatically fill up in the form and on cliking print button it shoulg give a print out. i need code for this in jsp .plsss help me sir   Have
how to fill up a form automaically from database and print it
how to fill up a form automaically from database and print it  sir,i...)should automatically fill up in the form and on cliking print button it shoulg give a print out. i need code for this in jsp .plsss help me sir   Have
how to fill up a form automaically from database and print it
how to fill up a form automaically from database and print it  sir,i...)should automatically fill up in the form and on cliking print button it shoulg give a print out. i need code for this in jsp .plsss help me sir   Have
how to sort the elements of hashmap and to print output the key and the value attached to it
how to sort the elements of hashmap and to print output the key and the value attached to it  how to sort the elements of hashmap and to print output the key and the value attached
how to write a function to print for finding the longest palindrome in the given string
how to write a function to print for finding the longest palindrome in the given string  how to write a function to print for finding the longest palindrome in the given string
viewing the ms word in print layout from jsp - Java Beginners
viewing the ms word in print layout from jsp  Hi all, I am trying to export ms word from jsp in print layout format.I used the code... is to open in print layout format. If u have any code for converting into print
how to print crystal report from java - Java Beginners
how to print crystal report from java  I want to know -way to print crystal report from java? -which jar are needed to import? I am new at java..., formatted data into your JSP pages * Reduce application maintenance churn
Take print out from printer at client machienusing jsp - JSP-Servlet
Take print out from printer at client machienusing jsp  Sir/Mam I want do is to take out print out of my report which will be created from the Mysql database with out displaying him/her the results or report from the printer
how to fill up a form automaically from database and print it
how to fill up a form automaically from database and print it  sir,i...)should automatically fill up in the form and on cliking print button it shoulg give a print out. i need code for this in jsp .plsss help me sir   Here
How to implement link in Web app lead to report with print and save features
How to implement link in Web app lead to report with print and save features   Hi friends, I developed a web application based on Java MVC... to report. That report should allows to save a report as PDFprint or print
Advertisements
 

 

 

DMCA.com