Urgent help needed for XML Tags using XMLForest()

Folks
I need some urgent help regarding getting use defined tag in your
XML output.
For this I am using XMLElement and XMLForest which seems to work fine
when used at the SQL prompt but when used in a procedure throws and error
SQL> Select SYS_XMLAGG(XMLElement("SDI",
                                   XMLForest(sdi_num)))
     From sdi
     where sdi_num = 22261;- WORKS FINE
But when used in a procedure,doesnt seem to work
Declare
    queryCtx  DBMS_XMLQuery.ctxType;
    v_xml     VARCHAR2(32767);
    v_xmlClob CLOB;
    BEGIN
    v_xml:='Select SYS_XMLAGG(XMLElement("SDI",
                                         XMLFOREST(sdi_num)))
    From sdi
    where sdi_num = 22261';
    queryCtx :=DBMS_XMLQuery.newContext(v_xml);
    v_xmlClob :=DBMS_XMLQuery.getXML(queryCtx);
    display_xml(v_xmlClob);
End;
CREATE OR REPLACE PROCEDURE  display_xml(result IN OUT NOCOPY CLOB)
AS
     xmlstr varchar2(32767);
     line varchar2(2000);
BEGIN
     xmlstr:=dbms_lob.SUBSTR(result,32767);
     LOOP
     EXIT WHEN xmlstr is null;
     line :=substr(xmlstr,1,instr(xmlstr,chr(10))-1);
     dbms_output.put_line('.'||line);
     xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
     END LOOP;
end;
SQL> /
.<?xml version = '1.0'?>
.<ERROR>oracle.xml.sql.OracleXMLSQLException: Character ')' is not allowed in an
XML tag name.</ERROR>
PL/SQL procedure successfully completed.
SQL>HELP is appreciated as to where I am going wrong?

Hi,
if you want to transform something to something else, you should declare, what is your source.
I would prefer to use plain XSL-Transformations, because you have a lot more options to transform your source and you can even better determine, how your output should looks like.
Kind regards,
Hendrik

Similar Messages

  • Query help needed for querybuilder to use with lcm cli

    Hi,
    I had set up several queries to run with the lcm cli in order to back up personal folders, inboxes, etc. to lcmbiar files to use as backups.  I have seen a few posts that are similar, but I have a specific question/concern.
    I just recently had to reference one of these back ups only to find it was incomplete.  Does the query used by the lcm cli also only pull the first 1000 rows? Is there a way to change this limit somwhere?
    Also, since when importing this lcmbiar file for something 'generic' like 'all personal folders', pulls in WAY too much stuff, is there a better way to limit this? I am open to suggestions, but it would almost be better if I could create individual lcmbiar output files on a per user basis.  This way, when/if I need to restore someone's personal folder contents, for example, I could find them by username and import just that lcmbiar file, as opposed to all 3000 of our users.  I am not quite sure how to accomplish this...
    Currently, with my limited windows scripting knowledge, I have set up a bat script to run each morning, that creates a 'runtime' properties file from a template, such that the lcmbiar file gets named uniquely for that day and its content.  Then I call the lcm_cli using the proper command.  The query within the properties file is currently very straightforward - select * from CI_INFOOBJECTS WHERE SI_ANCESTOR = 18.
    To do what I want to do...
    1) I'd first need a current list of usernames in a text file, that could be read (?) in and parsed to single out each user (remember we are talking about 3000) - not sure the best way to get this.
    2) Then instead of just updating the the lcmbiar file name with a unique name as I do currently, I would also update the query (which would be different altogether):  SELECT * from CI_INFOOBJECTS where SI_OWNER = '<username>' AND SI_ANCESTOR = 18.
    In theory, that would grab everything owned by that user in their personal folder - right? and write it to its own lcmbiar file to a location I specify.
    I just think chunking something like this is more effective and BO has no built in back up capability that already does this.  We are on BO 4.0 SP7 right now, move to 4.1 SP4 over the summer.
    Any thoughts on this would be much appreciated.
    thanks,
    Missy

    Just wanted to pass along that SAP Support pointed me to KBA 1969259 which had some good example queries in it (they were helping me with a concern I had over the lcmbiar file output, not with query design).  I was able to tweak one of the sample queries in this KBA to give me more of what I was after...
    SELECT TOP 10000 static, relationships, SI_PARENT_FOLDER_CUID, SI_OWNER, SI_PATH FROM CI_INFOOBJECTS,CI_APPOBJECTS,CI_SYSTEMOBJECTS WHERE (DESCENDENTS ("si_name='Folder Hierarchy'","si_name='<username>'"))
    This exports inboxes, personal folders, categories, and roles, which is more than I was after, but still necessary to back up.. so in a way, it is actually better because I have one lcmbiar file per user - contains all their 'personal' objects.
    So between narrowing down my set of users to only those who actually have saved things to their personal folder and now having a query that actually returns what I expect it to return, along with the help below for a job to clean up these excessive amounts of promotion jobs I am now creating... I am all set!
    Hopefully this can help someone else too!
    Thanks,
    missy

  • Urgent help needed for hysterical female!

    I need urgent help in editing a pic that has been emailed to me, I do not know which Adobe programme to upload it too.  Currently use Picasso - usually brilliant, but now gets jammed with a pop up box asking me to either accept or deny picnik.  When I googled picnik, it now belongs to Google - don't know how to do a damn thing now!!  Extremely Frustrated, can anybody suggest/help me

    The only Adobe program I know that can edit images is Photoshop.
    If you have troubles with Google software, you need to post in the appropriate Google forum.

  • Searching for XML tags using Oracle Text

    I am using full text search to find documents based on a search text. It works fine for pdf, word documents, etc. However for XML documents, searching for a particular tag name does not find anything. Searching for text within tags works fine. Any thoughts?
    Edited by: miyer on Feb 21, 2011 6:25 PM

    Hi
    Try adding the following variable to ucm config.cfg and then see if a new xml checkin returns the result for FT search :
    TextIndexerFilterFormats=xml
    Save the file , restart UCM and then test .
    If the new checkin gets the results as expected then execute Collection Rebuild cycle to have the existing contents as well FT indexed to be searchable (for XML).
    Thanks
    Srinath

  • Urgent Help Needed for WVC210 camera setup :)

    Please help!  I am trying to set up a Cisco WVC210 surveilance camera at one of the stores owned by the company I work for.  Its a small business and I am the closest they have to an I.T person !! I have plenty of experience with software but not much on networking so need some idiot proof guidance !   The "administrative guide" is not worth the paper it is printed on!!
    The store has a fixed IP address of 212.9.##.### I connected the camera using ethernet cable.  Set the camera up using the software for the camera, with static ip address of 192.168.0.23.  Set the SSID of the camera to that of the router (a Netgear one).  It worked fine.  I went to unplug so I could have it wireless and NOTHING !!  It did work one time (no idea what i did differently!) but it would not work over the internet which is what we need it to do!  I need the whole thing password protected too! 
    Is there ANYONE who can help me please???  I am at the point of running away from my work and never returning !!!! :s
    Thank you

    Hi Jodie,
    Thank you for posting. In order to make the camera connect wirelessly, first set up the wireless settings in the camera to match the router. I usually open the router configuration page and copy and paste the SSID and Security Passphrase to the camera to avoid error. The next step is to unplug the ethernet cable and power cord from the camera. Then plug only the power back in and the camera should connect wirelessly.
    For remote access to the camera you will need to forward port 80 to the LAN IP address of the camera. (192.168.0.23) This is done in the router. If you need help with port forwarding, you can search the web or call Netgear for assistance.
    If you continue to need assistance with the camera, the fastest and easiest way to get assistance is to call Cisco Small Business Support. www.cisco.com/go/sbsc
    Please go to www.cisco.com and click on "Register" in the upper right to create a user ID. This will allow our engineers to create a case for you.

  • Help needed for file processing using FTP

    Hi All,
    I am new to ODI tool and currently we are implementing one project in ODI. Could you please, any one help me on the following requirement... how to implement it?
    Scenario:
    i) I need to pick a file from remote host 'outbox' dir using FTP process, and place into local 'temp' dir. (I can do it with odiFTPGet tool)
    ii) Change the file as per target business requirement.??? ( this step challenging me)
    for ex:
    if source file name : <project name>_<source ID>_<transaction name>_<unique id>.txt
    target name should be : 1234_<transaction name>_<sysdate in yyyyMMddhhmmss>_<unique id>_2345.txt ( here 1234 and 2345 are hard coded values)
    iii) Later move to local 'temp' to local 'outbox' dir. ( I can do it with odiFileMove tool)
    iv) After successful process move the file from remote 'outbox' to remote 'archive' dir ??? (again this is challenging me).
    For this my questions are:
    1) How to get file name into a variable ( In one of the post , it says we need to create data model and data stores, and interface to get the file names into a file. apart from is there any easy way i can implement it in package it self?)
    2) How to tokenize a long string ( i.e., need to tokenize the source file to get <unique id> and <transaction name> and map to target file name)
    3) How to define implementation for Java in user function?? do we need to use class declarations and import statements?? I need a sample user function in Java.
    4) How to move/rename a file in remote server?? ( need to move file from remote 'outbox' server to remote archive' dir)
    5) If any step in package fails, How to get the error msg into a variable which i can use for sending mail and raise a ticket in remedy?? ( I will pass that variable to as content to mail and remedy ticket)
    6) How to handle list type data (string list) by variables in ODI?? (As we can define single variable not as list.)
    I am sorry to ask all my queries I a single post. But I need to solutions for all to implement this in my project.
    Thanks in advance. Appreciate early response.
    Regards,
    Kiran.N

    Can any one share your thoughts for my request.
    Thanks in advance.
    Regards,
    Kiran

  • URGENT HELP NEEDED FOR TimeStamp

    Urgent Millisecond Question....
    I have the Java Code which used to work well in Oracle 8 and Sybase ..
    When I am using it with Oracle 9.2 it creating a problem...
    The code is
    final public JDatetime getJDatetime(int columnIndex) throws SQLException {
         boolean convertb = Util.needConvertTime();
         Timestamp ts=_rs.getTimestamp(columnIndex);
         if(ts==null) return null;
         Date d= new Date(ts.getTime() + (ts.getNanos()/1000000));
         if(convertb) d = Util.ReferenceTZ2Local(d);
         return new JDatetime(d);
    Now in Oracle 8 Say when I insert a
    JDateTime Value as 2003-06-18 16:51:06.89
    and
    When I retrieve is using above getJDatetime
    it get retrieved as
    2003-06-18 16:51:06.0
    Which is ok since Milliseconds are lost....
    Now in Oracle 9
    When I use the convert
    Date d= new Date(ts.getTime() + (ts.getNanos()/1000000));
    It get converted to
    Original Value While Inserting -->TimeStamp in JResultSet->2003-06-18 18:15:56.42
    Date in JResultSet-->Wed Jun 18 18:15:56 GMT 2003
    Date in JResultSet after converting to ReferenceTZ
    Wed Jun 18 18:15:56 GMT 2003
    DateTime in JResultSet after converting to DateTime6/18/03 6:15:56.840 PM
    GMTGETDatetime 6/18/03 6:15:56.840 PM GMT
    so if you see
    Milliseconnd 42 got converted to 840 NanoSeconds
    WHICH IS WRONG
    Can anybody help me with it ??
    Mahesh

    The only Adobe program I know that can edit images is Photoshop.
    If you have troubles with Google software, you need to post in the appropriate Google forum.

  • Please urgent help needed for the following

    Hi Everybody!
    I desperately need help as soon as possible.
    Following is the partial code for the driver program which will use the Employee class Objects(Employee is declared abstract). If you want to see whole code you can take a look at my last two or three posts in this forum.
    1-     Now data input by the user in the specific field( name, rate ) should be displayed in the �List� at the top of the frame after pressing �Enter� key. Can anyone help me to achieve this functionality. While doing this keep in mind the capacity of Array
    2-     I also need �rate� textfield to enabled initially & become disable when �raise� (for trigerring calculating raise in weekly pay) is checked. On this �increased� textbox will become �enabled� which was disabled initially.
    3-     The stuff which may have the problems is followed by �*******************�.
    // here is how I declared handlers
    ActionEventHandler handler = new ActionEventHandler();
    ItemEventHandler listener = new ItemEventHandler();
    // here is the declaration of awt components which are going to be placed on Frame.
    public class ActionEventHandler implements ActionListener
    public void actionPerformed(ActionEvent event)
    //if(event.getSource() == enterButton)
    for (int i = 0 ; i < empArray.length; i++)
    if(event.getSource() == enterButton)
    empData.add(nameField.getText());
    /*else if(event.getSource() == hoursField)
    calcWeeklyPay();
    if(event.getSource() == clearButton)
    nameField.setText("");
    hoursField.setText("");
    rateField.setText("");
    increaseField.setText("");
    }//else if
    }//ActionEventHandler
    public class ItemEventHandler implements ItemListener
    public void itemStateChanged(ItemEvent event)
    //if(event.getSource() == enterButton)
    if(hEmployee.getState())
    createHourly();
    }//if
    /*else
    sEmployee.setState(true);
    createSalaried();
    }//else*/
    else if(raiseSal.getState())
    increaseField.setEnabled(true);
    rateField.setEnabled(false);
    }//itemStateChanged
    }//ItemEventHandler
    public void createHourly()
    nameField.requestFocus();
    //String name = nameField.getText();
    double payRate = Double.parseDouble(rateField.getText());
    double hours = Double.parseDouble(hoursField.getText());
    empArray[empCreated] = new HourlyEmployee(nameField.getText(), payRate, hours);
    currentEmp = empCreated;
    empCreated++;
    //empData.add(emp.toString());
    enterButton.setLabel("add");
    }//createHourly
    /* public void createSalaried()
    nameField.requestFocus();
    //String name = nameField.getText();
    double payRate = Double.parseDouble(rateField.getText());
    double hours = Double.parseDouble(hoursField.getText());
    empArray[empCreated] = new HourlyEmployee(nameField.getText(), payRate, hours);
    currentEmp = empCreated;
    empCreated++;
    enterButton = new Button("add");
    }//createSalaried*/
    looking forward your kindness

    Visit YAT-Yet Another Thread this is a discussion using the Sun book Core Java 2
    and one part in that book uses an example with Employee class of which I assume you are stealing your class-name from. Anyway, that thread is in the Java forums.

  • URGENT HELP NEEDED FOR GROUP BY

    SELECT curve_date, curve_id, curve_type, curve_name, curve_instance, is_simple,
    comments, curve_currency, curve_generator, curve_interpolator, holidays,
    user_name, rate_index, daycount_code, frequency_code, rate_index_tenor,
    time_zone
    FROM curve a
    WHERE curve_date = (SELECT max(curve_date)
    FROM curve b
    WHERE b.curve_id = a.curve_id
    GROUP BY curve_id)
    I have this query ..This query does the FULL TABLE SCAN .....PLEASE Suggest some easier way to optimize this query.....I need it VERY VERY URGENTLY....

    SELECT curve_date, curve_id, curve_type, curve_name, curve_instance, is_simple,
    comments, curve_currency, curve_generator, curve_interpolator, holidays,
    user_name, rate_index, daycount_code, frequency_code, rate_index_tenor,
    time_zone
    FROM curve
    WHERE (curve_id, curve_date) IN (SELECT curve_id, max(curve_date)
    FROM curve
    GROUP BY curve_id)
    Be sure you have statistics collected on the table. Anyway, I am not sure that Oracle will not do the FTS for this query even if curve_id and curve_date are indexed.

  • URGENT : Help needed for OLAP tools selection

    Hi Gurus,
    Environment :
    Oracle 10g
    .net web application with backend as Oracle 10g server embaded with OLAP server.
    Application - CRM
    Feature requreid - OLAP, OLAP Reporting, Drilldown graphical analysis, US MAP view location specific queries, Ad-hoc analysis.
    I have to take a descision for for the OLAP tool selection with above mention client requirement.
    * Please let me know if anybody have worked on above combination for the required features and held up with any issue (if any) ?
    * Please go thru Oracle options below per feature and let me know is there any issue with .NET and IIS server,Oracle 10g OLAP compatibily ? specially for following points from the below details -
    4. OLAP Reporting Tool :
    6. Web deployment of Cubes :
    8. Graphing :
    9. Geographical Map View based query :
    1.Extraction Transformation and loading (ETL) Tool : Oracle Business Intelligence Warehouse Builder, tightly integrated with Database Server.
    2. Analysis Tool (Multidimensional Data Analysis using cubes) : Oracle Business Intelligence Discoverer·     
    3. Ad-hoc query and analysis by end User :
    Oracle Business Intelligence Spreadsheet Add-in.OLAP DML Regular Sql with OLAP_TABLE Function.
    4. OLAP Reporting Tool :     Oracle Reports 10g.
    5. Multidimensional Data (Cube) Query Language     OLAP DML : Regular Sql with OLAP_TABLE Function
    6.Web deployment of Cubes : Available
    7. Cube data export to xls, html, format : Available
    8.Graphing : Oracle Reports 10g Graph Wizard for Graphical Analysis.
    9. Geographical Map View based query : Oracle Locator: Location-Enabling Every Oracle Database
    Please send me the relevent urls in support / issues for the above featues.
    TIA,
    Sheilesh

    The only Adobe program I know that can edit images is Photoshop.
    If you have troubles with Google software, you need to post in the appropriate Google forum.

  • Urgent Help need for ABAP Custom Process Types

    Hi Gurus,
    I have created a Custom Process Type for ABAP program which returns status (Success or Failure).
    I followed the below procedure to create a custom ABAP process type.
    In RSPC, I went to Settings -> Maintain process types
    I selected the ABAP process type and then selected the EDIT -> COPY AS and then in the process chain configuration screen, I gave a new name to the process type, changed the POSSIBLE EVENTS settings to "2 process ends "successful" or "failure" and saved the settings to confirm changes.
    Now I can see the new process type for ABAP program which returns the success or failure for the successors.
    Now, my question is, where do i write the logic for ABAP program ? how does the ABAP program returns the success or failure. Do I have to change the code in the method IF_RSPC_EXECUTE~EXECUTE to return success or failure.  Please make me clear where I can write the code? For example in my ABAP program, I am searching a table to find a specific value. If the value is not found, then the ABAP process type should return failure, if found should return success. How can I do this?
    Thanks in advance,
    Regards,
    aarthi
    [email protected]

    Hi,
       We have a similar problem. We have an ABAP program in a process chain that
    uses a custom process type with on success and on failure.
        If  the program is successful there is no problem. it will run the next process step.
        The problem is when the ABAP Program fails and even though the message class is E in our ABAP program it has a confirm popup message with a status change and asks "Save Status and Trigger Events if Appropriate".
         Once you enter Yes to continue it then continues to the next step in the program and is fine.I traced in debug where this status message is appearing. It is in CL_RSPC_LOG. There is a popup_to_confirm_step where it checks the e_status that is value J ( Framework Error upon completion). Then it submits the rspc_process_finish program to complete and call the on error process step.
         Has anyone else experienced this and is there any other documents out there to help me?
    Apologies if this is not very clear.
    Any assistance would be appreciated.
    Thanks
    Monica Mandia

  • Urgent help need for login problem B310

    Im having a B310, i use veritouch for login purpose. My 4 years kid accidently changed the pass method without my knowledge. After restart, i cant log in. Yet after i try did the forget password in windows 7, it seems cant work. I tried windows password bypass software but shows nopassword set. Unable to get pass via safe mode or f8 as well. Please help me..thanks

    Hi raid5, and welcome to the Lenovo User Community!
    I'm sorry you are locked out of your B310. Unfortunately the Community Rules do not allow discussion of methods to defeat passwords. 
    I don't work for Lenovo. I'm a crazy volunteer!

  • URGENT HELP NEEDED FOR JTABLE PROBLEM!!!!!!!!!!!!!!!!!

    firstly i made a jtable to adds and deletes rows and passes the the data to the table model from some textfields. then i wanted to add a tablemoselistener method in order to change the value in the columns 1,2,3,4 and set the result of them in the column 5. when i added that portion of code the buttons that added and deleted rows had problems to function correctly..they dont work at all..can somebody have a look in my code and see wot is wrong..thanx in advance..
    below follows the code..sorry for the mesh of the code..you can use and run the code and notice the problem when you press the add button..also if you want delete the TableChanged method to see that the add button works perfect.
    * Created on 03-Aug-2005
    * TODO To change the template for this generated file go to
    * Window - Preferences - Java - Code Style - Code Templates
    * @author Administrator
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Vector;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import java.io.*;
    public class NodesTable extends JFrame implements TableModelListener, ActionListener {
    JTable jt;
    DefaultTableColumnModel dtcm;
    TableColumn column[] = new TableColumn[100];
    DefaultTableModel dtm;
    JLabel Name,m1,w1,m2,w2;
    JTextField NameTF,m1TF,w1TF,m2TF,w2TF;
    String c [] ={ "Name", "Assessment1", "Weight1" , "Assessment2","Weight2 ","TotalMark"};
    float x=0,y=0,tMark=0,z = 0;
    float j=0;
    int i;
         JButton DelButton;
         JButton AddButton;
         JScrollPane scrollPane;
         JPanel mainPanel,buttonPanel;
         JFrame frame;
         Object[][] data =
              {"tami", new Float(1), new Float(1.11), new Float(1.11),new Float(1),new Float(1)},
              {"tami", new Float(1), new Float(2.22), new Float(2.22),new Float(1),new Float(1)},
              {"petros", new Float(1), new Float(3.33), new Float(3.33),new Float(1),new Float(1)},
              {"petros", new Float(1), new Float(4.44), new Float(4.44),new Float(1),new Float(1)}
    public NodesTable() {
    super("Student Marking Spreadsheet");
    this.AddNodesintoTable();
    setSize(400,250);
    setVisible(true);
    public void AddNodesintoTable(){
    // Create a vector object and load them with the data
    // to be placed on each row of the table
    dtm = new DefaultTableModel(data,c);
    dtm.addTableModelListener( this );
    jt = new JTable(dtm){
         // Returning the Class of each column will allow different
              // renderers to be used based on Class
              public Class getColumnClass(int column)
                   return getValueAt(0, column).getClass();
              // The Cost is not editable
              public boolean isCellEditable(int row, int column)
                   int modelColumn = convertColumnIndexToModel( column );
                   return (modelColumn == 5) ? false : true;
    //****************************User Input**************************
    //Add another node
    //Creating and setting the properties
    //of the panel's component (panels and textfields)
    Name = new JLabel("Name");
    Name.setForeground(Color.black);
    m1 = new JLabel("Mark1");
    m1.setForeground(Color.black);
    w1 = new JLabel("Weigth1");
    w1.setForeground(Color.black);
    m2= new JLabel("Mark2");
    m2.setForeground(Color.black);
    w2 = new JLabel("Weight2");
    w2.setForeground(Color.black);
    NameTF = new JTextField(5);
    NameTF.setText("Node");
    m1TF = new JTextField(5);
    w1TF = new JTextField(5);
    m2TF=new JTextField(5);
    w2TF=new JTextField(5);
    //creating the buttons
    JPanel buttonPanel = new JPanel();
    AddButton=new JButton("Add Row");
    DelButton=new JButton("Delete") ;
    buttonPanel.add(AddButton);
    buttonPanel.add(DelButton);
    //adding the components to the panel
    JPanel inputpanel = new JPanel();
    inputpanel.add(Name);
    inputpanel.add(NameTF);
    inputpanel.add(m1);
    inputpanel.add(m1TF);
    inputpanel.add(w1);
    inputpanel.add(w1TF);
    inputpanel.add(m2);
    inputpanel.add(m2TF);
    inputpanel.add(w2TF);
    inputpanel.add(w2);
    inputpanel.add(AddButton);
    inputpanel.add(DelButton);
    //creating the panel and setting its properties
    JPanel tablepanel = new JPanel();
    tablepanel.add(new JScrollPane(jt, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED
    , JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS));
    getContentPane().add(tablepanel, BorderLayout.CENTER);
    getContentPane().add(inputpanel, BorderLayout.SOUTH);
    //Method to add row for each new entry
    public void addRow()
    Vector r=new Vector();
    r=createBlankElement();
    dtm.addRow(r);
    jt.addNotify();
    public Vector createBlankElement()
    Vector t = new Vector();
    t.addElement((String) " ");
    t.addElement((String) " ");
    t.addElement((String) " ");
    t.addElement((String) " ");
    t.addElement((String) " ");
    return t;
    // Method to delete a row from the spreadsheet
    void deleteRow(int index)
    if(index!=-1) //At least one Row in Table
    dtm.removeRow(index);
    jt.addNotify();
    // Method that adds and deletes rows
    // from the table by pressing the
    //corresponding buttons
    public void actionPerformed(ActionEvent ae){
         Float z=new Float (m2TF.getText());
    String Name= NameTF.getText();
    Float x= new Float(m1TF.getText());
    Float y= new Float(w1TF.getText());
    Float j=new Float (w2TF.getText());
    JFileChooser jfc2 = new JFileChooser();
    String newdata[]= {Name,String.valueOf(x),String.valueOf(y),
    String.valueOf(z),String.valueOf(j)};
    Object source = ae.getSource();
    if(ae.getSource() == (JButton)AddButton)
    addRow();
    if (ae.getSource() ==(JButton) DelButton)
    deleteRow(jt.getSelectedRow());
    //method to calculate the total mark in the TotalMark column
    //that updates the values in every other column
    //It takes the values from the column 1,2,3,4
    //and changes the value in the column 5
    public void tableChanged(TableModelEvent e) {
         System.out.println(e.getSource());
         if (e.getType() == TableModelEvent.UPDATE)
              int row = e.getFirstRow();
              int column = e.getColumn();
              if (column == 1 || column == 2 ||column == 3 ||column == 4)
                   TableModel model = jt.getModel();
              float     q= ((Float)model.getValueAt(row,1)).floatValue();
              float     w= ((Float)model.getValueAt(row,2)).floatValue();
              float     t= ((Float)model.getValueAt(row,3)).floatValue();
              float     r= ((Float)model.getValueAt(row,4)).floatValue();
                   Float tMark = new Float((q*w+t*r)/(w+r) );
                   model.setValueAt(tMark, row, 5);
    // Which cells are editable.
    // It is only necessary to implement this method
    // if the table is editable
    public boolean isCellEditable(int row, int col)
    { return true; //All cells are editable
    public static void main(String[] args) {
         NodesTable t=new NodesTable();
    }

    There are too many mistakes in your program. It looks like you are new to java.
    Your add and delete row buttons are not working because you haven't registered your action listener with these buttons.
    I have modifide your code and now it works fine. Just put some validation code for the textboxes becuase it throws exception when user presses add button without entering anything.
    Here is the updated code: Do the diff and u will know my changes
    * Created on 03-Aug-2005
    * TODO To change the template for this generated file go to
    * Window - Preferences - Java - Code Style - Code Templates
    * @author Administrator
    * TODO To change the template for this generated type comment go to Window -
    * Preferences - Java - Code Style - Code Templates
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.JTextField;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import javax.swing.table.DefaultTableColumnModel;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableColumn;
    import javax.swing.table.TableModel;
    public class NodesTable extends JFrame implements TableModelListener,
              ActionListener {
         JTable jt;
         DefaultTableColumnModel dtcm;
         TableColumn column[] = new TableColumn[100];
         DefaultTableModel dtm;
         JLabel Name, m1, w1, m2, w2;
         JTextField NameTF, m1TF, w1TF, m2TF, w2TF;
         String c[] = { "Name", "Assessment1", "Weight1", "Assessment2", "Weight2 ",
                   "TotalMark" };
         float x = 0, y = 0, tMark = 0, z = 0;
         float j = 0;
         int i;
         JButton DelButton;
         JButton AddButton;
         JScrollPane scrollPane;
         JPanel mainPanel, buttonPanel;
         JFrame frame;
         public NodesTable() {
              super("Student Marking Spreadsheet");
              this.AddNodesintoTable();
              setSize(400, 250);
              setVisible(true);
         public void AddNodesintoTable() {
              // Create a vector object and load them with the data
              // to be placed on each row of the table
              dtm = new DefaultTableModel(c,0);
              dtm.addTableModelListener(this);
              jt = new JTable(dtm) {
                   // The Cost is not editable
                   public boolean isCellEditable(int row, int column) {
                        int modelColumn = convertColumnIndexToModel(column);
                        return (modelColumn == 5) ? false : true;
              //****************************User Input**************************
              //Add another node
              //Creating and setting the properties
              //of the panel's component (panels and textfields)
              Name = new JLabel("Name");
              Name.setForeground(Color.black);
              m1 = new JLabel("Mark1");
              m1.setForeground(Color.black);
              w1 = new JLabel("Weigth1");
              w1.setForeground(Color.black);
              m2 = new JLabel("Mark2");
              m2.setForeground(Color.black);
              w2 = new JLabel("Weight2");
              w2.setForeground(Color.black);
              NameTF = new JTextField(5);
              NameTF.setText("Node");
              m1TF = new JTextField(5);
              w1TF = new JTextField(5);
              m2TF = new JTextField(5);
              w2TF = new JTextField(5);
              //creating the buttons
              JPanel buttonPanel = new JPanel();
              AddButton = new JButton("Add Row");
              AddButton.addActionListener(this);
              DelButton = new JButton("Delete");
              DelButton.addActionListener(this);
              buttonPanel.add(AddButton);
              buttonPanel.add(DelButton);
              //adding the components to the panel
              JPanel inputpanel = new JPanel();
              inputpanel.add(Name);
              inputpanel.add(NameTF);
              inputpanel.add(m1);
              inputpanel.add(m1TF);
              inputpanel.add(w1);
              inputpanel.add(w1TF);
              inputpanel.add(m2);
              inputpanel.add(m2TF);
              inputpanel.add(w2TF);
              inputpanel.add(w2);
              inputpanel.add(AddButton);
              inputpanel.add(DelButton);
              //creating the panel and setting its properties
              JPanel tablepanel = new JPanel();
              tablepanel.add(new JScrollPane(jt,
                        JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                        JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS));
              getContentPane().add(tablepanel, BorderLayout.CENTER);
              getContentPane().add(inputpanel, BorderLayout.SOUTH);
         //Method to add row for each new entry
         public void addRow() {
              Float z = new Float(m2TF.getText());
              String Name = NameTF.getText();
              Float x = new Float(m1TF.getText());
              Float y = new Float(w1TF.getText());
              Float j = new Float(w2TF.getText());
              String newdata[] = { Name, String.valueOf(x), String.valueOf(y),
                        String.valueOf(z), String.valueOf(j) };
              dtm.addRow(newdata);
         // Method to delete a row from the spreadsheet
         void deleteRow(int index) {
              if (index != -1) //At least one Row in Table
                   dtm.removeRow(index);
                   jt.addNotify();
         // Method that adds and deletes rows
         // from the table by pressing the
         //corresponding buttons
         public void actionPerformed(ActionEvent ae) {
              Object source = ae.getSource();
              if (ae.getSource() == (JButton) AddButton) {
                   addRow();
              if (ae.getSource() == (JButton) DelButton) {
                   deleteRow(jt.getSelectedRow());
         //method to calculate the total mark in the TotalMark column
         //that updates the values in every other column
         //It takes the values from the column 1,2,3,4
         //and changes the value in the column 5
         public void tableChanged(TableModelEvent e) {
              System.out.println(e.getSource());
              //if (e.getType() == TableModelEvent.UPDATE) {
                   int row = e.getFirstRow();
                   int column = e.getColumn();
                   if (column == 1 || column == 2 || column == 3 || column == 4) {
                        TableModel model = jt.getModel();
                        float q = (new Float(model.getValueAt(row, 1).toString())).floatValue();
                        float w = (new Float(model.getValueAt(row, 2).toString())).floatValue();
                        float t = (new Float(model.getValueAt(row, 3).toString())).floatValue();
                        float r = (new Float(model.getValueAt(row, 4).toString())).floatValue();
                        Float tMark = new Float((q * w + t * r) / (w + r));
                        model.setValueAt(tMark, row, 5);
         // Which cells are editable.
         // It is only necessary to implement this method
         // if the table is editable
         public boolean isCellEditable(int row, int col) {
              return true; //All cells are editable
         public static void main(String[] args) {
              NodesTable t = new NodesTable();
    }

  • Help needed for report generation using java technologies

    May i get some idea about report generation api available. some report generation tools that can be downloadble. can you please suggest how to use scheduling the printers or report generation by scheduling.

    e.g. for one of my school project which generate reconciliation report (banking project) we add in a letterheader and the rest of the information presented below.
    but there is some problem here.
    either you "catch" no. x row where the printing will be trancated then prevented it from trancated by formatting your pages such that data will not be printed in that region.

  • URGENT Help needed in XML Publisher Please...Business critical

    Hi
    I am having 2 different types of invoices like
    1.Normal Invoice
    2.Bundled Invoice
    Both cases will have different bodies BUT SAME summaries.
    So based on the Formula column FLAG (BUNDLED=YES or NO) I would like to
    choose a different body like G_NORMAL INVOICE_BODY Or G_BUNDLED_INVOICE_BODY.
    The summary for both of them are the same.
    Case 1: Normal Invoice Group
    <G_INV_TERM>
    <G_INVOICE>
    <G_LINES>
    invoice line details
    --------Line1
    ------- LIne2
    ------- LIne3
    </G_LINES>
    <G_SUMMARY>
    </G_SUMMARY>
    </G_INVOICE>
    </G_INV_TERM>
    Case 2: Bundled Invoice Group
    <G_INV_TERM>
    <G_INVOICE>
    <G_BUNDLE>
    ---Bundled Invoice Line
    </G_BUNDLE>
    <G_SUMMARY></G_SUMMARY>
    </G_INVOICE>
    </G_INV_TERM>
    Based on a condition.Like if BUNDLE=N then do the following:
    For Normal Invoice
    with <G_INV_TERM> --HEADER
    and then invoice lines group <G_LINES> for normal invoice.---BODY
    and then FOOTER Summary--<G_SUMMARY>
    Based on a condition.Like if BUNDLE=Y then do the following:
    with <G_INV_TERM> --HEADER
    and then invoice lines group <G_BUNDLE> for normal invoice.---BODY
    and then FOOTER Summary--<G_SUMMARY>
    In one single template How can I handle Different GROUPS based on a condition.?
    Thanks
    Prasanna

    Is this Sample XML ?
    <G_INV_TERM>
    <BUNDLED>Y</BUNDLED>
    <G_INVOICE>
    <G_LINES>
    <LINE>1 </LINE>
    <LINE>2 </LINE>
    <LINE>3 </LINE>
    <LINE>4 </LINE>
    <LINE>5 </LINE>
    <LINE>6 </LINE>
    <LINE>7 </LINE>
    </G_LINES>
    <G_BUNDLE>
    <BUNDLE>A</BUNDLE>
    <BUNDLE>B</BUNDLE>
    <BUNDLE>C</BUNDLE>
    <BUNDLE>D</BUNDLE>
    <BUNDLE>E</BUNDLE>
    </G_BUNDLE>
    <G_SUMMARY>
    Summary For all
    </G_SUMMARY>
    </G_INVOICE>
    </G_INV_TERM>

Maybe you are looking for

  • How to display a pdf document in an ADF Task Flow?

    I have a requirement where I need to display a pdf doc in RHS task flow, upon a linked clicked on LHS task flow. Passing the pdf doc name is what I know already. All I need to know is, how to display the pdf doc in a task flow. Remember, I don't want

  • GATP run ffecting manual Pricing from Quotation to Sales Order

    Hi SAP Gurus We have a bit of problem, when we place a Quotation for a material and APO gATP is run it creates a sub-item for the material and thatu2019s where we add our manual prices(e.g Freight Charges).What than happens is the Quotation is later

  • Testing XI SOAP scenario via XMLSpy

    I've completed the following - 1. Created the scenario SOAP => XI => RFC 2. Using XI config, generated WSDL specifying the Message Interface which triggers the scenario in XI. http://<serverhost>:<port>/XISOAPAdapter/MessageServlet?channel=<party>:<S

  • Partner segment issue in IDOC IORDER01

    Hi All, We are using IDOC IORDER01 for sending Order and their detail to a system, for that we are using transaction IORD. Structure of IDOC type is: ZIORDER01   PM/SM Orders (Crt and Upd) Enhancement for OP2000     E10RHDR      PM/SM order Header Se

  • Multiple event handlers for one button

    I'm trying to create a button with 2 event handlers, such that when you roll-over the button, a submenu pops up, and when you click the button, you go to a certain frame. I feel like this shouldn't be hard at all, but it's not working. Below is the a