Have to display a dynamic table on specific height of JSP page

I have large data.
I have to show this data in dynamic table on jsp page.
the JSP page is logically divided in different pages (as this page is used for printing on specified size of page)
I can only display atmost 12 single rows on one page
but some times text of one column of row become so large that rows expands vertically and occupies space of 2 or 3 rows (thats why now i have to display 8 or 9 rows on first page and then remaining on next )
becoz of this i cant implement this check (only show 12 rows on a page).
so what can i do to show specified height of table on one page and remaining move to next page.

hi,
its not so easy ...i had this problem once befor 2 months in the work
i think u have to implement a Controller.java class that controll the iterating between pages ...
u should have an pageIndex and just play with this index (increment and decrement)

Similar Messages

  • Dynamic table on specific height of JSP page

    I have large data.
    I have to show this data in dynamic table on jsp page.
    the JSP page is logically divided in different pages (as this page is used for printing on specified size of page)
    I can only display atmost 12 single rows on one page
    but some times text of one column of row become so large that rows expands vertically and occupies space of 2 or 3 rows (thats why now i have to display 8 or 9 rows on first page and then remaining on next )
    becoz of this i cant implement this check (only show 12 rows on a page).
    so what can i do to show specified height of table on one page and remaining move to next page.

    This is an impossible requirement. Page, font and element height is not only browser dependend, but also depending on the settings of the user. Some users will override the font size to be smaller or bigger using a browser option, resizing your table accordingly. Mac fonts might have different sizes if the fonts are antialiased, etc.
    You'd have more success if you could output the table as PDF, there are far more table spacing options available, it's portable and you have 100% control over the output. Check out the iText API for example. The only problem with this is that the PDF will be opened by a PDF viewer which you cannot control, so you cannot make it automatically print.

  • Help Required  !!! -- Dynamic table on specific height of JSP page

    I have large data.
    I have to show this data in dynamic table on jsp page.
    the JSP page is logically divided in different pages (as this page is used for printing on specified size of page)
    I can only display atmost 12 single rows on one page
    but some times text of one column of row become so large that rows expands vertically and occupies space of 2 or 3 rows (thats why now i have to display 8 or 9 rows on first page and then remaining on next )
    becoz of this i cant implement this check (only show 12 rows on a page).
    so what can i do to show specified height of table on one page and remaining move to next page.

    This is an impossible requirement. Page, font and element height is not only browser dependend, but also depending on the settings of the user. Some users will override the font size to be smaller or bigger using a browser option, resizing your table accordingly. Mac fonts might have different sizes if the fonts are antialiased, etc.
    You'd have more success if you could output the table as PDF, there are far more table spacing options available, it's portable and you have 100% control over the output. Check out the iText API for example. The only problem with this is that the PDF will be opened by a PDF viewer which you cannot control, so you cannot make it automatically print.

  • How to retrieve multiple data from table and represent it in jsp page

    Hi
    The below JavaScript code is used to add row in the table when I want to add multiple row data into table for single entry no field.
      <html>  function addRow()
                i++;
                var newRow = document.all("tblGrid").insertRow();
                var oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='srno"+i+"' type='text' id='srno"+i+"' size=10>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='itmcd"+i+"' type='text' id='itmcd"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='itmnm"+i+"' type='text' id='itmnm"+i+"' size='15'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='indentqty"+i+"' type='text' id='indentqty"+i+"' size='10'>";
                oCell = newRow.insertCell();
                    oCell.innerHTML = "<input name='uom"+i+"' type='text' id='uom"+i+"' size='10'><input type='hidden' name='mcode"+i+"'id='mcode"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='packqty"+i+"' type='text' id='packqty"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='packuom"+i+"' type='text' id='packuom"+i+"' size='10'><input type='hidden' name='pack"+i+"' id='pack"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='rate"+i+"' type='text' id='rate"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='dor"+i+"' type='text' id='dor"+i+"' size='0' onClick='"+putdate(this.name)+"'>";           
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='bccode"+i+"' type='text' id='bccode"+i+"' size='10'></td><input type='hidden' name='bcc"+i+"' id='bcc"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='cccode"+i+"' type='text' id='cccode"+i+"' size='10'></td><input type='hidden' name='ccc"+i+"' id='ccc"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='remark2"+i+"' type='text' id='remark2"+i+"' size='20'>";           
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input type='button' value='Delete' onclick='removeRow(this);' />";
               // oCell = newRow.insertCell();
               // oCell.innerHTML = "<input type='button' value='Clear' onclick='clearRow(this);' />";
            }<html>  Then this data are send to the next Servlet for adding into two table.
    My header portion data are added into one table which added only one row in table. while footer section data are added into the no of rows in another table dependent on No. of
    Rows added into jsp page.
    Here is an code for that logic.
    <html>
    ArrayList<String> mucode = new ArrayList<String>();
                                ArrayList<Integer> serials = new ArrayList<Integer>();
                                ArrayList<Integer> apxrate = new ArrayList<Integer>();
                                ArrayList<Integer> srname = new ArrayList<Integer>();
                                ArrayList<String> itcode = new ArrayList<String>();
                                ArrayList<String> itname = new ArrayList<String>();
                                ArrayList<Integer> iqnty = new ArrayList<Integer>();
                                ArrayList<String> iuom = new ArrayList<String>();
                                ArrayList<Integer> pqnty = new ArrayList<Integer>();
                                ArrayList<String> puom1 = new ArrayList<String>();
                               ArrayList<Integer> arate = new ArrayList<Integer>();
                                ArrayList<String> rdate = new ArrayList<String>();
                                ArrayList<String> bcs = new ArrayList<String>();
                                ArrayList<String> ccs = new ArrayList<String>();
                                ArrayList<String> remarkss = new ArrayList<String>();
                                //ArrayList<Integer> qtyrecs = new ArrayList<Integer>();
                                //ArrayList<String> dors = new ArrayList<String>();
                                //ArrayList<String> remarks = new ArrayList<String>();
                     String entryn = request.getParameter("entryno");       
                        String rows = request.getParameter("rows");
                        out.println(rows);  
                        //String Entryno = request.getParameter("entryno");
                       // out.println(Entryno);
                      int entryno = 0,reqqty = 0,srno = 0,deprequest = 0,rowcount = 0;
                                if(!Entryno.equals("")){
                                        entryno = Integer.valueOf(Entryno);
                                if(!rows.equals("")){
                                        rowcount = Integer.valueOf(rows);
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("srno"+i)!=null){
                                                serials.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
                                                out.println(serials.size());
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("srno"+i)!=null){
                                                srname.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
                                out.println(srname.get(0));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("itmcd"+i)!=null){
                                                itcode.add(request.getParameter("itmcd"+i).trim());
                                        } //out.println(itcode.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("itmnm"+i)!=null){
                                                itname.add(request.getParameter("itmnm"+i).trim());
                                        }//out.println(itname.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("indentqty"+i)!=null){
                                                iqnty.add(Integer.valueOf(request.getParameter("indentqty"+i).trim()));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("uom"+i)!=null){
                                                iuom.add(request.getParameter("uom"+i).trim());
                                        }//out.println(iuom.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("mcode"+i)!=null){
                                                mucode.add(request.getParameter("mcode"+i).trim());
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("packqty"+i).equals("")){
                                          pqnty.add(0);
                                        }else
                                            pqnty.add(Integer.valueOf(request.getParameter("packqty"+i).trim()));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("pack"+i)!=null){
                                                puom1.add(request.getParameter("pack"+i).trim());
                                       }else
                                        puom1.add("");
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("rate"+i).equals("")){                                     
                                            arate.add(0);
                                        }else
                                        arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));   
                     /* for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("rate"+i)!=null){
                                                arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));
                              for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("dor"+i)!=null){
                                                try{
                                                        rdate.add(dashdate.format(slashdate.parse(request.getParameter("dor"+i).trim())));
                                                }catch(ParseException p){p.printStackTrace();}
                                        }else
                                           { rdate.add("");}
                                   for(int i=1;i<=rowcount;i++){
                                 if(request.getParameter("bcc"+i)!=null){
                                                bcs.add(request.getParameter("bcc"+i).trim());
                                        }out.println(bcs.get(0));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("ccc"+i)!=null){
                                                ccs.add(request.getParameter("ccc"+i).trim());
                                        }out.println(ccs.get(0));
                                for(int i=1;i<=rowcount;i++){
                                    out.println("remark2");
                                        if(request.getParameter("remark2"+i)!=null){
                                                remarkss.add(request.getParameter("remark2"+i).trim());
                                        }out.println(remarkss.get(0));
                        ArrayList<String> Idate = new ArrayList<String>();
                        for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("dateindent"+i)!=null){
                                                try{
                                                        Idate.add(dashdate.format(dashdate.parse(request.getParameter("dateindent"+i).trim())));
                                                }catch(ParseException p){p.printStackTrace();}
                    String Rdate = dashdate.format(new java.util.Date());
                     String tdate = dashdate.format(new java.util.Date());    
                     // String Indentdate = dashdate.format(new java.util.Date());
                   //  String ApprovedT1 = dashdate.format(new java.util.Date());
                   //  String ApprovedT2 = dashdate.format(new java.util.Date());
                       // String ApprovedT1=" ";
                        //String ApprovedT2="";*/
                    String ApprovedT1= dashdate.format(new java.util.Date());
                   out.println (ApprovedT1);
                      String ApprovedT2=dashdate.format(new java.util.Date());
                       out.println(ApprovedT2);
                    String Indentdate=(dashdate.format(slashdate.parse(request.getParameter("dateindent").trim())));
                       out.println(Indentdate);
                        String Cocode ="BML001";  
                        out.println(Cocode);
                        String Deptcode = request.getParameter("dept1");
                        out.println(Deptcode);
                        String Empcode = request.getParameter("emp");
                        out.println(Empcode);
                        String Refno =request.getParameter("rtype"); 
                         out.println(Refno);
                        String Divcode = request.getParameter("todiv1");
                        out.println(Divcode);
                        String Usercode = "CIRIUS";    
                         String Whcode = request.getParameter("stor");
                        out.println(Whcode);
                        // String Itemgroupcode = request.getParameter("");
                         String Itemgroupcode ="120000";
                         out.println(Itemgroupcode);
                        String Supplytypecode = request.getParameter("stype");
                        out.println(Supplytypecode);
                        String Delcode = request.getParameter("deliverycode");
                        out.println(Delcode);
                        String Itemclass="WS";
                        out.println(Itemclass);
                        // String Itemclass = request.getParameter("iclass");
                       // out.println(Itemclass);
                        String unitcode = request.getParameter("uni");
                        out.println(unitcode);
                         String Todivcode = request.getParameter("todiv1");
                        out.println(Todivcode);
                        String Appxrate = request.getParameter("rate");
                        out.println(Appxrate);
                        String Srno = request.getParameter("srno");
                        out.println(Srno);                
                    /*    String Indqty = request.getParameter("indentqty");
                      out.println(Indqty);*/
                  String Itemcode = request.getParameter("itmcd");
                       out.println(Itemcode);
                       String Othersp = request.getParameter("remark1");
                        out.println(Othersp);
                        String Reqdt = request.getParameter("dor");
                        out.println(Reqdt);
                        String Munitcode = request.getParameter("mcode");
                        out.println(Munitcode);
                        String Packqty = request.getParameter("packqty");
                        out.println(Packqty);               
                        String Packuom = request.getParameter("pack");
                        out.println(Packuom);
                        String Remark2 = request.getParameter("remark2");
                        out.println(Remark2);
                        String BC = request.getParameter("bcc");
                        out.println(BC);
                        String CC = request.getParameter("ccc");
                        out.println(CC);
                        try{
                            st=connection.createStatement();
                            connection.setAutoCommit(false);
                            String sql="INSERT INTO PTXNINDHDR(COCODE,DEPTCODE,EMPCODE,APPROVEDT1,APPROVEDT2,INDDT,ENTRYNO,REFNO,REMARKS,DIVCODE,USERCODE,WHCODE,ITEMGROUPCODE,SUPTYPECODE,DELCODE,UNITCODE,TODIVCODE,ITEMCLASS)VALUES('"+Cocode+"','"+Deptcode+"','"+Empcode+"','"+ApprovedT1+"','"+ApprovedT2+"','"+Indentdate+"',"+Entryno+",'"+Refno+"','"+Othersp+"','"+Divcode+"','"+Usercode+"','"+Whcode+"','"+Itemgroupcode+"','"+Supplytypecode+"','"+Delcode+"','"+unitcode+"','"+Todivcode+"','"+Itemclass+"')";
                            out.println(sql);
                            st.addBatch(sql);
                            for(int i=0;i<serials.size();i++){
                                out.println("Inside the Statement");
                                String query3="test query for u";
                                out.println(query3);
                               String queryx="Insert into PTXNINDDTL(APXRATE,ENTRYNO,BRKNO,INDQTY,ITEMCODE,OTHERSPFCS,MUNITCODE,PACKQTY,PACKUOM,REMARKS,DIMSUBGRPCODE,DIMCODE,REQDT)VALUES("+arate.get(i)+","+entryno+","+srname.get(i)+","+iqnty.get(i)+","+itcode.get(i)+",'"+Othersp+"','"+mucode.get(i)+"',"+pqnty.get(i)+",'"+puom1.get(i)+"','"+remarkss.get(i)+"','"+bcs.get(i)+"','"+ccs.get(i)+"','"+rdate.get(i)+"')";
                               out.println(queryx);
                                st.addBatch(queryx);
                           int[] result=st.executeBatch();
                           connection.commit();
                           for(int k=0;k<result.length;k++)
                           out.println("rows updated by "+(k+1)+"insert sta:"+result[k]+"");
                        catch(BatchUpdateException bue)
                        out.println("error1;"+bue+"");
                        catch(SQLException sql)
                        out.println("error2;"+sql+"");
                        catch(Exception l)
                        out.println("error3;"+l+"");
    </html>
       Now I looking for to retrieve this footer section data available in multiple rows from footer table and present it in jsp page .
    I am finding difficulties in how to show this multiple row data for dynamic no of rows .i.e. variable no. of rows.
    I have able to show the data in Header portions of page in this ways
    here i am adding the part of code which shows the data from header part of table i.e from Header table
      <html>
    <h2 align="center"><b>Indent Preparation</b></h2>
        <div align="left">
            <table width="849" border="0" cellspacing="3" cellpadding="3" align="center">
                <tr>
                    <td ><div align="left"><b>Indent No.</b></div></td>
                    <td ><label>
                            <input name="indentno" type="text" id="indentno" size="15" value="" /><input type="hidden" name="no" id="no">
                    </label></td>
                    <td ><div align="center"><strong>Indent Date</strong></div></td>
                    <td ><label>
                            <div align="center">
                                <input name="dateindent" type="text" id="dateindent"value="<%=date1%>"/><input type="hidden" name="no" id="no">
                            </div>
                    </label></td>
                    <td> </td>
                    <td><div align="right"><strong>Entry No.</strong></div></td>
                     <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
            <td><input type="text" value="<%=hdrcode.get(3)%>" size="10"></td>
    <%}else{%>
                   <td><input type="text" name="entryno" id="entryno" value="<%=entryNo%>"/></td>
                             <%}%>
                            <div align="right"></div>
                </tr>
                <tr>
                    <td><b>Division</b></td>
                    <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
    <td><input type="text" value="<%=hdrdetails.get(9)%>" size="20"</td>
    <td><input type="hidden" name="div1" id="div1" value='<%=hdrcode.get(10)%>'></td>
    <%}else{%>
                   <td><input type="text" name="div" id="div" /></td>
                   <td><input type="hidden" name="div1" id="div1" /> </td>
              <%}%>
                    <td> </td>
                    <td> </td>
                    <td><div align="right"><strong>Unit</strong></div></td>
                   <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
    <td><input type="text" value="<%=hdrdetails.get(14)%>" size="20"</td>
    <td><input type="hidden" name="uni" id="uni" value='<%=hdrcode.get(12)%>'></td>
    <%}else{%>
                   <td><input type="text" name="unit" id="unit" /></td>
                   <td><input type="hidden" name="uni" id="uni" /> </td>
              <%}%>
                </tr>
                <tr>
    </html>
      Any suggestion on any above works is highly appreciated.
    Thanks and regards
    harshal

    Too much code. It's also not well intented nor formatted. I don't see a question either or it got lost in that heap of unformatted code.
    I will only answer the question in the thread's subject:
    How to retrieve multiple data from table and represent it in jsp pageTo retrieve, make use of HttpServletRequest#getParameterValues() and/or #getParameter().
    To display, make use of JSTL's c:forEach.

  • How do I Display a string from a servlet into a JSP Page???? NEED HELP!!!!

    Hi guys,
    How do I Display a string from a servlet into a JSP Page...
    Ive tried so many bloody things!.....
    Simply.
    I get text from JSP. The servlet does what ever it does to the string.
    Now. Ive create sessions and bean things,.... how the hell do I display it in a text box... I can display on the screen.. but not in the text box.!!!
    please help!!!

    hmmm, I dont really like using JSP programming, u should be using JAVA..
    the way to do it is:
    Call and cast to the bean like this:
    <%@ page import="beans.*" %>
    <% //cast to bean get request create object
    userNameBean u= (userNameBean) request.getSession().getAttribute("userNameBean");
    then... all you do is call it like this:
    <input type="text" name="firstName" value="<%= u != null? u.getFirstName(): "" %>">
    this is the real programmers way,,,
    chet.~

  • How to give color of particular cell in alv list display for dynamic table

    Dear Experts,
    i want to give color of a particular cell in alv list display (reuse_alv_list_display). Here i am passing data through dynamic table?

    Hi,
    Se this:
    DATA: lt_color    TYPE lvc_t_scol WITH HEADER LINE.
    DATA: BEGIN OF data_tab OCCURS 0.
             tabcolor     TYPE   lvc_t_scol,
          END OF data_tab.
    * Befone ALV call
      alv_layout-coltab_fieldname  = 'TABCOLOR'.
    * For each row in data_tab
    REFRESH: lt_color.
    CLEAR: lt_color.
    lt_color-color-col = 6.
    lt_color-color-int = 1.
    lt_color-fname = FIELD1'.
    APPEND lt_color.
    lt_color-color-col = 2.
    lt_color-color-int = 0.
    lt_color-fname = 'FIELD2'.
    APPEND lt_color.
    data_tab-tabcolor[] = lt_color[].
    append data_tab.
    Best regards,
    Leandro Mengue

  • Sorting Dynamic Table by specific field

    Hi guys,
    I need to sort a dynamic table (without header line) by a certain field in order to achieve the client requierment. I really don't have any clue about how can i do this, because, it appears that is not possible to declarate a field symbol type standar table with a headerline...
    Regards,
    Eric

    Try this:
    TABLES T001.
    DATA: T_T001 LIKE STANDARD TABLE OF T001.
    FIELD-SYMBOLS: <TABLE> TYPE TABLE.
    DATA: FIELD1(30),
          FIELD2(30),
          FIELD3(30).
    SELECT * FROM T001 INTO TABLE T_T001.
    ASSIGN T_T001[] TO <TABLE>.
    FIELD1 = 'BUTXT'.
    SORT <TABLE> BY (FIELD1) (FIELD2) (FIELD3).
    LOOP AT <TABLE> INTO T001.
      WRITE: / T001-BUTXT, T001-BUKRS.
    ENDLOOP.
    U have to decide how many fields can be used to sort the table: in my example I suppose the user can use max 3 fields in the same time.
    The ALV use this way to sort the table.
    Max

  • Displaying pagenumbers in table of contents in the 2nd page of a smartform.

    We have a requirement where we need to display "Table of contents" with headings and corresponding page numbers .The page numbers for the headings need to be picked up at run time.But the "Table of contents" is in the second page whereas the headings appear in the later pages.So it is difficult to display the respective page numbers.Can anybody give me a solution for this.

    Hi.
    Perhaps you could try this.
    In the main window: When you print out the heading you can get the page number you are currently on. Save that number in a table/structure for each header.
    Then on the second page you could have a "Late processing" window and print your headers with the page numbers you have stored in your table/structure.
    I think this will work, or at least give you a clue on how to do it.
    BR
    Niklas

  • Display multiple Images from a DB on a JSP Page!

    Hi all, please give me your solution, thanks. I have many images, stored in Oracle database (BLOB), How to display all of them (images) on a JSP page? I have a working solution that only shows one image based on the specific image-name passed. But if no image found in the Database with that image-name then I want to show all the images at once on a JSP page. Can someone help please. Follwing are the code snippets:
    Here is the JSP page that calls the servlet to show the images:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <title>untitled</title>
      </head>
      <body valign=center>
          <table>
            <tr>
                <td>
                    <img src="/test-testimgs-context-root/servlet/test1.images.servlet.GetImage">
                </td>
            </tr>
          </table>
      </body>
    </html>
    Here is the code that resides in the service method of GetImage servlet:
    public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
        OutputStream stream = response.getOutputStream(); 
        Blob imgBlob = null;
        ResultSet rs = null;
        byte[] imbBytesAry = null;
        try
            ImageTest imgtest = new ImageTest();
            rs = imgtest.get("img1.tif");
            if(rs != null)
                while(rs.next())
                    imgBlob = rs.getBlob(1);
                    int len = new Integer( new Long( imgBlob.length()).toString() ).intValue();
                    imbBytesAry = imgBlob.getBytes(1,len);
                    if (imbBytesAry.length == 0 || imbBytesAry == null)
                        noImageFound(request, response); 
                    else
                        stream.write(imbBytesAry);
            else
                noImageFound(request, response);
        catch (Exception e)
            noImageFound(request, response);
    Here is the code that resides in the get method of ImageTest class:
    public ResultSet get(String fileName) throws DatabaseConnectionException, SQLException, Exception
    Connection connection=null;
    ResultSet rs = null;
    ResultSet rs1 = null;
    Blob imgBlob = null;
    try
        connection = new ConnectionProvider().getCConnection() ;
        connection.setAutoCommit(false);
        Statement stmt = connection.createStatement();
        String sql = "SELECT IMG FROM IMAGE_TABLE WHERE IMAGE_NAME = ? "; 
        PreparedStatement pstmt = connection.prepareStatement(sql);
        pstmt.setString(1,fileName);
        rs = pstmt.executeQuery();
        boolean flag = rs.next();
        if(flag)
            rs.beforeFirst();
        else
            sql = "SELECT IMG FROM IMAGE_TABLE"; 
            rs1 = stmt.executeQuery(sql);
            boolean flag_all = rs1.next();
            if(flag_all)
                rs1.beforeFirst();
            else
                rs1 = null;
        return rs;
    }As you see in the JSP page I am calling GetImage servlet, whose service method does all the processing i.e. calls ImageTest get method that queries the database and returns the result. Eventually what I would like is to pass the filename along with other parameters from JSP page and the servlet returns the images based on that. Currently I have just hard coded a value for testing puposes. Any help is appreciated.
    Thanks

    Hi all, please give me your solution, thanks. I have many images, stored in Oracle database (BLOB), How to display all of them (images) on a JSP page? I have a working solution that only shows one image based on the specific image-name passed. But if no image found in the Database with that image-name then I want to show all the images at once on a JSP page. Can someone help please.
    this is the code
    <form name="a" action="" method="post">
    <%
    rs1 = st1.executeQuery(select1);
    rs1.next();
    while(rs1.next())
    %>
    <table>
    <tr><td>
    <%
    Blob objBlob[] = new Blob[rs1.getMetaData().getColumnCount()];
         for (int i = 0; i <= rs1.getMetaData().getColumnCount(); i++)
               objBlob[i] = ((OracleResultSet)rs1).getBLOB(1);
              InputStream is = objBlob.getBinaryStream();
    byte[] bytearray = new byte[4096];
    int size=0;
    response.reset();
    response.setContentType("image/jpeg");
    response.addHeader("Content-Disposition","filename=getimage.jpeg");
    while((size=is.read(bytearray))!= -1 )
    response.getOutputStream().write(bytearray,0,size);
    response.flushBuffer();
    is.close();
    out.println("hhhhhhh");
    %>
    </table>
    <%
    rs1.close();
    //con.close();
    %>
    </form>

  • Can we create a pivot table of Excel in a JSP page using POI

    Hello,
    I want to know whether we can create a pivot table of excel sheet in a jsp page using POI package from apache.
    thank you.

    Hi Alex,
    Many thanks for replying.
    I followed the link, but unable to get correct output.. I have shared the template earlier. I can share the template once again.
    It would be grateful if you give me share the working template with table of content.

  • Looking to load embedded PDF at a specific height on the page

    I'm looking to load a PDF, scrolled down to a predetermined height on the page. I'm familiar with the 'page' param using <embed>, which will load a particular page, but I'd like to be able to have the document load such that it's displaying a particular portion beginning about 3" from the top. I'd even be happy with being able to load the vertical center of the page. Is there code or an application that will let me do that?
    Thanks!

    Not that I know of, but I have completely given up on Pages for anything. For labels I use Avery software which is free http://www.avery.com/avery/en_us/Templates-%26-Software/Software/Avery-Design--P rint.htm

  • Display more than one BI bean graph on JSP page

    Hi,
    I want to show BI Beans graphs on a JSP page (just the Jdev 10.1.2 included components, not the OLAP backed ones) but I want to show a different graph for each row iterated in the JSP so I'll end up with up to 20 graphs on the screen.
    Currently I can have it showing the 20 graphs quite happily, but they're all the same (that is, they all look the same but they have different IDs). I note from the way I understand this works that they're all being made off the currentRow of the viewobject. I want to somehow increment the current row for the data as the view iterator advances. I could break the model 2 separation and do it with java scriptlet in the JSP but this is my least favoured way. Is there some other way I can have all the graphs prepared from a struts action which does advance through the data and then goes on to show the jsp?
    I'm guessing this is somewhat related to a master detail graph - except when I tried to run with one I got some nasty exceptions within the graph tag library. I'm not sure that's what I want anyway as I need to format the page as a report so I need each graph to be a separate image.
    Any help appreciated
    - Nathaniel

    What I'm after is a way to create the BI Beans graphs supplied with Jdev 10.1.2 ni a java class rather than a JSP. Is there a way to do this?

  • Multiple Models & Conditional Display in Dynamic Table.

    Hi
    There are 5 models pointing to different systems. The user will randomly select the system and accordingly the models will get executed.
    My issue is in the second screen I need to populate a table which should display the data from multiple models at the same time.. I need to loop trough the models and check, the search term entered by the user, in which all system the same is present and accordingly I need to display in table...
    Please help me by placing some sample code for looping in multiple output nodes and create table dynamically and display the data in the coloumn...Coloumn numbers are fixed.....
    Regards
    SU

    Hi
    I suggest to create a value node to show the results in a view.
    and loop at all the model nodes and when match found create an new element for the table and add it to the table node.
    This is the code to Create Table and its columns dynamically.
    place the code in wdDoModifyView()
    IWDTable <tableref> = (IWDTable) view.createElement(IWDTable.class,"<tablename>");
    <tableref>.bindDataSource(wdContext.node<node>().getNodeInfo());
    IWDTableColumn <colref> =(IWDTableColumn)view.createElement(IWDTableColumn.class,"F");
    IWDInputField inf = (IWDInputField )view.createElement(IWDInputField.class,"d");
    inf.bindValue(wdContext.node<node>().getNodeInfo().getAttribute("<attribute>"));
    <colref>.setTableCellEditor(inf);
    <tableref>.addGroupedColumn(<colref>);
    IWDTransparentContainer <grp> =(IWDTransparentContainer)view.getElement("RootUIElementContainer");
    <grp>.addChild(<tableref>);
    Regards
    Abhimanyu L

  • Dynamic table needs to break to 2nd page

    Hi,
    Still consider myself clueless when it comes to dynamic properties in a form.
    I have a user interface that collects and stores data for some of our business accounts. A chunk of these fields are free-form text boxes.
    I need the ability to simply, neatly display all information saved or entered in the user interface.
    I'm working with LiveCycle and am required to have a standard header/footer on each page that consists of fields that will also populate with data from the user interface.
    What I've tried is to set up the fields as a table. I have the ability to extend the field according to the amount of text entered, but have problems when the field should break to the next page.
    I've allowed multiple lines for the text boxes, and set the table row to "expand to fit". Unfortunately I can't figure out how to get the system to accept or have available the setting Allow Page Breaks with Content.
    When there is enough text to cause the field to break over a field, it simply takes the entire section to the next page.
    Any help or suggestions would be welcomed.
    Karen

    Input fields cannot be broken across pages in version 8.x and before.
    That is why it is trying to keep the whole field together on a single page.
    Sorry

  • Linking to a specific frame from JSP page

    I am trying to link to site that has frames. I want to load a specific jsp in frame 3. Does anyone know how to pass the target and source values? I have been looking for tutorials unsuccessfully.

    You can not point to a specific frame ina document from an external document.Your best bet might be to pass the parameters using URL and on the recieving end write some javascript to parse the url adn if it has a parameter then process that else just load standard document.
    Khalid

Maybe you are looking for

  • Simple RFC call not returning results

    Hi, I have created a VERY simple Dynpro project to return the results of a simple RFC.  I've created the JCO connections and they test fine but the RFC doesn't return results to my application. Steps: 1. create the project 2. import the RFC Adaptive

  • Google Maps in the UAE

    Hi guys, Any idea when the Google Maps will be available in UAE? I tried changing the country of my iTunes account to US, it didn't work. I can see the app but can't download it. So, any update? Cheers, Iraklis

  • Apps schema objects

    dear all,            i want to compile 3 package bodies in apps schema .how can i compile these 3 package bodies ? do i  need to use adadmin utility or compile individually from sql prompt as shown below? sql>conn /as sysdba sql>alter package <SCHEMA

  • Virus from Adobe Reader?

    Hi all, i am a new member here, and the reason i am posting this is because i suspect i have gotten a virus from updating my adobe reader. I'm just an everyday user with limited knowledge of computer know-how, so please pardon me if this is a silly p

  • Not enough space on time machine??? what should I do?

    How do I clear up space on my one terrabite airport extreme??