Fixed first row regardless of column sort

I have a report where I need the first displayed row always be a specific row that have the input fields (like text fields and select list .. etc), all columns in report are sortable. The problem is that when user sort the report by any column, the first row that have the input fields will not be the first row anymore because of sort.
does any one have an idea how to fix the input fields row at the top of the report (first row) regardless of sort?

Why include the input fields in the report and not use page items at the top of the report region?

Similar Messages

  • Continuing column from last row of column to first row of next column.

    Hi! I have been wrestling this bear for weeks now. I am scanning a lot of seals the same size, approximately 3" x 2". I only want my spreadsheet to scan 1 number in each cell and when it reached the bottom of Column A Row 8, I want the next # I scan to jump to Column B Row 1 and continue dow until it gets to the bottom of Column B Row 8, then I want it to jump to the next column, Column C and scan to the bottom row.
    Can I do this????? Help!

    I am working on an upcoming election and I have created a spreadsheet with 4 columns and 8 rows. I am scanning seals with barcodes on them. Each has its own unique barcode. I use a handheld scanner, like you would see someone at Wal-Mart scanning inventory or doing a price check. When I begin scanning these seals the first one I scan goes into cell A1 and then automatically moves to the next row down. Then I scan the next and it goes into A2, etc. BUT when I reach A8, and scan the next #, it moves into A9 but I want it to go to B1. This is a small election and I don't have as many to do this time and I am trying to figure out how to make it do this now so I have my template ready for the next big election. The seals are all attached like a continuous roll of mailing labels. I am only doing 28 seals this time for each location but I have over 40 locations. 1 page of 28 seals, all with individual barcoded seals for each. In a big election I might scan 80 - 90 seals per location and going all down one column would take several pages. (I use a large font so they can easily be read). Otherwise I have to stop at the bottom, A8, go to the keyboard and move the mouse to click in B1 and start scanning the next 8 #'s. So what I am trying to do is this ...... I have a roll of seals and I begin scanning each seal without having to use the keyboard and touchpad. After each barcode scan it automatically moves to the next cell down. When I reach A8 and scan the barcode I want it to automatically move to B1. I want my table to end at A8 as if there is no other cell below it. I actually have an Excel SS set up in Windows and it will do this on some I have created, but not others. I can do a Save As but it doesn't bring that feature over and I can't figure out how I got it set to do that in the first place.!??? Those crazy Windows machines! So I am trying to see if I can get my Numbers SS to do this. Maybe it is not an option in Numbers. Sorry for the long detail but if somebody knows how to do this I sure would appreciate that info. Thanks!!!

  • How to keep the first row fixed in a JTable, with sorting, and bellow the headers ?

    I am trying to change the following code so then the fixed rows will stay on top(but below the headers!), but when I change getContentPane().add(fixedScroll, BorderLayout.SOUTH); to getContentPane().add(fixedScroll, BorderLayout.NORTH); it stays above the headers. How can I put the first rows on top, but below the headers ? Thanks.
    import java.awt.*; 
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    * @version 1.0 03/05/99
    public class FixedRowExample extends JFrame {
      Object[][] data;
      Object[] column;
      JTable fixedTable,table;
      private int FIXED_NUM = 2;
      public FixedRowExample() {
        super( "Fixed Row Example" );
        data =  new Object[][]{
            {      "a","","","","",""},
            {      "","b","","","",""},
            {      "","","c","","",""},
            {      "","","","d","",""},
            {      "","","","","e",""},
            {      "","","","","","f"},
            {"fixed1","","","","","","",""},
            {"fixed2","","","","","","",""}};
        column = new Object[]{"A","B","C","D","E","F"};
        AbstractTableModel    model = new AbstractTableModel() {
          public int getColumnCount() { return column.length; }
          public int getRowCount() { return data.length - FIXED_NUM; }
          public String getColumnName(int col) {
           return (String)column[col];
          public Object getValueAt(int row, int col) {
            return data[row][col];
          public void setValueAt(Object obj, int row, int col) {
            data[row][col] = obj;
          public boolean CellEditable(int row, int col) {
            return true;
        AbstractTableModel fixedModel = new AbstractTableModel() {     
          public int getColumnCount() { return column.length; }
          public int getRowCount() { return FIXED_NUM; }
          public Object getValueAt(int row, int col) {
            return data[row + (data.length - FIXED_NUM)][col];
        table = new JTable( model );
        table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        table.setAutoCreateRowSorter(true);
        fixedTable = new JTable( fixedModel );
        fixedTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        fixedTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        JScrollPane scroll      = new JScrollPane( table );
        scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        JScrollPane fixedScroll = new JScrollPane( fixedTable ) {
          public void setColumnHeaderView(Component view) {} // work around
                                                 // fixedScroll.setColumnHeader(null);
        fixedScroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        JScrollBar bar = fixedScroll.getVerticalScrollBar();
        JScrollBar dummyBar = new JScrollBar() {
          public void paint(Graphics g) {}
        dummyBar.setPreferredSize(bar.getPreferredSize());
        fixedScroll.setVerticalScrollBar(dummyBar);
        final JScrollBar bar1 = scroll.getHorizontalScrollBar();
        JScrollBar bar2 = fixedScroll.getHorizontalScrollBar();
        bar2.addAdjustmentListener(new AdjustmentListener() {
          public void adjustmentValueChanged(AdjustmentEvent e) {
            bar1.setValue(e.getValue());
        scroll.setPreferredSize(new Dimension(400, 100));
        fixedScroll.setPreferredSize(new Dimension(400, 52));  // Hmm...
        getContentPane().add(     scroll, BorderLayout.CENTER);
        getContentPane().add(fixedScroll, BorderLayout.SOUTH);   
      public static void main(String[] args) {
        FixedRowExample frame = new FixedRowExample();
        frame.addWindowListener( new WindowAdapter() {
          public void windowClosing( WindowEvent e ) {
            System.exit(0);
        frame.pack();
        frame.setVisible(true);

    Sorry, this code missed a very important line:
    table.setAutoCreateRowSorter(true);
    So you meant:
    Object[][] header;//class atribute
    header=new Object[][]{//in the constructor
                { "h","i","j","k","l","m"},
                { "h","i","j","k","l","m"}
    public Object getValueAt(int row, int col) {//in the TableModel
            if (row==0){
                return header[row][col];
            else {
                return data[row][col];
    I tried, but when I sort, the first row get sorted with the rest.

  • First row fix in web inteface

    hello,
    in web interface I would maintain the heading line (first row) always fixed . What is the code JavaScript to insert?
    thanks
    DG

    What you want is something like the freeze frame solution in Excel ..
    tough boss - I have not seen it in any web template so far - would liek to know if it is possible - will be very helpful. But if it can be done through standard HTML I can definitely tell you how to do it.
    One work around would be to add a frame separately - something like a sinngle column with only the first column and then another table with everything else. Set the navigation block for the second table and include the dataprovider for the first column in the affacted dataproviders list for the navigation block - you can have the same thing. But I have seen something like this inJava Applet where you can have a floating column and the rest scrolls - but no idea how to do it in BW Web Templates. Or define your table structure in BW and try the above solution of two data providers.
    Arun
    P.S Just thought off my hat so the unstructured response.

  • How to create a first row in crystal report as opening balance which contains two columns with debit and credit

    I have created a crystal report with credit and debit column. Balance column created on the report. Report running with cummulative balance. THis report contain an option for date range. If i filtered this report its not showing the actual balance. I need
    a first row to indicate previous balance as opening balance in this report.  And following is the formula for balance column.
    Whileprintingrecords;
    Shared Numbervar balance;
    Shared Numbervar display;
    balance:={@debit}-{@credit};
    display:=display+balance;
    display

    As this question is out of the T-SQL queue, thus I would suggest you consult Crystal Report questions to the correct forums.
    C#
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral
    VB
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vbgeneral
    people there have more knowledge on Crystal Report.

  • Applying table scroll bar for only table rows with table columns fixed.

    hi oa gurus,
    i had implemented table scroll bars using oarawtextbean , there is no problem in vertical and horizontal scroll bar working its working fine. but the requirement is i need to scroll only the table rows with table columns fixed. so , how to achieve the table scroll for only table datas neglecting table headers.
    the code for vertical and horizontal bars scroll is like this,
    OARawTextBean ors = (OARawTextBean)webBean.findChildRecursive("raw1");
    ors.setText(div id=tabledivid style=height:500px;width:100%; overflow:auto>);
    OARawTextBean ore = (OARawTextBean)webBean.findChildRecursive("raw2");
    ore.setText("</div>");
    where raw1 and raw2 are rawtextbean created above and below of the table . but i dont know hoow to apply this only for table rows neglecting table columns , can anybody give any ideas.
    pelase this is very urgent , can u help me in this regards
    thanks
    Edited by: user630121 on Sep 29, 2008 5:17 AM
    Edited by: user630121 on Sep 29, 2008 5:18 AM

    hi,
    I have a similar task to do... Only to apply scrollbar at the table level.
    I tried using the above mentioned but I am facing Null Pointer Exception..
    Please explain about raw1 and raw2
    Rahul

  • Return first row entered based on date column

    I'm trying to select the first entered row in a table, as judged by the datetime column. If more than one row has the same date and time, then only one row should be returned (any row having that datetime is fine). Some processing will occur on that row and then it will be deleted. The select statement is used thereafter to select the next (first) entered row in the table, etc. This way, the rows are processed first-in first-out (FIFO) style. Here's my example table:
    create table my_table
    datetime date,
    firstname varchar2(50)
    insert into my_table(datetime, firstname) values(to_date('2012-04-02 11:00:00', 'YYYY-MM-DD HH24:MI:SS'),'ken');
    insert into my_table(datetime, firstname) values(to_date('2012-04-02 11:00:00', 'YYYY-MM-DD HH24:MI:SS'),'john');
    insert into my_table(datetime, firstname) values(to_date('2012-04-02 11:00:00', 'YYYY-MM-DD HH24:MI:SS'),'sue');
    commit;
    Here's my example select statement, which returns simply one row of the above, since all are the same date and time:
    SELECT *
    FROM my_table
    WHERE datetime = ( select min(datetime) from my_table )
    AND rownum = 1;
    My question is, if I use the following
    SELECT *
    FROM my_table
    WHERE datetime = ( select min(datetime) from my_table );
    It returns all 3 rows:
    DATETIME FIRSTNAME
    02-APR-12 11:00:00 ken
    02-APR-12 11:00:00 john
    02-APR-12 11:00:00 sue
    So, wouldn't setting rownum = 2 return john, and rownum = 3 return sue? For example,
    SELECT *
    FROM my_table
    WHERE datetime = ( select min(datetime) from my_table )
    AND rownum = 2;
    return no rows. I just want to make sure I'm understanding how the select statement above works. It seems to work fine for returning one row having the minimum date and time. If this is always the case, then everything is fine. But I wouldn't have expected it not to return one of the other rows when rownum is 2 or 3, which makes me question why? Maybe I can learn something here. Any comments much appreciated.
    Edited by: tem on Apr 2, 2012 2:06 PM

    Hi,
    tem wrote:
    ... So, wouldn't setting rownum = 2 return john, and rownum = 3 return sue? For example,, ROWNUM
    SELECT *
    FROM my_table
    WHERE datetime = ( select min(datetime) from my_table )
    AND rownum = 2;
    return no rows. I just want to make sure I'm understanding how the select statement above works. It seems to work fine for returning one row having the minimum date and time. If this is always the case, then everything is fine. But I wouldn't have expected it not to return one of the other rows when rownum is 2 or 3, which makes me question why? Maybe I can learn something here. Any comments much appreciated.ROWNUM is assigned as rows are fetched and considered for inclusion in the result set. If the row is not chosen for any reason, the same ROWNUM will be reused with the next row fetched. ROWNUM=2 will not be assigned until a row with ROWNUM=1 has been included in hte result set.
    So, in your example:
    SELECT  *
    FROM    my_table
    WHERE   datetime = ( select min(datetime) from my_table )
    AND     rownum = 2;Say the first row that happens to be fetched has firstname='ken'. It is assigned ROWNUM=1, and fails the WHERE clause condition "WHERE rownum = 2".
    Say the next row fetched has firstname='john'. ROWNUM=1 hasn't been used yet, so this row is also assigned ROWNUM=1, and it fails the WHERE clause for the same reason. Likewise with the next row; it also is assigned ROWNUM=1, and it also fails.
    When using ROWNUM in a WHERE clause, you almost always want to say "ROWNUM = 1" or "ROWNUM <= n".
    You could also use the analytic ROW_NUMBER function:
    WITH     got_r_num     AS
         SELECT     datetime, firstname
         ,     ROW_NUMBER () OVER (ORDER BY  datetime)     AS r_num
         FROM     my_table
    SELECT     datetime, firstname
    FROM     got_r_num
    WHERE     r_num     = 1
    ;Here, all values of r_num are available, so it would make sense to say things like "WHERE r_num = 2" or "WHERE r_num >= 2".
    Edited by: Frank Kulash on Apr 2, 2012 5:31 PM
    Added to explanation.

  • Sorting rows by choosen column.

    What kind of Array(Map, or any other data structure) should I use, if i want sort all rows by values in j-th column.
    Suppose i need to store data like this:
    Name | Surname | Telephone
    ---------| ---------------|--------------
    Dawid| Olaf | 3422353
    Jack | Ugly | 7872347
    Mike | Opis | 38483848
    And now i want sort all rows by Surname.
    Is there any covenient data structure to make such things ?

    Why you asking for ?
    I'm simply not familiarize with data structures in java and i thought that there is data structure in java like array, with possibility of sorting rows by choosen column.
    I think the only way to do that is use sortAllRowsBy(DefaultTableModel model, int colIndex, boolean ascending).

  • Second row data -  First row data of other column?

    Hi All,
    I have a requirement to show the second row data of the column1 as first row in column2. Please see the example below, where month is filtered <= 05.
    Month    Sales    Sales_New
    01         500      600
    02         600      700
    03         700      800
    04         800      900
    05         900      NULLIn the above example for month 05, column Sales_New should show NULL because it is the last row of the query.
    Thanks in advance.

    Something gone wrong with your config....!!
    How about
    "In Criteria tab use Month descending order and in Pivot table use ascending order"
    This is mandatory to achieve this..
    FYI: I've tested this in my local.
    If you need will send screenshot
    I appreciate if you mark as correct ;) else let me know

  • Grab the first rows and put it to column wise

    Below are two dump, i want to grab the first 2 rows in ascending order by from_date and put to column wise, the first row label first_charge and second row as second_charge. AND throw away rows from 3 are not needed.
    1st dump 5 columns are my input,
    2nd dump 3 columnS ARE my desired output.
    I have tried the rank function but can someone please confirm this is correct way to do this for all the accounts in the table
    Script (table and data) for 1st dump is at bottom of post.
    Can anyone help resolve this issue - thanks.
    --FIRST DUMP
    ACCOUNT_ID     CHARGE_AMT     CHARGE_DATE     FROM_DATE     THRU_DATE
    212855740     14.52          5/04/2012     14/03/2012     31/03/2012
    212855740     25          5/04/2012     1/04/2012     30/04/2012
    212855740     25          5/05/2012     1/05/2012     31/05/2012
    212855740     25          5/06/2012     1/06/2012     30/06/2012
    212855740     25          5/07/2012     1/07/2012     31/07/2012
    212855740     25          5/08/2012     1/08/2012     31/08/2012
    212855740     25          5/09/2012     1/09/2012     30/09/2012
    212855740     25          5/10/2012     1/10/2012     31/10/2012
    212855740     25          5/11/2012     1/11/2012     30/11/2012
    --DESIRED DUMP                    
    ACCOUNT_ID     PRO_CHARGE     MONTHLY_CHARGE          
    212855740     14.52          25          
    WITH CHARGE_TABLE_QUERY
         AS (SELECT account_id,
                    charge_amt,
                    charge_date,
                    from_date,
                    thru_date,
                    ROW_NUMBER ()
                       OVER (PARTITION BY account_id ORDER BY from_Date)
                       row_num
               FROM my_tbl)
      SELECT account_id,
             MAX (CASE WHEN ROW_NUM = 1 THEN CHARGE_AMT ELSE 0 END) PRO_CHARGE,
             MAX (CASE WHEN ROW_NUM = 2 THEN CHARGE_AMT ELSE 0 END) MONTHLY_CHARGE
        FROM CHARGE_TABLE_QUERY q
       WHERE row_num IN (1, 2)
    GROUP BY account_id;

    ricard888 wrote:
    what happens if a new account where there is no second charge yet. can i have either null or 0 in the monthly_charge.You could test it easily. Anyhow, it will work without any change in the code
    insert into my_table
    select 1,50,CHARGE_DATE,FROM_DATE,THRU_DATE
    from my_table
    where rownum = 1;
    1 rows inserted.
    with CHARGE_TABLE_QUERY as
      select account_id,charge_amt,
             ROW_NUMBER ()
                OVER (PARTITION BY account_id ORDER BY from_Date)  rn,
             lead(charge_amt)
               OVER (PARTITION BY account_id ORDER BY from_Date) MONTHLY_CHARGE
      from my_table
    select account_id,charge_amt pro_charge,monthly_charge
    from CHARGE_TABLE_QUERY
    where rn = 1;
    ACCOUNT_ID PRO_CHARGE MONTHLY_CHARGE
             1         50               
    212855740      14.52             25

  • Grand total level of the percentage column giving value from the first row of column

    Hi Guys,
    I have a requirement like to show the percentage value which the calculation of two columns , in the grand total level .
    I think it can be achievaable by giving the aggregation rule for that column as Server complex Aggregate .
    eg.
    Fiscal Year  Department  subdepartment   Total cost     Sub Department cost     % cost
    2011           Edu             Books                 500              50                               10
    2011           Edu             Note Book           200            100                                50
    2011           Edu             Furniture             300             30                                 10
    2011            Edu                                      1000           180                              18
    Grand Total
    Ideally it should come like as above ..but the problem with me that ,it showing correct value for  all the rows ,but at the grand total level it's taking the value of % cost from the first row . like below..
    2011           Edu                                   1000                  180                         10
    Grand Total  
    I have calculated the % cost column in the answer itself  as (Sub Department cost /Total Cost )
    where the
    Aggregation rule for the columns given are
    Total Cost - Sum  ,Sub Dep Cost -  Sum, % Cost - Server Complex Aggregate
    So plz suggest me any Idea to achieve this ..Thanks in advance.

    Give the agg. as avg for % field.
    Best of Luck,
    Kashi

  • How can we fix images and String in a perticular row's second column in JTa

    Hi,
    I have to design a window in which there is a table I have to set the some row's second column data with images and text data both and some row contan only text data Please help me on it .There is two column and 5 row in my table.
    Thanks in advance,
    anum

    [url http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#editrender]Using Editors and Renderers
    You will need to create a custom renderer to display both an image and text. Renderers are assigned to a column. If you require different renderers for a given row in a column then you will need to override the getCellRenderer(...) method to return a renderer for the specific row.

  • Default value for first row in table after row has rendered

    I have a master-detail type page where the first row in the detail table appears with no values when the page first renders. After the user enters some data in the master area, the default value is available. I then use something like this to set the default in one column of the first row:
    MyVOImpl vo = (MyVOImpl)am.getMyVO1();
    MyRowImpl voRow = (MyRowImpl)vo.first();
    voRow.setMyAttribute("some value");
    When I do this and run the code in the debugger, I can see that the default value is stored somewhere in the row object. However, the value is not displayed in the screen.
    What must I do to get the default value to display after the user has tabbed out of the master data area, and before the user attempts to enter data in the row?

    Hi. Thanks again.
    Here is more detail of the code:
    if (pageContext.isLovEvent())
    * Form was submitted because the user selected
    * a value from the LOV modal window,
    * or because the user tabbed out of the LOV input.
    * This code executes when the event is either
    * LOV_UPDATE or LOV_VALIDATE
    String lovInputSourceId = pageContext.getParameter(SOURCE_PARAM)
    // Find out the result values of the LOV.
    Hashtable lovResults =
    pageContext.getLovResultsFromSession(lovInputSourceId);
    // Find out which LOV input triggered the event.
    if (lovInputSourceId.equals("myLovItemId"))
    String myDefaultVar = null;
    if (lovResults != null)
    myDefaultVar = "some stuff " + (String)lovResults.get("myResultItemId")
    if (myDefaultVar != null && myDefaultVar != "") // yes, this is always true in this case
    // now set the default for the first line.
    // Added lines will be defaulted by the
    // EO.create() method.
    MyVOImpl myVo = (MyVOImpl)am.getMyVO1();
    MyVORowImpl myVoRow = (MyVORowImpl)myVo.first();
    myVoRow.setAttribute("myRowItemId", myDefaultVar); // THIS LINE DOES NOT CAUSE DISPLAY TO CHANGE
    The problem, as noted in the code, is that setAtrribute() does not cause the default value to display in the field.
    What can cause this, and what can fix it?
    Edited by: user522137 on Nov 9, 2010 12:06 PM

  • 64-bit driver only returns first row of table

    I have a C++ application using ADO (the MSADO COM components) and the Oracle OLEDB provider for database access. The application works fine on a 32-bit computer using the 32-bit Oracle client and driver. However, when I run a 64-bit build of the application, running on a 64-bit computer (Windows Server 2008 x64), using the 64-bit Oracle client and driver, a SELECT operation returns only the first row of the table.
    Note that this is only happening with the ActiveX ADO components. ADO.NET is not having a problem.
    In both cases I am connecting to the same database, which is Oracle 10.2 (32-bit) running on a different server. I have tested with Oracle client 10.2.0.4 and 11.1.0.7 and got the same result in both cases.
    I have reproduced the issue with a simple table (one column, NVARCHAR2(255)) and simple code.
    In the code, I execute "select count(*) from tablename" and get the correct record count (more than one record). But when I then open the recordset ("select columnname from tablename"), ADO reports EndOfFile after I have read the first row and called MoveNext on the recordset.
    My Oracle knowledge is limited so I don't know if there are driver properties I should be checking.
    Anyone have ideas?
    Thanks in advance.

    For 10.2 it's fixed in 10204 Patch 21 and higher.
    For 11.1 it's fixed in 11107 Patch 12 and higher.
    Cheers,
    Greg

  • Binding on an iterator always return the first row  of the Children VO...

    I have 3 pages:
    A -- tree table bound to VO A; B is used to view the detail of a row selected inside the table; Inside B there is another table that contains the childrens VO of B. Select a row in the table will launch C to view the details of the children.
    They are all in unbounded task flow.
    From A to B, it works fine: Details of selected row inside the Table of A is showing correctly.
    However, From B to C, selecting a row inside B, When C is launched, it always shows the content of the first row of the B's Children VO.
    Any idea how this can be fixed? I want C page to show the details of the row selected in B's Table.
    B's table is defined like this:
    <af:table value="#{bindings.C.collectionModel}"
    var="row"
    rows="#{bindings.C.rangeSize}"
    fetchSize="#{bindings.C.rangeSize}"
    rowBandingInterval="1"
    selectedRowKeys="#{bindings.C.collectionModel.selectedRow}"
    selectionListener="#{bindings.C.collectionModel.makeCurrent}"
    rowSelection="single"
    id="rTable"
    styleClass="AFStretchWidth"
    columnStretching="column:c1"
    autoHeightRows="20"
    contentDelivery="immediate">
    </af:table>
    How can I fix this to correctly show the details of seleted row for C?
    Edited by: user735345 on Oct 3, 2010 9:24 PM

    Hi,
    Is this code you provided for B table or for C table??
    Do you have your partial triggers set correctly?
    Regards,
    Dimitris.

Maybe you are looking for