How to fill the first column '#' of matrix  with row id in user form?

Hi All,
I am having a user defined form in which, I m having a matrix and m populating the matrix with the output of an sql query.
something like this:
SQL_Str= "select col1,col2,......from.... "
OPopDBTable.ExecuteQuery(SQL_Str)
oMatrix.AddRow()
oMatrix.Columns.Item("Col3").DataBind.Bind("PopTable", "col1")
oMatrix.Columns.Item("Col2").DataBind.Bind("PopTable", "col2")
oMatrix.LoadFromDataSource()
Now, in this, how can I assign row number to first column ('#' column ) ??
regards,
Binita

Ah...the ROW_NUMBER() was posted by Petr - also thank you (again)
With my example-query from the other thread:
SELECT
     CAST(
             ROW_NUMBER() OVER (ORDER BY T1.U_LogNo ASC) AS INT
        ) AS RowCnt,
     T1.Code,
     T1.U_ParcelNo,
     T1.U_LogNo
FROM
     [@XXX_EXAMPLE] T1
WHERE
     T1.U_ParcelNo='132006' 
ORDER BY
     T1.U_LogNo ASC
...this works for me (it's quickly copied from several subs/func. - I hope it's not too much disordered):
DtLogs.ExecuteQuery(query)
oMtxLogs.Columns.Item("0").DataBind.Bind("DT_LOGS", "RowCnt")
oMtxLogs.Columns.Item("1")........
oMtxLogs.LoadFromDataSource()

Similar Messages

  • WPF: How to make the first column does not show row separator and Left column separator in DataGrid?

    Our WPF application uses DataGrid.
    One of request is that first column of DataGrid does not show row separator and also does not show Left column separator. So it looks like the first column does not belong to the DataGrid. However, when select a row, the cell of first column still get selected.
    How do we make it? Thx!
    JaneC

    Hi Magnus,
    Thanks for replying our question and provide your solution!
    Your solution works by setting "HorizontalGridLinesBrush" and "VerticalGridLinesBrush" to {x:Null} in the DataGrid style and modify "CellStyle" in first column as following:
    <DataGridTextColumn MinWidth="32"
    Binding="{Binding CellName}"
    CanUserReorder="False"
    CanUserSort="False"
    Header="Cell}"
    IsReadOnly="true" >
    <DataGridTextColumn.CellStyle>
    <Style TargetType="DataGridCell">
    <Setter Property="IsEnabled" Value="False"></Setter>
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type DataGridCell}">
    <Border BorderThickness="0" BorderBrush="{x:Null}"
    Background="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Margin="-1">
    <Grid Background="{TemplateBinding Background}" VerticalAlignment="Center" Height="42">
    <ContentPresenter VerticalAlignment="Center"/>
    </Grid>
    </Border>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    </DataGridTextColumn.CellStyle>
    </DataGridTextColumn>
    We found another way to achieve it by using DataGridRowHeader. The good way to use DataGridRowHeader is that we do not need to make the first column ReadOnly (click on first column does not select whole row anymore). Select RowHeader in a row will select
    whole row. Move scroll bar horizontally, the row header still keep in visible area.
    <Style TargetType="{x:Type DataGridRowHeader}" x:Key="dataGridRowHeaderStyle">
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="HorizontalAlignment" Value="Center" />
    <Setter Property="Height" Value="42" />
    <Setter Property="SeparatorBrush" Value="{x:Null}" />
    <Setter Property="FontSize" Value="16" />
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type DataGridRowHeader}">
    <Grid>
    <Border x:Name="rowHeaderBorder"
    BorderThickness="0"
    Padding="3,0,3,0"
    Background="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
    BorderBrush="{x:Null}">
    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
    </Border>
    </Grid>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    <DataGrid>
    <DataGrid.RowHeaderStyle>
    <Style TargetType="DataGridRowHeader" BasedOn="{StaticResource dataGridRowHeaderStyle}">
    <Setter Property="Content" Value="{Binding CellName}" />
    <Setter Property="Width" Value="35"/>
    </Style>
    </DataGrid.RowHeaderStyle>
    </<DataGrid>
    JaneC

  • How to find the First block....in a multi block form

    hi
    How i can find which is the first block in a multi block form....
    ( there are n number of forms with multi blocks...so
    i need to generalise the code to find the first block in all of
    the forms)
    regards
    Kris

    If you searched in the on-line help for "First", you would find that the Get_Form_Property built-in provides two: First_Block and First_Navigation_Block.

  • How to repeat the header in af:table with row exceed ?

    Hi All ,
    I am using JDeveloper 11.1.2.0
    My Scenario is I have one <af:table> with 100 rows if I click the print it prints first 50 rows in first page remaining rows print in the second page without column Names.
    I am using header text for create the column Names .Is any other way to create the Column Names dynamically in <af:table> for all the pages?
    CSS have any property to avoid this kind of problem ?
    Thanks ,
    Arun D.
    Edited by: ArunkumarDurairaj on Dec 6, 2012 12:29 PM
    Edited by: ArunkumarDurairaj on Dec 6, 2012 5:22 PM
    Edited by: ArunkumarDurairaj on Dec 6, 2012 5:23 PM

    Hi,
    maybe you could use a report or a export excel

  • How do I increase the width of the first column in the Terminal ls -l command?

    I am now running 10.9.x, but I've experienced the problem described in the question over the last several iterations of OS X.
    I use bash as my interactive shell. When I display the "ls -l" command in Terminal the output is often very difficult for me to scan, because the columns in which are displayed the several fields of the records for the listed files are misaligned (different left-hand first-letter starting points for left-aligned text-valued fields; different right-hand low-digit alignment of numerical fields).
    When I look more closely at the mess displayed in my Terminal window, it appears that the cause of the problem may be that no minimum width, or an inadequate minimum width, has somewhere been set or defined for the first column of each record, containing the file's "mode" string (permissions, etc.); for all records in which this string is of equal length, the succeeding columns for all fields in those records are themselves aligned.
    It has not always been thus for me in the Terminal with OS X, or else I might not dream that the world could be a better place in this one respect. But if I launch an interactive csh-shell instead of bash in Mavericks today, the columns of the ls -l command there align no better.
    I've found no help in the Unix man pages for the ls command. There is a COLUMNS environment  variable whose value is supposed to be used by the ls command to set the width of every column displayed, but this is not what I want to do, and in my shell "ls -l" seems to ignore the exported variable anyway.
    There is also an LS_COLWIDTHS environment variable that is described as setting column widths on a field-by-field basis, at least for some fields, but the the mode column is not included among those whose width is supposed to be adjustable, and my shell seems to ignore the value of this variable as well.
    I've looked in my rather simple ~/.profile and ~/.bashrc files for anything that I might plausibly suspect of producing or perpetuating this behavior, but there is nothing there. Any suggestions about how to remedy this problem?
    Randy Miller

    John,
    I would like you to perform a safe boot. On reboot, press and hold the shift key at the chime, until the grey horizontal bar appears. After you type in your password, press and hold the shift key again, then click the right arrow to login, and release the shift key when your desktop appears. Move the contents of your local ~/Library/Caches into the Trash. Reboot normally. Empty your Trash.
    Re-evaluate your Terminal behavior. If it now works ok, great. Otherwise, here are a sequence of screen shots of my Terminal preferences for comparison. I can use both Courier fonts without formatting issues. Click to enlarge. I use the free IR Black Terminal theme as a personal choice in OS X 10.9.4. In my ~/.bashrc file (triggered from ~/.bash_profile), I export TERM=xterm-256color, and invoke /usr/bin/tput init. Click on the following images to enlarge.

  • (JTable) How can i get the first columns cell in a selected row?

    Hello. I am trying to figure out how i can get the first columns cell within a selected row no matter what cell is selected in that row. I have a class that extends AbstractTableModel which represents the table. Now i have another class that extends DefaultSelectionModel. Each model is added to the JTable via setModel(TableModel dataModel), setSelectionModel(ListSelectionModel newModel). Now i don't understand what i have to return from getMaxSelectionIndex(). Any ides? Thanks.
      class xTableModel extends AbstractTableModel{
         private static String[] cols;
         private Object[][] data;
            public void setTableModel(Object data[][], String[] cols){
             this.cols = cols;
             this.data = data;
            public String getColumnName(int col){
             return cols[col];
            public int getRowCount() {
             return data.length;
            public Object getValueAt(int row, int col) {
             return data[row][col];           
            public void setValueAt(Object value,int row,int col){
             data[row][col]=value;
            public int getColumnCount(){
             return cols.length;
    class ColumnListenerModel extends DefaultListSelectionModel{
         public int getMaxSelectionIndex(){}

    int row = table.getSelectedRow();
    Object data = table.getValueAt(row, 0);

  • How do you print the numbers next to the first column

    In Numbers I can't figure out how to print the numbers next to the first column to the left. Say I have 350 people on a list and I want to print the sheet with the numbers next to the people's name, how do I do that. Excel automatically does it. However, I cannot find the option to print and include the numbers from the standard Numbers worksheet. Thanks for your assistance.

    In excel it is actually in the page setup dialog. under the "sheet" tab. Numbers doesn't have one table per page (excel is basically one large table of cells). So printing header and column labels doesn't really work in numbers, because those labels don't show up until you click inside the tables. If you notice when you do that they abstruct the view of everything else that might be near the edge of the table.
    The other posters response is the best way to do it. you can get column Numbers (but not letters) by using the column command in an extra row at top also. Thre is a way if you really want column letters, but it ain't pretty. Let us know if you want that too.
    Jason

  • How to add time informatio​n to the first column of spreadshee​t file?

    hi all.
    how to add time information to the first column of spreadsheet file?illustrated in the figure below。
    Solved!
    Go to Solution.

    You need to take the time data and convert it to double.  But Excel data is based on days since 1/1/1900 while LabVIEW data is based on seconds since 1/1/1904.
    Take a look at this thread for an example I posted on how to make the conversion.
    One other possibility is to convert your numeric data to a string, and build on an array of time that is also a string version of the timestamp.  Then write your 2-D string array to the Write to Spreadsheet file.

  • How to sort a 2 dim. array by the first column?

    Hi there,
    I need to know, how to sort a 2 dim. String array by the first column, which means "string[0][x]".
    I think, I have to implement a new comparator class. But how?
    Thanks in advance for any help

    I need to know, how to sort a 2 dim. String
    array by the first column, which means
    "string[0][x]".You want to sort the array using the first element in each row and that element is a String?
    Let's forget about generics. Say you want to supply a Comparator. The compare method should decide the order between elements when passed two element objects. In a two-dimensional array the elements will be one-dimentional arrays and you use the first element in those arrays, like
    public int compare(Object s1, Object s2) {
       String[] a1 = (String[]) s1;  // first row array
       String[] a2 = (String[]) s2;  // second row array
       return a1[0].compareTo(a2[0]); // compare first element of row arrays
    }

  • How to fix the first field or column in classical report while scrolling

    i want to know, how to fix the first field or column in classical report while scrolling
    horizontally. the first  should be constant when i scroll the report horizontally .
    please help me.
    it's urgent.

    Hi,
    Suppose your first field is itab-matnr.
    WRITE :/ itab-matnr.
    SET LEFT SCROLL-BOUNDARY.
    WRITE :/......."Remianing fields

  • How to show Summary label it in the first column of the sheet?

    Hi Gurus,
    I am wondering if i could show the Label of summary items in the first column instead of showing it along with the Summary data. As with the long worksheets if the summary column is at far right it doesn't look good and not readable too.
    Thanks.

    Thanks NP,
    Its really not good in Discoverer. Actually what I'm saying is as follows:
    EMPID EMPNAME SALARY
    emp01 EMPNMaa 100000
    emp02 EMPNMbb 500000
    emp03 EMPNMcc 1000000
    Sum:------------------- 1600000
    But what Discoverer does right now is:
    EMPID EMPNAME SALARY
    emp01 EMPNMaa 100000
    emp02 EMPNMbb 500000
    emp03 EMPNMcc 1000000
    --------------------------- Sum:1600000
    It really looks bad & not al all a user friendly. The sum label comes always with value. I think Oracle should improve it.
    Thanks.

  • Making JTable columns 2- n scrollable, not the first column, how?

    Id like for my JTable's first column to always be visible, and columns 2->n to be scrollable. The table also follows the sortable table model found from the swing examples...so if the user sorts any of the columns, all the other columns should sort accordingly.
    is there anyway i can separate the first column with the others, so that i can put them in their own scrollpanes (first column just scrolls up/down, and 2->n can scroll either way)?

    I only glanced at the example at the posted link... if memory servers, the trick was to create one JTable but with two different TableModels. To link the two models, you can simply make the getValueAt method in the fixed model call the getValueAt method of the non-fixed model. It's a bit tricky for beginner, but doable.
    ;o)
    V.V.

  • How to use the Combo Box In MAtrix Colums

    HI Experts,
    Good Mornong.How to use the Combo Box In MAtrix Colums?
    Regards And Thanks,
    M.Thippa Reddy

    hi,
    loading data in to the combobox on form load.but, it should be done when atleast one row is active.
    the values what ever you are inserting in to combo should  be less than or eqhal to 100 or 150.if it exceeds beyond that performance issue arises.it takes more time to load all the data.so, it is better to have 100 or less.
    oMatrix.AddRow()
    RS = Nothing
    RS = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
    RS.DoQuery("select ItemCode,ItemName from oitm")
    oCombo = oMatrix.Columns.Item("ColumnUID").Cells.Item(oMatrix.RowCount).Specific
    For i = 1 To RS.RecordCount
          If RS.EoF = False Then
                oCombo.ValidValues.Add(RS.Fields.Item("ItemCode").Value,RS.Fields.Item("ItemName").Value)
                RS.MoveNext()
          End If
    Next
    the above code is inserting data from database to column combobox.
    you can fill combo directly also as shown below.
    oCombo.ValidValues.Add("x","1")
    oCombo.ValidValues.Add("y","2")
    oCombo.ValidValues.Add("z","3")
    oCombo.ValidValues.Add("","")
    and what ever the values you are filling into combo should be unique.other wise it shows valid value exists.
    regards,
    varma

  • SQL Loader Inserts chr(13) and chr(10) in the first column of every row.

    Hi,
    I have exported a data in a pipe delimited file using TOAD in one database. Now I want to load the data in my local database using SQL Loader. However every time I try to load the data a double quote followed by a new line is entered for the first column of each row. Unfortunately the delimited file is very big and hence can't be posted here. However I tried the same with a customized table and its data and found the same problem. Below are the table structures and control file that I used.
    create table test_sql
    a varchar2(30),
    b date
    insert into test_sql values('51146263',sysdate-3);
    insert into test_sql values('51146261,sysdate-1);
    EXPORTED PIPE DELIMITED FILE_
    A|B|!##!
    51146261|04/14/13 4:55:18 PM|!##!
    51146263|04/12/13 4:55:32 PM|!##!
    create table test_sql1 as select * from test_sql where 1=2;
    CONTROL FILE_
    OPTIONS(SKIP=1)
    LOAD DATA
    INFILE 'C:\Users\Prithwish\Desktop\Test.txt' "str '!##!'"
    PRESERVE BLANKS
    INTO TABLE TEST_SQL1
    FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    A CHAR(2000),
    B DATE "MM/DD/YYYY HH12:MI:SS AM"
    select * from TEST_SQL1;
    After this when I paste it in notepad I get the following result
    A B
    51146261"     14-APR-0013 16:55:18
    51146263"     12-APR-0013 16:55:32.
    I have no idea how the quotes or the newline appear. Is this a Toad bug? Any help would be greatly appreciated. Really urgent.
    Thanks in advance
    Regards

    Hi Harry,
    I actually thought that the str !##! was causing the problem. Actually my original export has some new lines in some specific columns so I can't keep the new line as my line terminator and hence I kept the !##! as my terminator.
    When I put the same data in a notepad and load it there is no problem at all. For e.g I just typed the following in a notepad and the data loaded just fine.
    A|B|!##!
    51146261|01-01-01 10:10:10 AM|!##!
    51146263|01-01-01 11:11:11 AM|!##!
    Its just when I load the exported file there the problem arises though I have verified the file using UNIX as well using octal dump and found no hidden characters.
    Regards,
    Prithwish

  • How to add the Assignment column on this post outgoing payment in f-53

    Hi all,
    how to add the Assignment column on this post outgoing payment in f-53?
    thanks.
    Joo

    Hi ,
    If you want to see the assignment column in f-53 process open item screen
    1. First in O7V3 check for t.code FBz2 which line layout ( 2 digit code is assigned)
    2. Then in t.code O7z4s check in the line layout and if assignment field is not there then insert the field.
    then check in F-53.
    Hopw it will solve your problem.
    Assign points if useful
    Regards
    Prabhat

Maybe you are looking for