How to display List of Members

Hi,<BR><BR>I would like to verify a calc script to check whether it return correct members,<BR>for example:<BR><BR>==============<BR>FIX(@REMOVE(@DESCENDANTS("TOTALOPERINCOME_05",0), @LIST(@UDA("GL Account", "TCACCOUNT"))))<BR><BR>ENDFIX<BR>==============<BR><BR>Can anyone advise how to display List of members from the above selection?<BR>The objective is to select level 0 descendants of "TOTALOPERINCOME_05", and remove the members if they have "TCACCOUNT" UDA.<BR><BR><BR>Thanks,<BR><BR>Norliansyah

1) The log file is woefully inadequate for validating a list of more than a dozen or so members.<BR><BR>2) Creating a temporary database or application for this is like going from Dallas to Fort Worth by way of India.<BR><BR>3) Neither of the above check your syntax, only the selected elements.<BR><BR>Using member select: you have to rebuild the logic by using subset functionality, but you can both preview the list and generate the members in a useable form (although like I said, it doesn't check your syntax, just the functionality).<BR><BR>Using report generation: you have to replace the @relative with dimbot, and again it only validates the functionality if you successfully re-design the logic.<BR><BR>Overall, I believe the member select (using subset selection) is the quickest, easiest, and most useful.<BR><BR>-Doug.

Similar Messages

  • How to display list process, when i run sql*loader in c#

    Hello,
    How to display list process, when i run sql*loader in c#. I mean when i run sql*loader from cmd windows, i get list process how many row has been inserted. But when i run SQL*Loader from C#, i can't get process SQL*Loader.
    This is my code:
    string strCmd, strSQLLoader;
    string strLoaderFile = "XLLOAD.CTL";
    string strLogFile = "XLLOAD_LOG.LOG";
    string strCSVPath = @"E:\APT\WorkingFolder\WorkingFolder\sqlloader\sqlloader\bin\Debug\8testskrip_HTTP.csv";
    string options = "OPTIONS (SKIP=1, DIRECT=TRUE, ROWS=1000000,BINDSIZE=512000)";
    string append = "APPEND INTO TABLE XL_XDR FIELDS TERMINATED BY ','";
    string table = "OPTIONALLY ENCLOSED BY '\"' TRAILING NULLCOLS (xdr_id,xdr_type,session_start_time,session_end_time,session_last_update_time,session_flag,version,connection_row_count,error_code,method,host_len,host,url_len,url,connection_start_time,connection_last_update_time,connection_flag,connection_id,total_event_count,tunnel_pair_id,responsiveness_type,client_port,payload_type,virtual_type,vid_client,vid_server,client_addr,server_addr,client_tunnel_addr,server_tunnel_addr,error_code_2,ipid,c2s_pkts,c2s_octets,s2c_pkts,s2c_octets,num_succ_trans,connect_time,total_resp,timeouts,retries,rai,tcp_syns,tcp_syn_acks,tcp_syn_resets,tcp_syn_fins,event_type,flags,time_stamp,event_id,event_code)";
    strCmd = "sqlldr xl/secreat@o11g control=" + strLoaderFile + " LOG=" + strLogFile;
    System.IO.DirectoryInfo di;
    try
    System.Diagnostics.ProcessStartInfo cmdProcessInfo = new System.Diagnostics.ProcessStartInfo("cmd.exe");
    di = new DirectoryInfo(strCSVPath);
    strSQLLoader = "";
    strSQLLoader += "LOAD DATA INFILE '" + strCSVPath.ToString().Trim() + "' " + append + " " + table;
    StreamWriter writer = new StreamWriter(strLoaderFile);
    writer.WriteLine(strSQLLoader);
    writer.Flush();
    writer.Close();
    // Redirect both streams so we can write/read them.
    cmdProcessInfo.RedirectStandardInput = true;
    cmdProcessInfo.RedirectStandardOutput = true;
    cmdProcessInfo.UseShellExecute = false;
    cmdProcessInfo.LoadUserProfile = true;
    //System.Diagnostics.Process.Start("CMD.exe", strCmdLine);
    // Start the procses.
    System.Diagnostics.Process pro = System.Diagnostics.Process.Start(cmdProcessInfo);
    // Issue the dir command.
    pro.StandardInput.WriteLine(strCmd);
    // Exit the application.
    pro.StandardInput.WriteLine("exit");
    //Process[] processlist = Process.GetProcesses();
    //foreach(Process pro in processlist){
    Console.WriteLine("Process: {0} ID: {1}", pro.ProcessName, pro.Id);
    Console.WriteLine(pro.StandardOutput.ReadLine());
    // Read all the output generated from it.
    string strOutput;
    strOutput = pro.StandardOutput.ReadToEnd();
    pro.Dispose();
    catch (Exception ex)
    return;
    finally
    Thanks.

    friend
    sqlldr is an application residing in the OS. procedure runs in the dbms engine.
    you cannot run an os command directly from a procedure or a function or a package .
    If you want to do so you need to use either a daemon process created by a PRO*C program
    or a JAVA stored procedure to do so.
    just refer to previous question forums, you can find the solution. Somebody has already given a solution using
    java to run an OS command . check it out
    prakash
    [email protected]

  • How to display 'List' of objects in table format

    I am trying to display bunch of records in the table format.
    I have the List of bean object populated with table datas.
    Currently the code is working fine ,if I tend to display one record.I am wondering how to display all the records.
    I know theres a 'Fieldloop'.If thats the one please explain with example.

    iterate the object list using field loop. eg. is given below
    [      <Field name='MatchTable'>
    <Display class='SimpleTable'>
    <Property name='columns'>
    <List>
    <String>title</String>
    </List>
    </Property>
    </Display>
         <FieldLoop for='name' in='userlist'>
    <Field name='username'>
    <Display class='Label'>
    <Property name='labels'>
    <ref>name</ref>
    </Property>
    </Display>
    </Field>
         <FieldLoop>
         </Field>

  • How to display list in Agent Selection Screen?

    Hi,
    I am using DISPATCH method in Agent Selection screen ( obj. type WF_TASK ).
    In description it says that this method could display a list of users but
    in reality it displays only one item.
    If anyone was able to display a list would you share how to do it?
    Thank you.

    I think you will need to give more information. What does your binding look like, what are the possible agents for the task you give in the binding? This last one if you get a list or search functionality.
    Regards,
    Martin

  • How to display List and Image on Single Screen?

    Hi Friends,
    I wanna display Image and List on single screen.
    Its not possible using Form which will contain both. either I can list or form which contain image as far I know.
    I have seen one J2ME application which contain Image and below that there is list. Can anybody tell me how?
    Thanks,
    Rohan Chandane

    Hi,
    Are you able to put a list and image into a form.
    If so plz let me know the method to do tht.
    thanks.

  • How to display List of items in a outputtext in adf

    Hi ADF Experts,
    My question is I am able to get the selected items from a List<String> on click of a button. How can I display each item as a outputtext inside a panelbox.
    Thanks,
    Rahul

    Rahul,
    Here is a simple ex:
    JSPX :
    <af:panelBox id="pb1">
    <af:forEach var="items" items="#{viewScope.MyBean.stringList}">
    <af:outputText id="ot1" value="#{items}"/>
    </af:forEach>
    </af:panelBox>
    Bean :
    public class MyBean {
    private List<String> stringList;
        public void setStringList(List<String> stringList) {
            this.stringList = stringList;
        public List<String> getStringList() {
            return stringList;
        public MyBean() {
            super();
            stringList = new ArrayList<String>();
            stringList.add("One");
            stringList.add("Two");
            stringList.add("Three");
            stringList.add("Four");
            stringList.add("Five");
    -Arun
    B

  • How to display List of objects in jsp?

    Hi,
    I have a list containing Collection of bean objects.
    Now I want to display the values in the list of objects in a jsp using JSTL.
    Any body help me how to retrieve the bean objects from the List and how can i display that values in the jsp.
    Advanced Thanks,
    Mahendra

    Have you tried to use <:forEach></c:forEach> tag available in jstl?

  • JSP: How do display list of objects in jsp table?

    sorry that my question my confuse you, let me explain more.
    in my java class, have method : public List retrieveAllVacancies(); and it returns a list of available vacancies.
    on my jsp page, i want to display the vicancies in the table have 3 rows:
    vacancy title  |  location  |  contract type
    should i use some form of for loop or iterator to get the vacancies in the list? how does the jsp page get the list of objects?
    anyone can help me? thanks

    i found out the actual thing i look for is how to pass the vector to the jsp page.
    <table>                                                                                                    
        <%
             Vacancy vacancy= new Vacancy();
            Vector allVacancies = new Vector();
            *//allVacancies = (java.util.Vector)request.getAttribute("allVacancies");*
            if(allVacancies.size() == 0) 
                out.print("<br><br><br>     There are no vacancies available!!");
            else
        %>
        <tr>
            <td>Vacancy Title</td>
            <td>Contract Type</td>
            <td>Location</td>
        </tr>
        <%
            for (int i=0;i<allVacancies.size();i++)
                vacancy = (Vacancy)allVacancies.get(i);
         %>
        <tr>
            <td><% out.print(vacancy.getVacancyTitle());%></td>
            <td><% out.print(vacancy.getContractType());%></td>
            <td><% out.print(vacancy.getVacancyLocation()); %></td>
        </tr>
    <%
    %>
    </table>*//allVacancies = (java.util.Vector)request.getAttribute("allVacancies");*
    if i have this line, when i open the jsp page it will gives NullPoniterException.
    the following was what i found for the similar problem,
    You can add the Vector to the HttpSession with_
    session.setAttribute(String name, Object value)_
    or to the ServletRequest with_
    request.setAttribute(String name, Object value)._
    In the other JSP, retrieve the value with_
    session.getAttribute(String name)_
    or to the ServletRequest with_
    request.getAttribute(String name)._
    but i tried to do in this way it didn't work. for sure i didn't do it correctly. could anybody give bit more explanation about how to pass the Vector to the jsp page?
    any help would be appreciated.

  • ALV report -How to display list contains no data?

    Hi Experts,
    I have developed an drill down alv report ? I like to display if 'List contains no data ' or 'No data to display' in Grid itself when there is no data to dissplay instead of an Message ?how can i do that?

    hi
        u should have used this command before calling your grid or list
    if gt_itab[] is not initial. --> comment this
    call function reuse or call method
    endif.
    assuming you have given a top of page for your grid output
    if helpful, reward
    Sathish. R

  • How to display single dimension members in Columns and rows

    Item category on rows Item brand on columns, Different levels in the Item hierarchy , can it be presented as above in the pivot table ?
    I have Item dimension with the below hierarchy :
    Item
    |- All Items
    |-- CAT-Beauty Products
    | |-- SEG-Skin Care
    | |-- BD-Andes
    | -- CAT-Beverages
    | |-- SEG-Bottled Water
    | |--BD-Agua Vide
    | -- CAT-Grocery
    | |-- SEG-Meats
    | |- BD-Harris
    I need to display All 'CAT' elements in rows and all its children (SEG and BD elements) in columns in a pivot table.
    Could you please help me to form the MDX query to display the data in ADF Pivot table.
    Sample query that I used:
    SELECT
    {[Item].[CAT-Beauty Products].Siblings}
    ON COLUMNS,
    {[CAT-Beauty Products].members}
    ON ROWS
    FROM Vcp_Tu1.Supply
    This is giving the below error message:
    Statement Executed with Warnings.
    Repeated dimension [Item] in MDX Query
    Unexpected Essbase error 1200549
    Edited by: Swathi on Jun 7, 2011 11:42 PM

    Sorry you can't do that. as a work around you could create attribute dimensions for the parent and the could cposstab them, or split the dim into two dimensions

  • How to display list of tables in order

    When i issue SELECT * FROM TAB command in SQL/Plus or anyother tools the list of table is not shown in alphabatic order, instead Oracle shows list in the order in which tables created.
    The problem is only with ORACLE 10g Release 2

    I am not sure what you are trying to do now? Anyway please review the posted links, assuming you wanted to view the objects of the current/present schema;
    SQL> select count(*) from user_objects
      2  where object_type='TABLE';
      COUNT(*)
             2
    SQL> select count(*) from user_tables;
      COUNT(*)
             2
    SQL> select * from tab;
    TNAME                          TABTYPE  CLUSTERID
    PLAN_TABLE                     TABLE
    TEST                                 TABLE
    SQL> select count(*) from tab;
      COUNT(*)
             2I think the confusion was that ALL_TABLES shows tables accessible to the current user.
    SQL> select count(*) from all_tables;
      COUNT(*)
          2652Adith

  • How to display list of TCodes with Change Documents enabled

    Hi
    I have 42 transaction codes (e.g. QA11, QA12, QE51N, QE01, QE02, MM01, MM02) and I want to verify if "change document" logging is enabled for the critical data elements in these transactions. 
    I'm aware that you can individually check "change document" setting per table via SE11 > Enter Table Name > Technical Settings > “Log Data Changes” option.   Given the number of transactions (with multiple data elements) I need to check though, is there a  table in SAP where the field, table, tcode and existing change document setting can be viewed?
    Thanks
    T-code
    Description
    MM01
    Create material
    MM02
    Change material
    ME01
    Maintain source list
    MSC1N
    Create batch
    MSC2
    Change batch
    QA01
    Create inspection lot
    QA02
    Change inspection lot
    QA11
    Record usage decision
    QA12
    Change usage decision
    QA14
    Change usage decision without history
    QA16
    Collective usage decision for OK lots
    QA32
    Inspection lot selection
    QAC1
    Correct actual quantity in inspection lot
    QAC2
    Transfer inspection lot quantity
    QAC3
    Inspection lot – reset sample calculation
    QE01
    Record results
    QE02
    Change results
    QE51N
    Work list: results recording
    QM01
    Create quality notification
    QM02
    Change quality notification
    QP01
    Create Inspection Plan
    QP02
    Change Inspection Plan
    CS01
    Create BOM
    CS02
    Change BOM
    CC01
    Create Change Master
    CC02
    Change Change Master
    SU01
    Maintain authorizations
    SE38
    Execute program
    COR2
    Change process order
    CC22
    ECM Change Object Management Records
    MMDE
    Delete all materials
    COR1*
    Create process order with material
    QA08*
    Mass change of quality management inspection data
    C201*
    Create Master Recipe
    C202*
    Change Master Recipe
    C298*
    Deletion of Task Lists without Archiving
    QPR4*
    Process Physical-Sample Drawing
    COEBR*
    Batch Record Approval
    QPR1*
    Create physical sample
    QPR2*
    Change sample
    CV01N*
    Create Document
    CV02N*
    Change Document

    hi Raphael,
    you can also use following two table to view the change log at data element level:
    CDHDR - Change document header
    CDPOS - Change document items
    e.g. give the table CDHDR in SE16N enter your transactions field "TCODE", and date parameter, you can see the results.
    Regards
    Javed

  • Question about timeline navigation and the display list-

    I’ve got a movieclip called “rotatorProxy” that spans the entire timeline. I’ve got nav buttons that jump to various frames on that timeline. I need to get the display depth of rotatorProxy each time the nav buttons move the playhead. The AS3 code is easy enough:
    var zIndex:int = this.getChildIndex(getChildByName("rotatorProxy")) ;
    my problem is where to put it. If I put this code in any script that executes in the target frame, it works, but only if I hit the nav buttons slowly. If I bang on a single nav button rapidly, getChildByName("rotatorProxy”) can return null. I don’t know much about how the display list works but I assume the display list is rebuilt after every jump and the frame scripts are executing asynchronously, so it’s possible my getChildByName call is  executed before the display list is complete. Is there an event or some other handle that would allow me to call my code before the frame is rendered but after the display list is complete?

    Wow, thanks for the fast response...
    “if rotatorProxy exists in all frames, it should never return null.”
    That’s what I thought, but not what I’m seeing, rapidly jumping around on the timeline seems to confuse the player and it temporarily looses track of rotatorProxy.
    You can sort of see it in action here: http://www.appliedcd.com/newACT/act.html
    The zIndex is used to establish the depth of the rotating screens which have been added to the display list via AS. If you bang on the nav buttons quickly you’ll see the stacking order screw up, if you had been in the development environment you’d see the null error thrown.
    I’ll see if I can use the render event to sort this out. I know testing in the frame after the jump will work, but it’s cleaner if I can establish the proper stacking order before the first jump frame is rendered.

  • Please Help::How to display a Map with LIsts as Keys and Values using JSTL

    Hi,
    I need some assistance on how to display a Map in JSP using struts or core JSTL. I have a HashMap which has a List of keys and each key maps to a value of an ArrayList.i.e I have an ArrayList of taxCodes and each taxCode maps to a value of taxDetails which is an ArrayList of details for for that particular taxCode. I have some trouble to display each taxCode then display taxDetails for each taxCode. Here is my code below:
    OrderDetails.java
    package orderitems;
    import java.sql.*;
    import java.util.*;
    public class OrderDetails {
        private LineOder lineOrder;
        private Map lineItems;
        //returns an item number, key_item, from its unique keys
        public int getItemNumber(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            int itmNum = 0;
             * key_item a unique number for an item.
             * key_year,key_office,key_client,key_company unique keys
             * for each order where this key_item is taken
             * from.
            String select = "SELECT key_item FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + key_item +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                if(rst.next()){
                    itmNum = Integer.parseInt(rst.getString("key_item"));
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itmNum;
        //get a list of item number(item codes)
        public List getAllItemNumbers(String key_year,
                String key_office,String key_client,String key_company){
            List itemNumbers = new ArrayList();
            LineItem itemNumber = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            String select = "SELECT key_item FROM "+ Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    itemNumber = new LineItem();
                    itemNumber.setKey_item(Integer.parseInt(rst.getString("key_item")));
                    itemNumbers.add(itemNumber);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemNumbers;
        //get a list of tax codes
        public List getAllTaxCodes(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            ItemTax taxCode;
            List taxCodes = new ArrayList();
            int itemNum = getItemNumber(key_item, key_year,
                    key_office,key_client,key_company);
            String select = "SELECT key_tax_code FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + itemNum +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    taxCode = new ItemTax();
                    taxCode.setKey_tax_code(rst.getString("key_tax_code"));
                    taxCodes.add(taxCode);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return taxCodes;
        /////This methode returns a Map which am trying to display in JSP
        //use tax code to get tax details
        public Map getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
                System.out.println();
                System.out.println("*********CONSOLE OUTPUT*************");//display on console
                Set set = itemTaxDetails.keySet();
                Iterator iter = set.iterator();
                System.out.println("Key\t\tValue\r\n");
                while (iter.hasNext()) {
                    Object taxCode=iter.next();
                    Object details=itemTaxDetails.get(taxCode);
                    System.out.println(taxCode +"\t" + details);
                System.out.println("************************************");
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemTaxDetails;
        //details of an item with all its taxes
        public List getAllItemDetails(String key_year,
                String key_office,String key_client,String key_company){
            List lineItems = new ArrayList();
            List itemNumbers = new ArrayList();
            Map taxDetails = new HashMap();
            LineItem item = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //A list of all item numbers in the declaration
            itemNumbers = getAllItemNumbers(key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator itemIter= itemNumbers.iterator(); itemIter.hasNext();){
                    LineItem itemNum = (LineItem)itemIter.next();
                    int itemNumber = itemNum.getKey_item();
                    String select = "SELECT item_description,item_mass," +
                            "item_cost" +
                            " FROM " + Constants.WEB_TABLE +
                            " WHERE key_year = '"+key_year+"'" +
                            " AND key_office = '"+key_office+ "'"+
                            " AND key_client = '"+key_client+ "'"+
                            " AND key_company = '"+key_company+ "'"+
                            " AND key_item = " + itemNumber;
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        item = new LineItem();
                        item.setItem_description(rst.getString("item_description"));
                        item.setItem_mass(Float.parseFloat(rst.getString("item_mass")));
                        item.setKey_item(Integer.parseInt(rst.getString("item_cost")));
                        //////other details records ommited//////////////////////////
                        /* A HashMap of all itemTaxeCodes as its keys and an
                         * ArrayList of itemTaxedetails as its values
                        taxDetails = getItemTaxDetails(item.getKey_year(),item.getKey_office(),
                                item.getKey_client(),item.getKey_company(),item.getKey_item());
                        //item tax details
                        item.setItmTaxes(taxDetails);
                        //list of items with tax details
                        lineItems.add(item);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineItems;
        public Set getOrders(String key_year,String key_office,
                String key_client,String key_company){
            List lineItems = new ArrayList();
            Set lineOrders = new HashSet();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            LineOder lineOrder = null;
            String select = "SELECT * FROM " + Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    lineOrder = new LineOder();
                    lineOrder.setKey_year(rst.getString("key_year"));
                    lineOrder.setKey_office(rst.getString("key_office"));
                    lineOrder.setKey_client(rst.getString("key_client"));
                    lineOrder.setKey_company(rst.getString("key_company"));
                    ////list of items with all their details
                    lineItems = getAllItemDetails(lineOrder.getKey_year(),lineOrder.getKey_office(),
                            lineOrder.getKey_client(),lineOrder.getKey_company());
                    //setting item details
                    lineOrder.setItems(lineItems);
                    //a list of order with all details
                    lineOrders.add(lineOrder);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineOrders;
    Controller.java
    package orderitems;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Controller extends HttpServlet {
        private Map taxDetails = new HashMap();
        private OrderDetails orderDetails = null;
        protected void processRequest(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            String key_year = "2007";
            String key_office = "VZX00";
            String key_company = "DG20";
            String key_client =  "ZI001";
            int key_item = 1;
            String nextView = "/taxdetails_list.jsp";
            orderDetails = new OrderDetails();
            taxDetails = orderDetails.getItemTaxDetails(key_year,key_office,
                    key_company,key_client,key_item);
            //Store the collection objects into HTTP Request
            request.setAttribute("taxDetails", taxDetails);
            RequestDispatcher reqstDisp =
                    getServletContext().getRequestDispatcher(nextView);
            reqstDisp.forward(request,response);
        protected void doGet(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
        protected void doPost(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <title>Simple Tax Detail Diaplay ::</title>
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <jsp:useBean id="taxDetails" class="java.util.HashMap" scope="request"/>
            <table>
                <c:forEach items="${taxDetails}" var="hMap">
                    <tr>
                        <td><c:out value="${hMap.key}" /></td>
                        <!--td><%--c:out value="${hMap.value}" /--%></td-->
                    </tr>
                </c:forEach>
            </table>
        </body>
    </html>am displaying taxCodes(in this case i have VAT and ICD) fine but cant figure out how to display a list of value for each taxCode.Here is the output am getting
    both in my JSP and on the console:
    *******************************CONSOLE OUTPUT****************************
    Key          Value
    ICD     [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    VAT [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    Edited by: aiEx on Oct 8, 2007 6:54 AM

    hi evnafets,
    yes i need a nested for loop.I have tried your advice but my bean properties are not found.Am getting this error:
    javax.servlet.ServletException: Unable to find a value for "key_item" in object of class "java.lang.String" using operator "."
    I have tried this as stated earlier in the post:I have tried to make the method getItemTaxDetails return a List and get the returned list value as taxDetails. I then tested to display this list on JSP and its displaying fine.
    public List getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            //return itemTaxDetails;
            return taxDetails;
        }And my JSP
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <table>
                <c:forEach var="curRecord" items="${taxDetails}" varStatus="rowCounter">
                        <c:choose>
                            <c:when test="${rowCounter.count % 2 == 0}">
                                <c:set var="rowStyle" scope="page" value="odd" />
                            </c:when>
                            <c:otherwise>
                                <c:set var="rowStyle" scope="page" value="even" />
                            </c:otherwise>
                        </c:choose>
                        <tr class="${rowStyle}">
                            <td>${curRecord.key_item}</td>
                            <td>${curRecord.tax_value}</td>
                            <td>${curRecord.tax_limit_val}</td>
                        </tr>
                    </c:forEach>
            </table>
        </body>
    </html>I can't see where am going wrong even with your advice.Please help.
    Thnx.

  • How to display Current Year and Month in Drop Down list

    Hi Dear friends,
    I am devloping a report. It has got 2 pages--input and output(Report) page.
    IN input page, user will select Month and Year from drop down list as one of the input parameters. (seperate drop down list 4 month and year)
    Now, my problem is:
    HOw to display current month and year by default in the dropdown list...........
    I hope my question is clear.
    Please help.
    Regards,
    ASh

    NO da,
    it is not working.
    First i tired with for-loop. I initialized variable "i" to -2 (i=-2) I would get the year drop down list from 2003 but, by default 2003 would come.
    So, i posted the question.
    I tried your code. It is giving following error.
    A Servlet Exception Has Occurred
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occured between lines: 122 and 127 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:182: Invalid type expression.
    first.set(Calendar.YEAR, 2003)
    ^
    An error occured between lines: 127 and 131 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:186: Invalid declaration.
    out.write("\r\n \r\nYear : \r\n \r\n"); ^ An error occured between lines: 198 and 203 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:282: Invalid type expression. first1.set(Calendar.YEAR, 2003) ^ An error occured between lines: 203 and 207 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:286: Invalid declaration. out.write("\r\n \r\nYear :\r\n \r\n");
    ^
    4 errors
    Pls. Help.
    Regards,
    Ashu

Maybe you are looking for