Display multiple rows of datas from database in IDM forms

Hi,
I asked the same question in this forum before and some one answered to use 'FieldLoop'.I tried using that it didn't work.I using IDM version 5.
Heres the code...
EmployeeList is a supposed to be java array which contains java bean object,( EmployeeList -->raStagingObject-->getFname) since it doesn't work I thought I might try with simple list..I might be missing something...I would really apprecite if someone cld let me know...
<Field name='employeeList'>
<Default>
<block>
<defvar name='EmployeeList'>
<null/>
</defvar>
<set name='EmployeeList'>
<list>
<s> Red</s>
<s> Blue</s>
<s> Green</s>
<s> Yellow</s>
</list>
</set>
</block>
</Default>
</Field>
<Field>
<Display class='SimpleTable'/>
<FieldLoop for='name' in='EmployeeList'>
<Field name='XYZ'>
<Display class='Label'>
<Property name='value'>
<ref>name</ref>
</Property>
</Display>
</Field>
</FieldLoop>
</Field>
I also tried while loop(not sure whether which is the best way to approach...but kind of tried this didn't work too...)
Let me know what cld possibily work...
<Field name='while'>
<Default>
<block>
<defvar name='length'>
<null/>
</defvar>
<defvar name='counter'>
<null/>
</defvar>
<set name='length'>
<invoke name='size'>
<ref>EmployeeList</ref>
</invoke>
</set>
<set name='counter'>
<i>0</i>
</set>
<set name='length'>
<sub>
<ref>length</ref>
<i>1</i>
</sub>
</set>
<while>
<cond>
<lte>
<ref>counter</ref>
<ref>length</ref>
</lte>
<block>
<Field>
<Display class='Html'>
<Property name='html' value='<td>'/>
</Display>
</Field>
<Field name='myTextField'>
<Display class='Html'>
<Property name='html' value='mytext'/>
</Display>
</Field>
<Field>
<Display class='Html'>
<Property name='html' value='</td>'/>
</Display>
</Field>
<set name='counter'>
<add>
<ref>counter</ref>
<i>1</i>
</add>
</set>
</block>
</cond>
</while>
</block>
</Default>
</Field>
Instead of html I also tried 'Label' and did invoke on EmployeeList's raStagingObject which is a java bean.I didn't work either.
Thanks,
Kaiths

Hi,
I asked the same question in this forum before and some one answered to use 'FieldLoop'.I tried using that it didn't work.I using IDM version 5.
Heres the code...
EmployeeList is a supposed to be java array which contains java bean object,( EmployeeList -->raStagingObject-->getFname) since it doesn't work I thought I might try with simple list..I might be missing something...I would really apprecite if someone cld let me know...
<Field name='employeeList'>
<Default>
<block>
<defvar name='EmployeeList'>
<null/>
</defvar>
<set name='EmployeeList'>
<list>
<s> Red</s>
<s> Blue</s>
<s> Green</s>
<s> Yellow</s>
</list>
</set>
</block>
</Default>
</Field>
<Field>
<Display class='SimpleTable'/>
<FieldLoop for='name' in='EmployeeList'>
<Field name='XYZ'>
<Display class='Label'>
<Property name='value'>
<ref>name</ref>
</Property>
</Display>
</Field>
</FieldLoop>
</Field>
I also tried while loop(not sure whether which is the best way to approach...but kind of tried this didn't work too...)
Let me know what cld possibily work...
<Field name='while'>
<Default>
<block>
<defvar name='length'>
<null/>
</defvar>
<defvar name='counter'>
<null/>
</defvar>
<set name='length'>
<invoke name='size'>
<ref>EmployeeList</ref>
</invoke>
</set>
<set name='counter'>
<i>0</i>
</set>
<set name='length'>
<sub>
<ref>length</ref>
<i>1</i>
</sub>
</set>
<while>
<cond>
<lte>
<ref>counter</ref>
<ref>length</ref>
</lte>
<block>
<Field>
<Display class='Html'>
<Property name='html' value='<td>'/>
</Display>
</Field>
<Field name='myTextField'>
<Display class='Html'>
<Property name='html' value='mytext'/>
</Display>
</Field>
<Field>
<Display class='Html'>
<Property name='html' value='</td>'/>
</Display>
</Field>
<set name='counter'>
<add>
<ref>counter</ref>
<i>1</i>
</add>
</set>
</block>
</cond>
</while>
</block>
</Default>
</Field>
Instead of html I also tried 'Label' and did invoke on EmployeeList's raStagingObject which is a java bean.I didn't work either.
Thanks,
Kaiths

Similar Messages

  • Update multiple rows with datas from the same table

    i have a table like
    name version value1 value2
    2 A 4,31 3,5
    3 A 3,45 10
    2 B 6,97 12
    4 B 12 16
    so name + version is unique
    i have to update the datas value1 and value2 ( version A) with the datas from version B where the name ( VersionA) = name version B
    i.e the result should be
    name version value1 value2
    2 A 6,97 12
    3 A 3,45 10
    2 B 6,97 12
    4 B 12 16
    is it possible to do this in sql? ( sql. 8.1)

    ... if your table does not contain exactly what you expect you could get:
    'single row sub-query returns more than one row'
    To prevent that, put a unique index on (name, version). If this combination is not always unique, you will need to cater for the possibility in the update statement.

  • How to Retrieve data from database into another form ?

    Good Day!
    Am currently new at JSP. I've been studying it for awhile and still getting the hang of it. We are working on a project.
    Editing a given data. We have to retrieve the given data and post it to another form "Editing form".
    Since we can retrieve data using JSP but how are we going to post it to another form? I mean how are we going to transfer data from one form to another?
    Can anyone help me with codes please..

    The client is a web browser.
    The client submits a request (click a link, visit a form)
    The server gets to respond to this
    - look at request parameters from the client
    - access database
    - produce resulting html page
    - send page back to client.
    The standard pattern is to retrieve data from the database in java code, and then load that data into a bean.
    You then make that bean available as an attribute
    It is then available for use in your JSP - either <jsp:useBean> tag or using ${ELexpressions}
    All you can pass from the client to the server is request parameters - which are always strings.
    Draw a picture of where the information is, and the information flows. Very rarely does it go directly from one "form" to another.
    Cheers,
    evnafets

  • Display BLOB File (pdf format) from database inside Oracle Form (6i)

    hi all.
    Apologies for a primitive question owing to the fact that i m new to development. I have a requirement to display a pdf document with in an oracle form. i want to know is there any such control for that? or any hint how to go about it?
    thanks in advance

    Here I have found my jsp script...
    How I get the PDF?
    I call my script from pl/sql with
    web.show_document('http://my_server/getblob.jsp?id=' || id_from_my_blob_table || '&baza=myhost:1521:sid','_blank');
    <%@ page contentType="text/html;charset=windows-1250"%>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="java.text.*" %>
    <%@ page import="oracle.jdbc.driver.OracleDriver" %>
    <%@ page import="oracle.jdbc.driver.OracleResultSet" %>
    <%
    Connection con = null;
    Statement stmt = null;
    ResultSet rs= null;
    oracle.sql.CLOB clob = null;
    oracle.sql.BLOB blob = null;
    String datoteka = "";
    String host = "http://" + request.getHeader("host") + "/";
    %>
    <!--Peter Valencic 2003 -->
    <html>
    <head>
    <title></title>
    </head>
    <%
       String tip ="";
       String id ="";
       String baza ="";
       String shema ="";
    try
       id = request.getParameter("id");
       baza = request.getParameter("baza");
       shema = request.getParameter("shema");
       if (request.getParameter("id")== null)
          throw new Exception("id= null");
       else if(request.getParameter("id").equals(""))
          throw new Exception("id= null");
       if (request.getParameter("baza")== null)
          throw new Exception("baza= null");
       else if(request.getParameter("baza").equals(""))
          throw new Exception("baza= null");
       if (request.getParameter("shema") == null)
         shema ="";
       else if (request.getParameter("shema").equalsIgnoreCase(""))
         shema="";
       else
         shema =shema + ".";
    catch(Exception e)
       out.println("Priąlo je do napake: " + e.toString());
       return;
          try
                Class.forName("oracle.jdbc.driver.OracleDriver");
                con = DriverManager.getConnection("jdbc:oracle:thin:@"+baza,"your_user","your_password");
                stmt =con.createStatement();
                rs = stmt.executeQuery ("Select * from "+shema+"DOK_VSEBINA_DOKUMENTA_BLOB where ID="+id);
                boolean podatkib = rs.next();
                if (!podatkib)
                   out.print("<li>Ni podatkov za  ID="+id);
                   return;
                blob = ((oracle.jdbc.OracleResultSet)rs).getBLOB("VSEBINA");
                datoteka = rs.getString("NAZIV_DATOTEKE").toUpperCase();
                   File blobFile = new File(application.getRealPath("/uploads/blob")+"/"+datoteka);
                blobFile.createNewFile();
                InputStream podatki = blob.getBinaryStream();
                FileOutputStream strBlob= new FileOutputStream(blobFile);
                int size = blob.getBufferSize();
                byte[] buffer = new byte[size];
                int length = -1;
                while ((length = podatki.read(buffer)) != -1)
                   strBlob.write(buffer,0,length);
                podatki.close();
                strBlob.close();
                con.close();
                out.print("<li>"+host+"in2/uploads/blob/"+datoteka);
                   response.sendRedirect(host+"in2/uploads/blob/"+datoteka);
                //odpremo z jsp-stranjo datoteko..
                //response.sendRedirect("");
          catch(Exception blobException)
             out.print("<li>(BLOB)Napaka pri prebiranju podatkov:</li>"+blobException.toString());
             return;
    out.println("konec..");
    %>
    <body>
    <form method="post">
    Vnesi ID
    <input type=text name="id">
    <li> <input type=submit name="potrdi" >
    </form>
    </body>
    </html>If you look my "old" script..
    first it get 2 parameters baza= database (ip:port:sid), id= id from my table (PK)
    at the end of my script I have:
    response.sendRedirect(host+"in2/uploads/blob/"+datoteka);
    this redirect will redirect you to your file stored on server side..
    Because IE knows what file it must open it will open it with PDF reader...
    hope this help you..
    Edited by: peterv6i.blogspot.com on May 14, 2012 11:14 AM

  • Insert multiple rows into dB from one dynamic HTML form problem

    Hi,
    - I have form which has dynamically generated text fields so I don't want to hard code the field names into the servlet
    - A user will fill in one or more of the text boxes with a number and submit to the servlet (the name of the field represents an item ID, the value represents a quantity the user wants of that item).
    - The servlet needs to insert a new record into a table for each field that is not null.
    My question is how!
    If I send as an array or string, how will the servlet know that each submitted field needs to be inserted as a new record as opposed to one long record?
    I know I'll need to use a loop of somekind; how will I know how long to loop for if the number of 'not null' fields is not static? I need to get a value for the number of 'not null' fields from the form before the loop starts I think but don't know how...
    Also, should I call an SQL procedure that has an insert-loop OR should I have the servlet loop a call to a single insert statement? (am I making sense!?)
    Anyway, I've seen many examples where a submitted form updates/inserts one record into a table but never any for multiple records at one time. I'm using a Tomcat/Oracle set up, and I'm "New to Java"...
    Many thanks in advance.

    sorry, but I dont' understand very well what do you want to do!
    In any case if you want to retrieve all parameters (and you don't know what they are), you can use a general cosde like this:
    Enumeration names= request.getParameterNames();
    while(names.hasMoreElements()) {
    // in 'name' you store the name of the parameter
    String name = (String) names.nextElement();
    // in 'value' you store it's value
    String value = request.getParameter(name);
    remember that ALL parameter values can't be null (if they are void their value is "").
    The only case that you can get a null value is when you try to access a non existing parameter (like request.getParameter("pwqjsak"));
    I hope this helps! Else try to give me more info about your problem

  • How to display data from Database individually??? Anyone can help ?

    HI,
    i i had select a row of data from database using ,
    /* Query * From Table RESOURCEORDER where po = selected no and project = selected project */
         public ResultSet getAllData() throws SQLException
         getConnection();
         Statement stmt = conn.createStatement();
         ResultSet rs = stmt.executeQuery("SELECT * FROM RESOURCEORDER WHERE PROJECT = '" + getSelProject() + "' and PURCHASEORDERNO = '" + getPo() + "'" );
         return rs;
    After that , how do i display the data individually ?
    Eg select data is ('projectA','7891203-1', '10-4-2005','lcd',2000,'121-45217-8','electrical','pending','donwong')
    i want to display them individually, like this in a page
    Projectname: /* should display the Project A*/
    P.O no:
    Date:
    Order:
    Cost:
    Acc no:
    Type:
    status:
    Orderedby:
    Can anyone help ? cos i'm new to JSP ......Thanks alot!!!!!
    Regards,
    khim

    I assume PO being a unique key, will always return 1 row from db.
    public String[] getAllData() throws Exception
    getConnection();
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM RESOURCEORDER WHERE PROJECT = '" + getSelProject() + "' and PURCHASEORDERNO = '" + getPo() + "'" );
    String [] returnValue = new String[9];
    while(rs.next())
    returnValue[1] = rs.getString("colname");
    returnValue[2] = rs.getString("colname");
    ///and so on
    return returnValue;
    }Once you get that you could individually view it by setting a loop to run through the returned array.
    Hope it helps

  • How to access next record from database on to form

    hi
    i have written the following piece of code to retrieve data from database oon to form...
    Try
                rset = oDICompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                query = "Select * from [@TEST]  where Code =  ('" + oform.Items.Item("6").Specific.value + "') "
                rset.DoQuery(query)
            Catch ex As Exception
                SBO_Application.MessageBox(ErrorToString)
            End Try
            '  oform.Items.Item("6").Specific.value = rset.Fields.Item("Code").Value
            oform.Items.Item("7").Specific.value = rset.Fields.Item("Name").Value
            oform.Items.Item("8").Specific.value = rset.Fields.Item("U_Sal").Value
    but i can see only one record on my form controls.... i have placed on more button called " Next" so that i can access next records from DB when i click on "Next" button...
    Public Sub NextRecords()
    Try
         rset.MoveFirst()
                While Not rset.EoF
                 '   oform.Items.Item("6").Specific.value = rset.Fields.Item("Code").Value
                   oform.Items.Item("7").Specific.value = rset.Fields.Item("Name").Value
                  oform.Items.Item("8").Specific.value = rset.Fields.Item("U_Sal").Value
                   rset.MoveNext()
                End While
                rset.MoveNext()
          Catch ex As Exception
               SBO_Application.MessageBox(ErrorToString)
          SBO_Application.MessageBox("Updated")
           End Try
    End sub
    i'm not able to access next records...
    plz provide me the solution and code for this how to handle this scenario....

    From your question and code sample given, I think the problem is you are seeing only the last record when pressing the next button.
    In the Next button press, you are coded such a way that it will populate the last record.
    Try removing the do..While.. loop and simply code like
    if Not rset.EoF
    rset.MoveNext()
       oform.Items.Item("6").Specific.value = rset.Fields.Item("Code").Value
       oform.Items.Item("7").Specific.value = rset.Fields.Item("Name").Value
       oform.Items.Item("8").Specific.value = rset.Fields.Item("U_Sal").Value
    end if
    So when you click next, you can see the next record. Not the last record.
    Anoop

  • How to display the data from database(MS access) to a textbox

    anyone know ?

    how to display the data from database(MS access) to a
    textboxThe reply hasn't changed over these years. Read the tuutorial on how to fetch the data. You can display it anywhere you feel like. :)
    http://java.sun.com/docs/books/tutorial/jdbc/

  • Problem with displaying the data from Database on swf file.

    Hi ,
      I am new to flash.Thanks in Advance Please help me....
    Actually my requirement is my application consists a button(submit_Btn) when we click on the button(submit_Btn), each time it must to database(through servlet) and brings the data from database and places it on the flash swf file.Here my problem is for the first time when we click on the button it goes to database and place the data(which was returned from database) on the swf file.Next  when we click on the button for the second time(or anytime) it is not going  and bringing the new data from database(if some data is modified in database or not),Infact it is showing the old data(the data that was collected from previous ClickListener) only on the swf file and it is also not showing any complile time or run time error.
    my Code looks like this:
    submit_Btn.addEventListener(MouseEvent.CLICK,onCheck2);
    function onCheck2(evnt:MouseEvent):void {
    var xmlLoader:URLLoader = new URLLoader();
        var xmlurl:String = "http://localhost:8888/xmlServlet";
        var xmlrequest:URLRequest = new URLRequest(xmlurl);
    xmlLoader.dataFormat = URLLoaderDataFormat.TEXT;
    xmlLoader.addEventListener(Event.COMPLETE, xmlcompleteHandler);
    xmlLoader.load(xmlrequest);
    function xmlcompleteHandler(event:Event):void {
        var loader:URLLoader = URLLoader(event.target);
        var succData:String=loader.data;
            var xmlData:XML = new XML();
            var xmlList:XMLList;
            xmlData = XML(loader.data);
            xmlList = xmlData.children();
            for (var i=0; i<xmlList.length(); i++) {
                for (var n=0; n<xmlData.UserHumanap[i].HumanapDot.length(); n++) {
                        var x_coordinate:Number = xmlData.UserHumanap[i].HumanapDot[n].@x;
                        var y_coordinate:Number = xmlData.UserHumanap[i].HumanapDot[n].@y;
                        var point2:Point = new Point(x_coordinate,y_coordinate);
                        var circle:Sprite = new Sprite();
                        circle.graphics.beginFill(0x00ff00);
                        circle.graphics.drawCircle(point2.x,point2.y,3);   //Placing the data as dots on the swf file
    Thanks in Advance.......Please Help me..........
    its Urgent..........
    Thanks,
    Swarthi

    Checkout following line in your code
    var xmlurl:String = "http://localhost:8888/xmlServlet";
    now change it to
    var xmlurl:String = "http://localhost:8888/xmlServlet?random="+String(MAth.random());
    I think you will get the point now

  • How to process multiple rows of data into a single string

    Hello,
    I am trying to process multiple rows of text from an Oracle database into one field to display on a report as continuous text. Below is sample data. The text field is 55 characters wide so anything longer is broken into multiple rows. I need to recombine it for display.
    line          text
    1             IN THE N.E. QUADRANT OF THE INTERSECTION OF THE FAIRFAX
    2              COUNTY PARKWAY AND THE DULLES AIRPORT ACCESS AND THE T
    3             OLL ROAD AND SOUTH OF SUNSET HILLS ROAD
    I tried creating a formula field but it did not work, below is the code in Visual Basic syntax. I also tried using the Maximum() and UBound() functions without luck. I don't quite understand how to make the UBound() work; it threw a lot of errors.
    Dim i As Number
    Dim strLocDesc As String
    For i = 1 To count({LDS_AR_RL_COMM.ART_LINE_NUM})
        strLocDesc = strLocDesc & {LDS_AR_RL_COMM.ART_COMM_RMK}(i)
    Next i
    formula = strLocDesc
    Any ideas on how to solve this?

    Hello Allison,
    You can try this:
    Create a formula called @StoreText, place it in the details and have the following code in it:
    WhilePrintingRecords;
    Global StringVar Text1;
    Global StringVar TextRest;
    if {field.line} = 1 then
    Text1:= {field.text} else
    if {field.line} >= 2 then
    TextRest := TextRest+" "+{field.text};
    In the Group Footer you can have a formula called @GetStoreText with the following code in it:
    WhilePrintingRecords;
    Global StringVar Text1;
    Global StringVar TextRest;
    Text1+varTextRest;
    See how that works out for you.
    Regards,
    Zack

  • Displaying multiple rows in interactive PDF form

    hi All,
    I am creating a web dynpro application to display the data retrived from back end in an interactive form.
    Data is stored  in the back end in the form of tables.
    Now I want to display the entire data coming from tables in rows in the PDF which I am generating.
    please guide me how to go ahead.
    thanks and regards
    kris

    hi Markus,
    Thanks for the information.
    Let me be clear about my problem with you.
    I am using a RFC to get data from SAP system and display them in the web dynpro application using Interactive form.
    I want to know how can we make the multiple rows of data  be displayed in the interactive form, as we can do in the view designing of web dynpro application.
    I have data in the back end R/3 system and I want to bind
    that data with the Interactive form and display the same in a tabular format as we do in the case of view.
    Thanks and regards
    kris
    ou please help me further

  • Displaying multiple rows in html

    Hi folks, another newbie question for you:
    Is it possible to have an HTML area which displays multiple rows of a query?
    I can get the page to display the first row of the query but I need all the possible rows to show up (in new lines where possible....). It's to be displayed as a final report for an application, pulling in details from numerous tables, so a normal report page was a no no. Can anybody help??
    Dave

    It's kind of difficult to explain but the report heading is taken from one table. the next paragraph (a list of people) is taken from another table (but dependant on the title info - place date etc..). the rest of the information is using data from three tables depending on (yet again) the title (which is an LOV returning an ID just now). the rest of the information is broken into sections which are headed by two lots of info from two of the three tables and sectioned by item from these two tables. If I tried one query I'd end up with LOTS of copies of the same info all over the shop. All I need is the pl/sql to check a table and return the info from the only column I need from that table, display the mulriple rows in a section and I can do the rest I think. As I said, I can display the first row and that's it.....
    sorry if that was confusing and long-winded (welcome to my day... :) )

  • How to display first row value returened from a query as checked as default in a report

    How to display first row value returned from a query as checked as default in a report
    Example
    Parameter 1
    Paramerter2
    ABD
    x(checked)
    Test
    DEF
    JMG
    Mudassar

    Hi Mudassar,
    The issue is caused by the order in which the parameters appear in the report data tab can be difference between our report execution and it failing. In other words, “Parameter2” is execution before parameter “A” due to this issue. We can adjust the parameter’s
    order to solve the issue.
    If “Parameter2” is parameter “A”, we cannot use that expression. Because fields cannot be used in report parameter expression, if we want to display the first value returned from a query as default value, we have to fill the “Specify values” text box with
    the specific value in Default Values dialog box.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • How to download Data from Database directly into excel

    I have a requirement to download very large quantity of data from database into Excel file.
    But condition is excel file should have only 65,536 rows in a single spread sheet(that's the limit i suppose),if i have more data points(rows) than it should be stored into different spreadsheet.......this continues so there can be many spread sheets in a single excel file.
    Data size can be 1 GB or more.
    Also specific naming conventions need to be followed for giving name to excel as well as different spread sheets in it.
    Please see if someone could help me out.

    Thanks for ur reply,
    But my requirement is to call "download to excel" method,in a java program on click by user for downloading an excel sheet on his machine.
    This is be done as part of a web application which is to be made (so can't open the excel first)

  • How to put data from database into array

    I need to answer hot to put data from database directly into array.
    I tried like the code below but the error message said: java.lang.ArrayIndexOutOfBoundsException: 0, and it points to this line: numbers [row][0]= rs.getString("ID");
    Hope you can help.
    ResultSet rs = stmt.executeQuery(query);
         int row=0;
         String [] [] numbers=new String [row][10];
         // output resultset
         while ( rs.next() )
              numbers [row][0]= rs.getString("ID");
              numbers [row][1]= rs.getString("name");
         row++;
         // close resultset
         rs.close();
    thanks,Devi

    The exception is been thrown simply because you assigned '0' to the 'row' variable, indicating a zero length of the array. In fact you should assign the row count to it.
    After all, don't do that. Make use of the Collection framework and map the ResultSet to a Collection of DTO's.
    List<User> users = new ArrayList<User>();
    while (resultSet.next()) {
        User user = new User();
        user.setID(resultSet.getString("ID"));
        user.setName(resultSet.getString("name"));
        users.add(user);
    }

Maybe you are looking for