Resize Columns In Table2 based on Table1

I have two tables. One with data and one with
totals on that data. I want the totals table to resize
it's columns based on the column sizes of the data table.
Do you know how to do that?
Thanks,
Zeke

Would that be the columnMarginMoved method that I need to
overwrite? Do you know how to get the new margins of a column?
Thanks,
Zeke

Similar Messages

  • SQL to update two columns in TABLE2 from TABLE1

    I know this is a simple question for some of you, but I am new to SQLs, so please help...
    I have two tables TABLE1 & TABLE2 as below, both tables contains more then 50million records:
    SELECT * FROM TABLE1.
    ID                        BUS_FID                WORKID                  STATIONID                 
    28400000117234         245                    13461428.25           16520877.8            
    28400000117513         403                    13461428.25           16520877.8            
    28400000117533         423                    13461428.25           16520877.8            
    28400000117578         468                    13461428.25           16520877.8            
    28400000117582         472                    13461428.25           16520877.8            
    SELECT * FROM TABLE2.
    BUS_FID                    ID                 TRPELID                RELPOS                 WORKID                 STATIONID               
    114                    28400000117658         28400000035396         23.225                                                              
    115                    28400000117659         28400000035396         23.225                                                              
    116                    28400000117660         28400000035396         23.225                                                              
    117                    28400000117661         28400000035396         23.225                                                              
    118                    28400000117662         28400000035396         23.225                                                              
    119                    28400000117663         28400000035396         23.225                                                              
    120                    28400000117664         28400000035396         23.225                                                              
    121                    28400000117665         28400000035396         23.225                                                              
    122                    28400000117666         28400000035396         23.225                                                              
    123                    28400000117667         28400000035396         23.225                                                              
    124                    28400000117668         28400000035396         23.225                                                              
    125                    28400000117669         28400000035396         23.225                                                              
    126                    28400000117670         28400000035396         23.225    Now I tried to use following SQL to update WORKID & STATIONID columns in TABLE2 but failed. BUS_FID in both tables have been UNIQUE indexed and they can be used as primary keys to join these two tables.
    UPDATE (
      SELECT  p.WORKID px,
              p.STATIONID py,
              p.BUS_FID pid,
              temp.WORKID tempx,
              temp.STATIONID tempy,
              temp.BUS_FID tempid
        FROM  TABLE1 temp,
              TABLE2 p
        WHERE pid = tempid
      SET px = tempx,
          py = tempy;
    COMMIT;with above code, Oracle returned following errors:
    SQL Error: ORA-00904: "TEMPID": invalid identifier
    00904. 00000 -  "%s: invalid identifier"Can anyone help me to correct it? Thanks~~~
    BTW, both two tables contains over 50 million records. So, if you have a better SQL to perform the same task, please let me know!
    Appreciated your help at advance.

    Hi,
    984210 wrote:
    Tried to change to
    p.bus_fid = temp.bus_fidit start running.
    Can anyone please explain to me why this is happening? Thanks!!Column aliases (such as pid and tempid in your statement) can't be used in the same query in which they are defined (except in an ORDER BY clause). Elsewhere, you have to refer to the columns by their actual names.

  • Why table getWidth and setWidth is not working when resize column the table

    hi all,
    i want to know why the setWidth is not working in the following code,
    try to uncomment the code in columnMarginChanged method and run it wont resize the table.
    i cont set width(using setWidth) of the other table column using getWidth of the main table column.
    and i want to resize the right side columns only (you can check when you resize the any column the left and right side columns also resizing)
    any suggestions could be helpful.
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.Box;
    import javax.swing.BoxLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTable;
    import javax.swing.SwingUtilities;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.TableColumnModelEvent;
    import javax.swing.event.TableColumnModelListener;
    import javax.swing.table.TableColumnModel;
    public class SynTableResize extends JFrame implements TableColumnModelListener, ActionListener
        JTable  table1       = new JTable(5, 5);
        JTable  table2       = new JTable(5, 5);
        JTable  table3       = new JTable(5, 5);
        JButton btn          = new JButton("refresh");
        JPanel  pnlcontainer = new JPanel();
        public SynTableResize()
            setLayout(new BorderLayout());
            pnlcontainer.setLayout(new BoxLayout(pnlcontainer, BoxLayout.Y_AXIS));
            pnlcontainer.add(table1.getTableHeader());
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(table2);
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(table3);
            table2.setTableHeader(null);
            table3.setTableHeader(null);
            table1.getColumnModel().addColumnModelListener(this);
            table3.setColumnModel(table1.getColumnModel());
            table2.setColumnModel(table1.getColumnModel());
            table2.getColumnModel().addColumnModelListener(table1);
            table3.getColumnModel().addColumnModelListener(table1);
            btn.addActionListener(this);
            getContentPane().add(pnlcontainer, BorderLayout.CENTER);
            getContentPane().add(btn, BorderLayout.SOUTH);
            setSize(new Dimension(400, 400));
            setVisible(true);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
        public static void main(String[] args)
            new SynTableResize();
        public void columnAdded(TableColumnModelEvent e)
        public void columnMarginChanged(ChangeEvent e)
            TableColumnModel tcm = table1.getColumnModel();
            int columns = tcm.getColumnCount();
            for (int i = 0; i < columns; i++)
                table2.getColumnModel().getColumn(i).setPreferredWidth(tcm.getColumn(i).getWidth());
                table3.getColumnModel().getColumn(i).setPreferredWidth(tcm.getColumn(i).getWidth());
                // the following commented code wont work.
    //            table2.getColumnModel().getColumn(i).setPreferredWidth(tcm.getColumn(i).getPreferredWidth());
    //            table3.getColumnModel().getColumn(i).setPreferredWidth(tcm.getColumn(i).getPreferredWidth());
    //            table2.getColumnModel().getColumn(i).setWidth(tcm.getColumn(i).getWidth());
    //            table3.getColumnModel().getColumn(i).setWidth(tcm.getColumn(i).getWidth());
            SwingUtilities.invokeLater(new Runnable()
                public void run()
                    table2.revalidate();
                    table3.revalidate();
        public void columnMoved(TableColumnModelEvent e)
        public void columnRemoved(TableColumnModelEvent e)
        public void columnSelectionChanged(ListSelectionEvent e)
        public void actionPerformed(ActionEvent e)
            JTable table = new JTable(5, 5);
            table.setColumnModel(table1.getColumnModel());
            table.getColumnModel().addColumnModelListener(table1);
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(table);
            pnlcontainer.validate();
            pnlcontainer.repaint();
    }thanks
    dayananda b v

    hi,
    thanks for your replay,
    yes i know that, you can check the following code it works fine.
    actually what i want is, when i resize table column it shold not automaticaly reszie when table resized and i dont want horizontal scroll bar, meaning that all table columns should resize with in the table size(say width 300)
    if i make table autoresize off than horizontal scroll bar will appear and the other columns moved and i want scroll to view other columns.
    please suggest me some way doing it, i tried with doLayout() no help,
    doLayout() method only can be used when table resizes. first off all i want to restrict table resizing with in the limited size
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import javax.swing.Box;
    import javax.swing.BoxLayout;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.event.ChangeEvent;
    import javax.swing.table.TableColumnModel;
    public class TempSycnTable extends JFrame
        JTable  table1       = new JTable(5, 5);
        MyTable table2       = new MyTable(5, 5);
        MyTable table3       = new MyTable(5, 5);
        JPanel  pnlcontainer = new JPanel();
        public TempSycnTable()
            JScrollPane src2 = new JScrollPane(table2);
            JScrollPane src3 = new JScrollPane(table3);
    //        table1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    //        table2.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    //        table3.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    //        src2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    //        src3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            table2.setTableHeader(null);
            table3.setTableHeader(null);
            table3.setColumnModel(table1.getColumnModel());
            table2.setColumnModel(table1.getColumnModel());
            table2.getColumnModel().addColumnModelListener(table1);
            table3.getColumnModel().addColumnModelListener(table1);
            table2.setTableHeader(null);
            table3.setTableHeader(null);
            setLayout(new BorderLayout());
            pnlcontainer.setLayout(new BoxLayout(pnlcontainer, BoxLayout.Y_AXIS));
            pnlcontainer.add(table1.getTableHeader());
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(src2);
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(src3);
            getContentPane().add(pnlcontainer, BorderLayout.CENTER);
            setSize(new Dimension(300, 300));
            setVisible(true);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
        public static void main(String[] args)
            new TempSycnTable();
        class MyTable extends JTable
            public MyTable()
                super();
            public MyTable(int numRows, int numColumns)
                super(numRows, numColumns);
            public void columnMarginChanged(ChangeEvent event)
                final TableColumnModel eventModel = table1.getColumnModel();
                final TableColumnModel thisModel = getColumnModel();
                final int columnCount = eventModel.getColumnCount();
                for (int i = 0; i < columnCount; i++)
                    thisModel.getColumn(i).setWidth(eventModel.getColumn(i).getWidth());
                repaint();
    }thanks
    daya

  • How to resize column width in report?

    hi all,
    i read somewhere here that in order to resize column width in a report, you need to go to report attributes, then edit the column you wish to resize and then go to the CSS Style and place something like "width=600px". while this works very well in Internet Explorer, it somehow has no effect in Firefox 3.0. is there a way to make it work both browsers?
    thanks
    allen

    Hi,
    Sorry, I misunderstood. There are several methods you could use:
    1 - Use the span tags around the data itself - this would require adding the tags into the sql statement itself
    2 - Use javascript to set the column widths by adding a style to the TD tags for each cell
    3 - Create a new Report Template and use COL tags immediately after the TABLE tag in the Before Rows section to specify the widths of all columns
    Option 3 may be the easiest?
    Andy

  • Resizing columns and making multiple selections in Pages 5.0

    Using Pages 5.0 (using OS X), I am no longer able to resize columns in a table by dragging a selection handle as I could in the old Pages (2009, I think it was). Dragging now adds the adjacent column to the selection. Anyone know how to resize the columns by dragging?
    Also, in the previous Pages, I could select multiple noncontiguous words by holding down the command key. Doesn't work anymore. Does anyone know how to do that?

    Apple has removed 90+ features from Pages5:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&mforum=iworktipsn trick
    Pages '09 should still be in your Applications/iWork folder:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=432&mforum=iworktips ntrick
    Trash/Archive Pages 5 after exporting any Pages 5 files back to Pages '09 format.
    Then rate/review Pages 5 in the App Store.
    Peter

  • Resize columns in Pages for iPad?

    Is there a way to resize columns in a multi-column document in Pages for iPad? I want a narrow left column and a wider right column. I can kinda get the effect by using a table, but it'd be easier to just adjust the column widths. Is this possible, and if so, how?

    Hi Adarga,
    I'm not seeing a way to resize the columns and the Help doesn't mention it either. I'm just able to change the indents and "margins" within the columns, but the columns stay the same size.
    ivan

  • Resizing columns in iTunes 10

    I've noticed some strange behavior in iTunes 10 regarding the resizing of displayed columns in List view. It appears that I can resize any displayed column in my main library, with exception to the immovable 1st column (the "currently playing or paused" column) or the checkmark column. This is fine.
    The problem comes when I try to resize columns on an attached iPod. I can resize some columns, but not all ... that makes no sense! For instance, with my current settings, the optional displayed list view columns for my iPod are (currently in this order):Artist, Track #, Time, Album, Date Added, Size, Kind, Bit Rate, and Rating. In addition to these, there are the 3 default columns: the song order/play status column, and the Name column. I can't resize any of the default columns, nor can I resize these columns: Date Added, Kind, Rating, or Size.
    Also, you should be able to resize the columns in the Column Browser, but you can't do that in either the main library OR an iPod library.

    While viewing your iPod Library, try opening View Options (on my Mac, it's Cmd-J). Uncheck the columns you can't resize, and click OK. Those columns should disappear. Open View Options again, and recheck them. See if you are now able to resize them. This procedure worked for me on iTunes 9.2.1.

  • Disable sorting and resizing columns on table view

    Is there a way to disable sorting and resizing columns on table view?
    Thanks

    Use
    setSortable(false)
    setResizable(false)
    on each TableColumn

  • Explain plan needs resize columns best-fit

    Is there an easy way to resize columns in the explain plan grid? They are difficult to resize if the values in them are long, especially the access and filter columns at the end.

    There is only one way to resize these right now (and thats the one you are using).

  • Can't resize column to fit text

    Can't resize column to fit text in numbers.  option is "grayed-out" no matter what I do

    It is either a glitch or a rather unfun new thing. No one knows for sure. You do have a bit more control if you go into your photos app, find your photo and tap on the little box with the arrow poking out of it. That allows you to send it to be wallpaper. You can do some scaling, although not as much as you used to.
    Finding work arounds is about all you can do until it's fixed.

  • JTable user resize columns with grid?

    Is it possible to allow a user to resize columns not just through the table header, but with the vertical grid lines?

    There is no method that allows you to toggle this
    feature on/off if thats what you are asking.Yes, thats what I was asking.
    If you want to implement this type of functionality
    yourself then take a look at the source code for
    JTableHeader to see how its done.Thanks, I'll look into that - though it would be cool if that was already a feature of JTable.

  • Resize column width for JTable without column headers?

    Hi,
    I find that for me to resize columns of a JTable by using
    mouse dragging, I MUST have column headers and then drag
    column headers to resize them. Is my understanding correct?
    Actually, I need to have a table without header columns.
    How can I use mouse to resize column width by dragging?
    The background for this request is that I am putting a
    complex table as another table's column header and I hope to
    be able to resizing the complex table by mouse dragging.
    Thanks very much,
    David

    Hi,
    I think you have mistake there. Try
    <style type="text/css">
    table.apexir_WORKSHEET_DATA td {
    white-space:nowrap !important;
    td[headers="DESCR"] {
    width:300px !important;
    max-width:300px !important;
    #apexir_DESCR {
    width:10px;
    max-width:300px !important;
    </style>And you can try add
    table.apexir_WORKSHEET_DATA {
    width: 100% !important;
    table-layout: fixed !important;
    }Regards,
    Jari
    My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

  • Resizing columns in iTunes store

    Ok so they new look is bland, boring, and uncreative. But, I don't have a choice. Feels like I walked into a walmart store. But, whatever.
    How do you resize columns in the iTunes store? I cant read the song names because apple has no resizing feature. And it's very annoying.
    Thanks,
    Nick

    I completely agree - this is annoying! I found another topic in this forum about this where it was suggested that Apple be contacted via their feedback form at http://www.apple.com/feedback/itunesapp.html. I've just done this and suggest that anyone else who finds this annoying do the same! Hopefully, if more people report it, it will be fixed in the next update.
    Another topic I came across suggested using the Browse feature (by going to the Home page, then clicking "Browse" in the top right quick links). This will return results in a list similar to the previous version, which had resizable columns. The only trouble is, you can't search this way, only browse, so it still doesn't assist in making locating tracks more efficient :S

  • Can't resize columns in new iTunes store

    Well .. the new iTunes9 store is just horrendous, and a step back from the previous version. i'd beg for the previous version but it's never gonna happen.
    one of the most simple and yet horrendously awful things is the apparant inabilityto resize columns when browsing an arists. if the name of a track is wider than the column ... how do you see it? there is now way to scroll across and see the complete name of the track/remix.
    anyone know a work around for this. anyone from Apple care to comment on such an obvious design flaw?

    I'll echo this. Look up Classical Music, anything there is nigh impossible to find. Telling me that a song is "symphony no. 9 movem...." is useless. I don't care, I know that. What I want to see is the movement. But I can't. Or how about dance remixes? I know the name of the song, I'd like to be able to see the actual remix name.
    On top of that, you can't even choose what you want to view by. If I am searching for all the U2 songs, I don't need to see that the artist is U2. I'd much rather use that space for more productive things.
    I simply cannot understand who at Apple thought this was a "better" user interface. Sacrificing user operability for a "spiffy" new makeover is not what I would expect from Apple.

  • Cannot resize columns in Coverflow in Finder

    my mid 2009 MBP using ML will not let me resize columns in Finder when in coverflow view as i can when in list view. this is sort hard to manage and i'd like to fix it.
    any ideas?
    TIA

    hi sb.
    i may be mistaken here. i am trying to start working in ML on the laptop after getting things organized and maybe i am not understanding something.
    does finder in ML open to some kind of "global" Finder Window that sometimes shows all files or is somehow different than the second finder window?
    or - - er (testing here), i guess when you /first/ open Finder you see this bar that won't resize but if you actively then select something in the pane on the left or if you open a /second/ Finder window i don't see this image that doesn't have the ability to resize the columns...?
    THANKS

Maybe you are looking for

  • Dual boot OS X instructions

    Hello, Is did a few searches in the support knowledge management section for this information but could not find a specific document. So I am hopeful for some help here. I am a dj and I have a 2009 mbp. I am going to upgrade the hard drive very soon

  • System Center 2012 Operations Manager - Which do I need Datacenter or Standard license

    We are monitoring around 1,400 SQL, Sharepoint, and BizTalk servers with about 30% of them being VM.  All of our SCOM infrastructure servers will be VM (4 MS servers, 1 Reporting server, 1 Web server), with the exception of the DB servers being physi

  • Panel does not start automatically in Gnome 2.24.3

    Since Gnome 2.24.3, the Gnome Panel does not start automatically. I had to manualy add it to the startup group via "Sessions" in order to force it to start when login finishes. Does anybody has the same behavior? Should I report it as a bug?

  • MDSD Application Start Error

    Hi Folks, I've followed all the instructions to install the MDSD client in our device, however I am getting the following error at the trace display option: "MDSD30_SP02 cannot be accessed because com.sap.dsd.appctrl.DSDMain cannot be instaniated  Re

  • Question about replacing corrupted file in windows 7

    hi, I read in windows 7 bible that if a system file is corrupted , I can replace it with system recovery tool (at command prompt) if I have onother computer with windows 7 installed.  my question is here , if I replace any file with copy the file fro