Problem in displaying Column Heading using JTable

I am using JTable component in my applet. I am trying to retrieve records from a database and want to display the same in the table using JTable component. In that procees my data is shown in the table but I am not able to display the column heading.
Please suggest.

you could user JScrollPane to show the column's head.
if you don't want to use JScrollPane ,you should use the getTableHeader() method and add the header into the pane

Similar Messages

  • Retarded Column Heading of JTable

    I have a JTable where I allow automatic resizing of the columns because the user may choose between things of varying lengths to add to the table from a list. I have disabled reordering and resizing in the Table Header. However, the first column heading, "Response Variable", always shows up as "Response.." until you select at least one item from the list. It is driving me crazy. Why won't the entire column name show up all the time, regardless of how many rows the table has?

    try setting the TableColumn minWidth to the minimum size of the column heading. use the method setMinWidth(int minWidth) located in the TableColumn class. This should fix the problem. Let me know

  • How can I change excel column header using Labile.

    Dear Experts,
                          How can i change excel column header using LabVIEW.
    Thanks for any and all help!
    M.S.Sivaraj.
    Sivaraj M.S
    CLD

    As I said in my previous post, column headers in Excel are merely row 1 cells. May be I missing something here, so please be more explicit with your question.
    I guess you are using the Excel Report tools, and you want to modify an existing sheet. From my limited experience with the Excel Report tools, it is not possible to open an existing woorkbook (except as template...), so the answer to your question should be "Forget it"...
    The work around is to use the example I pointed for you before, and either to write the whole new colum headers as a string array, starting in A1, or to write a single string to a given cell in row 1.
    Hope this helps 
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • How to show the VALUE as the Column Header using SQL query?

    Hi
    I have a requirement to show the picked value as the column header using SQL query.
    Example:
    ======
    SELECT EMPNO FROM EMP
    WHERE EMPNO=7934;
    Result Should be:
    7934
    7934

    I have a requirement to show the picked value as the column header using SQL query.In sql*plus you can do
    SQL> set verify on
    SQL> def e =  7934
    old: SELECT empno "&&e"  FROM emp  WHERE empno = &&e
    new: SELECT empno "7934"  FROM emp  WHERE empno = 7934
    SQL> SELECT empno "7934"  FROM emp  WHERE empno = 7934
          7934
          7934
    1 row selected.

  • JTable not displaying column Heads

    The following JPanel was constructed using JBuilder 7 (a horrendous piece of software) and is in GridBagLayout. I'm attempting to display the contents of a table using JTable, and whilst it displays the rows it doesn't display the columnHeads! What am I doing wrong?
    import java.sql.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.text.*;
    public class BeginTask extends JPanel implements ActionListener{
    private boolean dbupdated;
    private MainFrame main;
    private JLabel jLabel1 = new JLabel();
    private JLabel jLabel2 = new JLabel();
    private JTable jTable1 = new JTable();
    private JButton jButton1 = new JButton();
    private JButton jButton2 = new JButton();
    private GridBagLayout gridBagLayout1 = new GridBagLayout();
    private Connection connection;
    private String url = "jdbc:odbc:bapers";
    private String username = "";
    private String password = "";
    public BeginTask(MainFrame ma) throws SQLException{
    main = ma;
    logon();
    drawTable();
    try {
    jbInit();
    catch(Exception ex) {
    ex.printStackTrace();
    void jbInit() throws Exception {
    jLabel1.setFont(new java.awt.Font("Dialog", 1, 18));
    jLabel1.setText("Begin Task");
    this.setLayout(gridBagLayout1);
    jLabel2.setText("Select Task, and press OK.");
    jButton1.setText("OK");
    jButton2.setText("CANCEL");
    jButton1.addActionListener(this);
    jButton2.addActionListener(this);
    this.add(jButton1, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0
    ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(12, 117, 14, 0), 94, 8));
    this.add(jButton2, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0
    ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(19, 43, 7, 119), 62, 8));
    this.add(jTable1, new GridBagConstraints(0, 2, 2, 1, 1.0, 1.0
    ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(12, 25, 0, 22), 522, 281));
    this.add(jLabel2, new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0
    ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 181, 0, 226), 13, 6));
    this.add(jLabel1, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0
    ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(29, 202, 0, 251), 19, 17));
    public void actionPerformed(ActionEvent e) {
    if (e.getSource() == jButton1) {
    if (dbupdated == true)
    JOptionPane.showMessageDialog(null, "The database has been updated to show that the user has begun the task selected.");
    else if (dbupdated == false)
    JOptionPane.showMessageDialog(null, "The database has not been updated.");
    else if (e.getSource() == jButton2) {
    BapProcMain bpm = new BapProcMain(main);
    main.redisplay(bpm);
    public void logon() {
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    connection = DriverManager.getConnection(url, username, password);
    catch (ClassNotFoundException cnfex) {
    System.err.println("Failed to load the JDBC/ODBC driver.");
    cnfex.printStackTrace();
    System.exit(1);
    catch (SQLException sqlex) {
    System.err.println("Unable to connect (SQL error)");
    sqlex.printStackTrace();
    public void logoff() {
    if (connection == null) return;
    try { connection.close(); }
    catch (SQLException sqlex) {
    System.err.println("Unable to disconnect (SQL error)");
    public void drawTable() {
    Statement stmt;
    ResultSet rset;
    try {
    String query = "SELECT * FROM SpecificTask";
    stmt = connection.createStatement();
    rset = stmt.executeQuery(query);
    displayResultSet(rset);
    stmt.close();
    catch (SQLException sqlex) {
    sqlex.printStackTrace();
    private void displayResultSet(ResultSet rs) throws SQLException {
    // position to first record
    boolean moreRecords = rs.next();
    // if there are no records, display a message
    if (! moreRecords){
    JOptionPane.showMessageDialog (this, "No Specific Tasks to begin.");
    return;
    Vector columnHeads = new Vector();
    Vector rows = new Vector();
    try {
    // get column heads
    ResultSetMetaData rsmd = rs.getMetaData();
    for (int i = 1; i <= rsmd.getColumnCount(); ++i)
    columnHeads.addElement (rsmd.getColumnName(i));
    //get row data
    // System.out.println("Got this far. Check getNextRow(...)");
    do { rows.addElement(getNextRow(rs, rsmd)); }
    while (rs.next());
    // display table with ResultSet contents
    jTable1 = new JTable (rows, columnHeads);
    JScrollPane scroller = new JScrollPane(jTable1);
    // validate();
    catch (SQLException sqlex) {
    sqlex.printStackTrace();
    private Vector getNextRow (ResultSet rs, ResultSetMetaData rsmd) throws SQLException {
    Vector currentRow = new Vector();
    for (int i = 1; i <= rsmd.getColumnCount(); ++ i)
    switch (rsmd.getColumnType(i)) {
    case Types.VARCHAR:
    currentRow.addElement(rs.getString(i));
    break;
    case Types.INTEGER:
    currentRow.addElement(new Long (rs.getLong(i) ) );
    break;
    default: System.out.println ("Type was: " +
    rsmd.getColumnTypeName(i));
    return currentRow;
    }

    The table header is shown automatically when you add the table to a scrollpane and then display the scrollpane in a panel. You use the following code to build the table/scrollpane:
    // display table with ResultSet contents
    jTable1 = new JTable (rows, columnHeads);
    JScrollPane scroller = new JScrollPane(jTable1);
    but, you add the table to your panel NOT the scrollpane:
    this.add(jTable1, new GridBagConstraints(0, 2, 2, 1, 1.0, 1.0
    ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(12, 25, 0, 22), 522, 281));
    You should be adding the scrollpane to you panel.

  • How to display 2 lines in the same column header of jTable?

    Please could you help me to display 2 character lines in the same column header of a JTable?
    And how to make a fusion between to cells?
    Thank you very much

    In Swing, most components will accept text in the html format
    http://java.sun.com/docs/books/tutorial/uiswing/components/html.html
    You can then use <br> tags to make your header text multiline

  • Problem in updating first column header in JTable

    hi
    I am using JTable in my application. I want to change first column name of JTable every time when a JList is selected. I am using DefaultTableModel for JTable. I added first column in Constructor and another in a method. I have to edit only first column header. How can i do this???
    I used this code but it is not working.
    table.getColumnModel().getColumn(0).setHeaderValue("Name of column");
    table.getTableHeader().resizeAndRepaint();
    Your help will be appreciated.
    Thanks in advance
    Sonal

    table.getColumnModel().getColumn(0).setHeaderValue("Name of column");
    table.getTableHeader().repaint();Works for me so post a SSCCE ( http://www.sscce.org/ ) that shows the problem.

  • How to display column header of a JTable in JScrollpane's RowHeader

    Can anyone tell me if it's possible to display the colum headers of a JTable which acts as the row headers of a JScrollpane object?
    If the answer is yes, could he/she point me to the right direction?
    Thanks,

    I'm guessing the answer is no because the column header is layed out horizontally and a row header is layed out vertically. But it should be easy enough to test:
    scrollPane.setRowHeaderView(table.getTableHeader());
    Its not hard to create your own row header. Search the forum using "+setrowheaderview +camickr" to find examples I've posted.

  • Problem in Adding two buttons under same column header (in JTable)

    Hi,
    I have a JTable and to a particular column i want to add two buttons.
    Here the two buttons should be under the same column header and i need to add listners to these.
    Any idea how to do this?
    Thanks & regards
    Neel

    Of course as your header is drawn by a renderer, the buttons don't actually work, but you can listen for mouse clicks within the area of the header and see which button the mouse position was over.
    See the Java Table Sorter Demo code for how to add a mouse listener to the header...
    http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#TableSorterDemo
    ....and from there you should be able to determine where in the component the click occured by using the getX() and getY() methods of the MouseEvent to determine which button in the renderer component was clicked. Use something like Rectangle.contains() to match the click location against the buttons.

  • Show the period value in column header using Text Variable

    We are using Posting Period & Financial Year to calculate YTD & MTD, for current year and previous years. These posting period and financial year characteristics are custom created characteristics we are using due to customer specific requirement.
    Input values are posting period, financial year and numeric value. To calculate previous year, I need to subtract numeric value from the input financial year. Every thing is working fine up to this.
    In the report I need to show the posting period and financial year values dynamically in each column header of the report for MTD, YTD for current year & previous year. I tried to achieve this using Text Variables, but I didn’t succeed. If some one can give me some idea to resolve this, it would be very helpful.
    I am excellent in ABAP coding. If you can specify me to code in User Exit, I can do it.
    Column headers should be 08.1999 Sales Qty, 08.2008 Sales Qty, 1999 Sales Qty, 2008 Sales Qty.

    Hi Abhinav,
    Try using the content text variables 0T_FYEAR and 0T_FPER3, when used in the head these variable should display the year and period specified in the RKF.
    e.g
    &0T_FPER3&. &0T_FYEAR& Sales Qty = 08.1999 Sales Qty
    If that doesnt work, try creating text replacement path variables referencing the variables you created for the year and period input. To do this click on the RKF and click on the dropdown by the yellow box next to the description on the general tab and select New Variable, enter the description, tech name and set processng by to Replacment Path, then select period as the ref. characteristic, then on the replacement path tab change replace variable with to variable and then select the variable you are using for the period input, save then hit ok, this is now a text representation of the variable your are inputing for period and can be used in the column headers, you will need to repeat the process for the fiscal year.
    Hope this helps
    Josh

  • Problem while displaying Purchase order using me9f

    Hi All,
    I have copied ME9F as ZME9F, and SAPFM06P as ZSAPFM06P (print program of purchase order). Now when I display the PO using ME23n, there is no problem and PO is getting displayed absolutely fine. But When I display the same PO using ZME9F, the vendor address in the PO is getting printed at the item level instead of header level.
    The vendor address should be displayed at the top and not at the item level.
    When I analysed the code, I found in case of ZME9F AND ME23N, the values of NAST structure and ENT_SCREEN are different. These values are passed as input values to the Function Module ME_READ_PO_FOR_PRINTING.
    Please let me know how do I fix this issue, such that vendor address is displayed at the header level instaed of item level.
    Thanks !!!

    Hi,
    First you creat a PO using BAPI_PO_CREATE , once PO is created then you use the FM BAPI_PO_CHANGE and update the condtions in PO. See the code below given.
    Fm lt_cond-condition_no = lvc_knumv.
    lt_cond-itm_number = gt_output-ebelp.
    lt_cond-cond_type = 'FRB1'.
    lt_cond-cond_st_no = '020'.
    lt_condx-condition_no = lvc_knumv.
    lt_condx-itm_number = gt_output-ebelp.
    lt_condx-itm_numberx = 'X'.
    lt_condx-cond_st_no = lt_cond-cond_st_no.
    lt_condx-cond_st_nox = 'X'.
    lt_condx-cond_type = 'X'.
    lt_cond-cond_value = gt_output-frcst.
    lt_condx-cond_value = 'X'.
    lt_cond-currency = p_cndcur.
    lt_condx-currency = 'X'.
    lt_cond-vendor_no = gt_output-frvndr.
    lt_condx-vendor_no = 'X'.
    lt_cond-change_id = 'I'.
    lt_condx-change_id = 'X'.
    APPEND lt_cond.
    APPEND lt_condx.
    CALL FUNCTION 'BAPI_PO_CHANGE'
    EXPORTING
    purchaseorder = gt_output-ebeln
    TABLES
    return = lt_return
    * poitem = lt_poitem
    * poitemx = lt_poitemx
    pocond = lt_cond
    pocondx = lt_condx.
    Thanks.

  • How To Display Table Header in JTable

    Hi,
    I have a tree node that is a JTable. It displays the cells, but not the header or the left hand side of the table.
    Here is my code ...
    Anyone got any ideas?
    public SimpleTree() {
    super("Creating a Simple JTree");
    WindowUtilities.setNativeLookAndFeel();
    addWindowListener(new ExitListener());
    Container content = getContentPane();
    JTable table;
         String columnNames[] = { "OrderID", "CustomerID", "EmployeeID", "Order Date", "Shipped Date" };
         String dataValues[][] =
              { "34", "234", "67","12/02/2002", "16/04/2002" },
              { "-123", "43", "853","12/02/2002", "16/04/2002" },
              { "93", "89.2", "109","12/02/2002", "16/04/2002" },
              { "279", "9033", "3092","12/02/2002", "16/04/2002" }
         table = new JTable( dataValues, columnNames );
         table.setEnabled(true);
         table.isCellEditable(4,4);
         table.setShowHorizontalLines(true);
         table.setShowVerticalLines(true);     
         table.getTableHeader().setForeground(Color.black);
         table.getTableHeader().setBackground(Color.lightGray);
         table.getTableHeader().setReorderingAllowed(true);
         table.getTableHeader().resizeAndRepaint();
         JTableHeader header = table.getTableHeader();
    header.setUpdateTableInRealTime(true);
    header.setReorderingAllowed(true);
         Object[] hierarchy =
    { "Orders",
    new Object[] { "Orders",
                                  table},
    new Object[] { "Prodcuts",
    new Object[] { "",
    table },
    "Employees",
    "Suppliers" };
         DefaultMutableTreeNode root = processHierarchy(hierarchy);
         JTree tree = new JTree(root);
         tree.putClientProperty("JTree.lineStyle", "Angled");
         tree.setCellRenderer(new MyTreeCellRenderer(table));
         tree.setCellEditor(new SimpleTreeCellEditor(table));
         tree.repaint();
         table.repaint();
         tree.setRowHeight(-2);      
         tree.setEditable(true);
         content.add(new JScrollPane(tree), BorderLayout.CENTER);
         setSize(275, 300);
    setVisible(true);

    The column header is a different component of the table component. You can get this component directly and place it wherever you want in a container, just get them from the JTable:JPanel aPanel = new JPanel( new BorderLayout() );
    JTable myTable = xxx;
    aPanel.add( myTable.getTableHeader() , BorderLayout.NORTH );
    aPanel.add( myTable, BorderLayout.CENTER );

  • Problem in displaying  Columns  'TaxSum'

    Hi Experts,
                        I am having some problem in displaying a  Columns  'TaxSum's'  values ,   this Query Should  returns two Rows   for two  Different Items for the same Vendor with their 'TaxSums'  , If i display  the query without  'TaxSum's'  Columns then it display the data with  two different rows  but If i display 'TaxSums ' Columns (Amount of their Rates) also then
    it is not  displaying the data,  it gives an error
    " Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression."
    This is the query...
    SELECT DISTINCT   ORPC.DocEntry, ORPC.DocNum AS 'Debit Note No.', ORPC.CardName AS 'Name', ORPC.CardCode AS 'code', ORPC.NumAtCard AS 'Supplier Ref.',
                          OCTG.PymntGroup AS 'Payment Terms', OSHP.TrnspName AS 'Shipping type', RPC1.Dscription AS 'Description of Goods', ORPC.Address,
                          RPC1.Quantity, RPC1.Price AS 'Rate', RPC1.LineTotal AS 'Amount', ORPC.DocDate,
               (SELECT DISTINCT TaxRate  FROM   RPC4 
          WHERE      (staType = - 90) AND (StaCode = 'BED@10') AND (DocEntry = RPC1.DocEntry)) AS 'Basic Excise Duty BED@10 %',
         (SELECT DISTINCT TaxRate  FROM  RPC4 AS RPC4_8
          WHERE      (staType = - 60) AND (DocEntry = RPC1.DocEntry)) AS 'Education Cess @2%',
         (SELECT DISTINCT TaxRate  FROM  RPC4 AS RPC4_7
          WHERE      (staType = - 55) AND (DocEntry = RPC1.DocEntry)) AS 'Secondary Education Cess @1%',
        (SELECT DISTINCT TaxRate  FROM  RPC4 AS RPC4_6
          WHERE      (staType = 4) AND (StaCode = 'CST2') AND (DocEntry = RPC1.DocEntry)) AS 'Central Sales Tax(CST)@2%',
       (SELECT DISTINCT TaxRate  FROM  PCH4
       WHERE      (staType = 4) AND (StaCode = 'CST12.5') AND (DocEntry = RPC1.DocEntry)) AS 'Central Sales Tax(CST)@12.5%',
       (SELECT DISTINCT TaxRate   FROM RPC4 AS RPC4_5
       WHERE      (staType = 1) AND (StaCode = 'VAT4') AND (DocEntry = RPC1.DocEntry)) AS 'Input VAT@5%',
       (SELECT DISTINCT TaxRate FROM  RPC4 AS RPC4_4
        WHERE      (staType = 1) AND (TaxRate = 12.500000) AND (StaCode = 'VAT12.5') AND (StaCode = 'VAT12.5') AND (DocEntry = RPC1.DocEntry)) AS 'Input [email protected]%',
             (SELECT DISTINCT TaxRate  FROM  RPC4 AS RPC4_3
             WHERE      (staType = 18) AND (StaCode = 'Add2') AND (DocEntry = RPC1.DocEntry)) AS 'Addtional Tax@1%',
            (SELECT DISTINCT TaxRate    FROM   RPC4 AS RPC4_3
                     WHERE      (staType = 18) AND (StaCode = 'Add1S') AND (DocEntry = RPC1.DocEntry)) AS 'Addtional Tax@1%',
             (SELECT DISTINCT TaxSum   FROM  RPC4
             WHERE      (staType = - 90) AND (StaCode = 'BED@10') AND (DocEntry = RPC1.DocEntry)) AS 'BedAmount@10%',
           (SELECT DISTINCT TaxSum  FROM  RPC4
                                WHERE      (staType = - 60) AND (DocEntry = RPC1.DocEntry)) AS 'EcessAmount@2%',
          (SELECT DISTINCT TaxSum  FROM  RPC4
                                WHERE      (staType = - 55) AND (DocEntry = RPC1.DocEntry)) AS 'SecCessAmount@1%',
          (SELECT DISTINCT TaxSum   FROM  RPC4
                                WHERE      (staType = 4) AND (StaCode = 'CST2') AND (DocEntry = RPC1.DocEntry)) AS 'CSTAmount@2%',
        (SELECT DISTINCT TaxSum   FROM RPC4 AS RPC4_5
         WHERE      (staType = 1) AND (StaCode = 'VAT4') AND (DocEntry = RPC1.DocEntry)) AS 'VATAmount@5%',
         (SELECT DISTINCT TaxSum   FROM  RPC4 AS RPC4_4
          WHERE      (staType = 1) AND (TaxRate = 12.500000) AND (StaCode = 'VAT12.5') AND (DocEntry = RPC1.DocEntry)) AS '[email protected]%',
      (SELECT DISTINCT TaxSum  FROM RPC4 AS RPC4_3
      WHERE      (staType = 18) AND (StaCode = 'Add2') AND (DocEntry = RPC1.DocEntry)) AS 'AddTaxAmount@1%(for VAT@4)',
      (SELECT DISTINCT TaxSum  FROM  RPC4 AS RPC4_3
                                WHERE      (StcCode = 'VAT12.5') AND (staType = 18) AND (StaCode = 'Add1S') AND (DocEntry = RPC1.DocEntry)) AS 'AddTaxAmount@1%([email protected])',
      (SELECT DISTINCT TaxSum  FROM  PCH4
       WHERE      (StcCode = 'B10C125P') AND (TaxRate = 12.500000) AND (staType = 4) AND (StaCode = 'CST12.5') AND (DocEntry = RPC1.DocEntry))  AS '[email protected]%'
    FROM         ORPC INNER JOIN
                          RPC1 ON ORPC.DocEntry = RPC1.DocEntry INNER JOIN
                          OSHP ON ORPC.TrnspCode = OSHP.TrnspCode INNER JOIN
                          OCTG ON ORPC.GroupNum = OCTG.GroupNum
    WHERE     (ORPC.CardCode = 'V00522') AND (ORPC.DocNum = '9220005')
    Kindly tell me the solution....
    Regards
    Rahul
    Edited by: 118Rahul on Sep 17, 2011 2:31 PM
    Edited by: 118Rahul on Sep 17, 2011 3:18 PM

    Hi Rahul......
    Just try this......
    SELECT SUBSTRING((CONVERT(VARCHAR(11),T0.DOCDATE,106)),4,11), T0.[DocNum], T0.[DocDate], Sum(T1.[Quantity]) 'Quantity', Sum(T1.[LineTotal]) 'Amount', T0.[TotalExpns] 'Pack/Forw.',
    t0.doctotal-t0.vatsum as 'Mat.Value',
    T3.PymntGroup AS 'Payment Terms', T2.TrnspName AS 'Shipping type',
    (isnull((SELECT SUM((case when upper(t4.staType) =-90 then T4.TaxRate else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum And T4.LineNum=0 ),0)) 'Rate_Cenvat 10%',
    (isnull((SELECT SUM((case when upper(t4.STAType)=-60 then T4.TaxRate else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum And T4.LineNum=0 ),0)) 'Rate_Edu. Cess 2%',
         (isnull((SELECT SUM((case when upper(t4.staType) =-55 then T4.TaxRate else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum And T4.LineNum=0 ),0)) 'Rate_S&H Cess 1%',
    (isnull((SELECT SUM((case when upper(t4.staType)=1 and t4.TaxRate=4 then T4.TaxRate else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum And T4.LineNum=0 ),0)) 'Rate_VAT4%',
    (isnull((SELECT SUM((case when upper(t4.staType)=1 and t4.TaxRate=12.5 then T4.TaxRate else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum And T4.LineNum=0 ),0)) 'Rate_VAT12.5%',     
    (isnull((SELECT SUM((case when upper(t4.staType)=18 and t4.TaxRate=1 then T4.TaxRate else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum And T4.LineNum=0 ),0)) 'Rate_AVAT1%',
    (isnull((SELECT SUM((case when upper(t4.staType)=18 and t4.TaxRate=2.5 then T4.TaxRate else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum And T4.LineNum=0 ),0)) 'Rate_AVAT2.5%',
    (isnull((SELECT SUM((case when upper(t4.staType)=4 and t4.TaxRate=2 then T4.TaxRate else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum And T4.LineNum=0 ),0)) 'Rate_CST2%',
    (isnull((SELECT SUM((case when upper(t4.staType)=4 and t4.TaxRate=12.5 then T4.TaxRate else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum And T4.LineNum=0),0)) 'Rate_CST12.5%',                 
    (isnull((SELECT SUM((case when upper(t4.staType) =-90 then T4.TaxSum else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum ),0)) 'Amt_Cenvat 10%',
    (isnull((SELECT SUM((case when upper(t4.STAType)=-60 then T4.TaxSum else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum ),0)) 'Amt_Edu. Cess 2%',
         (isnull((SELECT SUM((case when upper(t4.staType) =-55 then T4.TaxSum else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum ),0)) 'Amt_S&H Cess 1%',
    (isnull((SELECT SUM((case when upper(t4.staType)=1 and t4.TaxRate=4 then T4.TaxSum else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum ),0)) 'Amt_VAT4%',
    (isnull((SELECT SUM((case when upper(t4.staType)=1 and t4.TaxRate=12.5 then T4.TaxSum else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum ),0)) 'Amt_VAT12.5%',     
    (isnull((SELECT SUM((case when upper(t4.staType)=18 and t4.TaxRate=1 then T4.TaxSum else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum ),0)) 'Amt_AVAT1%',
    (isnull((SELECT SUM((case when upper(t4.staType)=18 and t4.TaxRate=2.5 then T4.TaxSum else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum ),0)) 'Amt_AVAT2.5%',
    (isnull((SELECT SUM((case when upper(t4.staType)=4 and t4.TaxRate=2 then T4.TaxSum else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum ),0)) 'Amt_CST2%',
    (isnull((SELECT SUM((case when upper(t4.staType)=4 and t4.TaxRate=12.5 then T4.TaxSum else 0 end))
          FROM RPC4 T4 WHERE T4.DocEntry=T0.DocEntry And T1.LineNum=T4.LineNum),0)) 'Amt_CST12.5%'
    FROM ORPC T0  INNER JOIN RPC1 T1 ON T0.DocEntry = T1.DocEntry
    LEFT JOIN
    OSHP T2 ON T0.TrnspCode = T2.TrnspCode LEFT JOIN
    OCTG T3 ON T0.GroupNum = T3.GroupNum
    Where (T0.CardCode = 'V00522') AND (T0.DocNum = '9220005')
    Group By T0.[DocNum], T0.[DocDate], T0.[TotalExpns], t0.doctotal, t0.vatsum, T0.DocEntry, T1.LineNum,
    T3.PymntGroup, T2.TrnspName
    Order By T0.[DocDate]
    Regards,
    Rahul

  • How to insert additional column header using dataTable

    Hi everyone, I am using MyFaces 1.1.3, tomahawk 1.1.3, tomahawk-sandbox 1.1.5
    I have to add one column header "Proficiency" as in image [http://www.nabble.com/file/p17206601/screenshot.jpg]
    This is JSF code without "Proficiency":
    <t:dataTable id="data" value="#{commonBean.tableList}" styleClass="standardTable" headerClass="table_header" rowClasses="table_row1, table_row2" columnClasses="standardTable_Checkbox_Column,standard_text,standardTable_Checkbox_Column,standardTable_Checkbox_Column" var="value" preserveSort="true" rows="10" width="100%" border="0" sortColumn="#{commonBean.sortColumn}" sortAscending="#{commonBean.ascending}" cellpadding="2" cellspacing="1" rowIndexVar="tableRowIndex">
         <h:column>
              <f:facet name="header">
                        <h:panelGrid styleClass="table_header2">
                                  <h:outputText value="#{msg['select']}" />
                        </h:panelGrid>
              </f:facet>
              <h:selectBooleanCheckbox id="select" value="#{value.select}" />
         </h:column>
         <h:column>
              <f:facet name="header">
                        <t:commandSortHeader columnName="languageSkill" arrow="true" styleClass="table_header">
                                  <h:outputText value="#{msg['language.skill']}" />
                        </t:commandSortHeader>
              </f:facet>
              <h:commandLink action="#{commonBean.editAction}" actionListener="#{commonBean.editActionListener}">
                        <h:outputText value="#{value.languageSkill}" />
              </h:commandLink>
              <f:param id="object" value="#{value}" />
         </h:column>
         <h:column>
              <f:facet name="header">
                        <h:outputText value="#{msg['spoken']}" />
              </f:facet>
              <h:outputText value="#{value.spokenDescription}" styleClass="standardText"/>
         </h:column>
         <h:column>
              <f:facet name="header">
                        <h:outputText value="#{msg['written']}" />
              </f:facet>
              <h:outputText value="#{value.writtenDescription}" styleClass="standardText"/>
         </h:column>
    </t:dataTable>How to do ?
    Thanks for your help
    Edited by: nvduc82 on May 13, 2008 12:09 PM
    Edited by: nvduc82 on May 13, 2008 8:46 PM

    I see 2 possibilities:
    1. Merge two last columns. And then use panelGrid inside the cells.
    2. Use JSTL and tag forEach. I found it much easy-to-use.

  • ALV footer not displayed, column header icons missing.

    Hi,
    My simple application uses the ALV grid, but the footer (showing the page number, next page icon, etc) does not display, even though there are pages and pages of data. This is in both Internet Explorer (6) and Firefox (I was expecting it to be an IE problem !).
    I have tried using the relevant method (though I think it should be visible by default):
    l_table->if_salv_wd_table_settings~set_footer_visible( value = IF_SALV_WD_C_TABLE_SETTINGS=>FOOTER_VISIBLE_TRUE ).
    but it still doesn't work. Other table settings methods do work (eg. setting the number of rows). Additionally, the icons for sorting columns do not appear in the column headers.
    I've searched on this forum, and looked for relevant OSS notes, but can't find anything. Any thoughts anyone ?
    Thanks,
    Nick.

    Hi
    Did u try with this code?
            lr_config->if_salv_wd_table_settings~set_visible_row_count( '5' ).
            lr_config->if_salv_wd_table_settings~SET_FOOTER_VISIBLE( '5' ).
    Regards
    Arun.P

Maybe you are looking for

  • How do i colorize a black and white photo?

    I have an old black and white photo of a family member I would like to colorize. how is this done? ? I am new to photoshop.

  • Magic Bullet Looks not loading preview clip in Premier Pro CS6

    I apply MB Looks to Premiere Pro Adjustment Layer. However, there is no preview (black) in the MB Looks window. Anyone knows what could be the problem as it was working fine before...

  • How to keep someone from changing settings on a Mac

    I have a friend that uses my computer when I'm not around and tends to change my settings and the overall look of the screen. Can anyone tell me how I can keep this from happening?

  • Apple you need to fix this

    Apple, I know you are here. I know this has been posted before, but I'm going to post this anyway. MAKE IT POSSIBLE TO PLAY MUSIC VIDEOS IN A PLAYLIST. This is ridiculous. I spent a lot of money on an Apple TV to entertain. It's stupid that I have to

  • Horizontal scroll bar not showing in PO

    Hi Experts, I'm unable to see the Horizontal scroll bar in PO item overview..so unable to see all the columns..is there any setting for that ???so that I can use it again ...