Problem AddRow in Matrix

Execute the following code to add rows in a matrix.
for (int RecIndex = 0; RecIndex <= RecCount - 1; RecIndex++)
                        oMatrix.AddRow(1, oMatrix.RowCount);
                        string coluna = rec.Fields.Item(0).Value.ToString();
                        string descricao = rec.Fields.Item(1).Value.ToString();
                        ((SAPbouiCOM.EditText)oMatrix.Columns.Item("V_0").Cells.Item(oMatrix.RowCount).Specific).Value = coluna;
                        ((SAPbouiCOM.EditText)oMatrix.Columns.Item("V_1").Cells.Item(oMatrix.RowCount).Specific).Value = descricao;
                        rec.MoveNext();
The problem is that the values ​​are added to the matrix problems. Sometimes it adds value in a row, and sometimes the line with preeche blank.
In other words, is created in the amount of matrix rows according to the For, but many line are not satisfied with the values ​​passed.

Hi Harley,
What type of datasource is your matrix bound to (ie DBDataSource, UserDataSource or DataTable)? It's normally better to write your data to the datasource rather than the matrix cells (the only exception being system forms).
Kind Regards,
Owen

Similar Messages

  • Problem converting the matrix dvd with videora

    Hi, Iv'e been using dvd decryptor and videora ipod converter to get my dvd's on my ipod and it's been working until now but I'm having a problem with the matrix dvd (the first one widescreen edition). For some reason when ever I convert it with videora a little piece of the video gets cut out (the part where trinity goes into slow-mo and kicks the cop in the face) but the audio dosen't so for the rest of the movie the av sync is off by about 5 seconds. If anyone else has had this problem or has any ideas please help.

    I tried ripping the dvd with smart ripper instead of dvd decryptor and got the same problem so it seems like the problem is with videora. Are there any other programs like videora that might work? Also I do have quicktime pro and the mpeg encoder for it so is there a way to do it using that?

  • Problem binding a matrix in the Sales Order Form

    Hi everybody!
    I am working in an Add-On. What I do is modify the sales order form in runtime. I catch the event when the form is loading and then I add a new folder with some fields and a matrix.
    I've got a matrix in this form with the employees that participate in an order and when I go through all the orders by using the next and previous record buttons I have to rebind it to show the participants in a specific order. The code for the event is the following:
            If (pVal.ItemUID = "57") And pVal.Before_Action = False And pVal.EventType = et_ITEM_PRESSED Then
                BindParticipantGrid
                BubbleEvent = False
            End If
    After bind the grid, BO shows a System message indicating that the form has been changed and asking me if I want to save the changes to the order. Looks like, whenever the bind function finds rows to add to the matrix it changes the mode of the form by adding rows to the matrix. How can I prevent that when I'm in view mode?
    This is the code for the binding function
    Sub BindParticipantGrid()
        Dim myForm As SAPbouiCOM.Form
        Dim oMatrix As SAPbouiCOM.Matrix
        Dim rs As sapbobsCOM.Recordset
        Dim strSQL, OrdreNr As String
        Dim oText As SAPbouiCOM.EditText
        Set myForm = SBOApplication.Forms.GetFormByTypeAndCount(139, 1)
        Set oText = myForm.Items("8").Specific
        If oText.Value <> "" Then
            OrdreNr = oText.Value
        Else
            OrdreNr = "0"
        End If
        Set oMatrix = myForm.Items("matrix").Specific
        oMatrix.Clear
        Set rs = myCompany.GetBusinessObject(sapbobsCOM.BoObjectTypes.BoRecordset)
        strSQL = "SELECT [@HL_PART].Code as Code, [@HL_PART].U_DocNum as DocNum, [@HL_PART].U_EmpId as EmpId, [@HL_PART].U_EmpName as EmpName, [@HL_PART].U_Message as Message, [@HL_PART].U_MessRead as MessRead, [@HL_PART].U_MainPart as MainPart, [@HL_PART].U_StartDt as StartDt, [@HL_PART].U_StartHr as StartHr, [@HL_PART].U_FinishDt as FinishDt, [@HL_PART].U_FinishHr as FinishHr, [@HL_PART].U_Finished as Finished FROM [@HL_PART] WHERE [@HL_PART].U_DocNum = " & OrdreNr
        rs.DoQuery strSQL
        While Not rs.EOF
            myForm.DataSources.UserDataSources.Item("EmpId").Value = rs.fields("EmpId").Value
            myForm.DataSources.UserDataSources.Item("EmpName").Value = rs.fields("EmpName").Value
            myForm.DataSources.UserDataSources.Item("Message").Value = rs.fields("Message").Value
            myForm.DataSources.UserDataSources.Item("MessRead").Value = rs.fields("MessRead").Value
            myForm.DataSources.UserDataSources.Item("MainPart").Value = rs.fields("MainPart").Value
            myForm.DataSources.UserDataSources.Item("StartDt").Value = rs.fields("StartDt").Value
            myForm.DataSources.UserDataSources.Item("StartHr").Value = rs.fields("StartHr").Value
            myForm.DataSources.UserDataSources.Item("FinishDt").Value = rs.fields("FinishDt").Value
            myForm.DataSources.UserDataSources.Item("FinishHr").Value = rs.fields("FinishHr").Value
            myForm.DataSources.UserDataSources.Item("Finished").Value = rs.fields("Finished").Value
            oMatrix.AddRow
            rs.MoveNext
        Wend
        oMatrix.SelectionMode = ms_Auto
    End Sub
    I will apreciate all king of help
    Thanks in advance.

    You have a property of the form which allows you to change the mode
    myForm.Mode = fm_ADD_MODE
    myForm.Mode = fm_EDIT_MODE
    myForm.Mode = fm_VIEWMODE_MODE
    You may change it after you modify you matrix data to fm_VIEWMODE_MODE and I guess you won't have the system question again.
    Sebastien

  • Printing problem in Dot matrix printer

    Hi all,
    We are planning to use Dot matrix printers for printing through SAP.We do front end printing using Windows OS. I am able to get prints properly if it is a script form. In case of list outputs, printer is printing the text outside the paper.Only half of the text is printing on the continuous stationary. Actually document is to be printed in Landscape format. So printer should print data vertically on the paper,but it's printing horizontally. I have created sparate output device for this printer.My printer is TVS Electronics HD745 24 Pin heavy duty printer. I have assigned OKI341 as device type for this device.Any more settings I need to do to get printing in landscape mode?

    Hi,
    Dot matrix printer.
    Problem with pritning with dot matrix
    About Dot matrix printer device problems
    Regards,
    Sandeep

  • Printing line beginning aligment problem in dot-matrix printer

    in smart-forms i have two windows with same upper-margin and there is 10 mm space between them.
    i print both of them a text which two rows but in right window begining of text is sliding right , second row of second window begins one or two columns sliding right namely not printing properly texts by beginning in same column in the right window.
    my printer is oki microline 320 line printer.
    why can this be?
    thanks..

    Hi,
    Dot matrix printer.
    Problem with pritning with dot matrix
    About Dot matrix printer device problems
    Regards,
    Sandeep

  • Problem with the Matrix State

    Hi Guys,
    I am facing a problem with the use of the matrix.
    I am not able to select cells from the matrix with a click  although I set the SelectMode = ms_Auto.
    does someone know how to solve this problem ??
    Thanks
    Bop

    Hi Peter,
    It depends on what selection style you want the grid to have.  I usually set the selection mode to ms_None, this mode allows you to select the individual cells. The ms_Auto selection mode enables an entire row to be selected.
    Regards, Lita

  • Problem working with Matrix (UI)

    Hi gurus!
    I've problem with Curreny Exchange Form
    I try to situate in cell automatically, but only works if the cell is visible in screen. If cell is in form but needs scroll for view it, my code doesn't work.
    This is my VB.NET code
            If pVal.FormTypeEx = "866" Then
                If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE Then
                    If pVal.BeforeAction = False Then
                        Try
                            Dim Matriz As SAPbouiCOM.Matrix
                            Dim i As Integer
                            Matriz = SBOApp.Forms.Item(FormUID).Items.Item("4").Specific
                            For i = 0 To Matriz.Columns.Count - 1
                                Dim k As Integer
                                If Matriz.Columns.Item(i).Title = MyCurrency Then
                                    Matriz.Columns.Item(i).Cells.Item(Now().Day).Click()
                                End If
                            Next
                        Catch ex As Exception
                            SBOApp.MessageBox(ex.Message)
                        End Try
                    End If
                End If
            End If
    Note: I tested this with FORM_LOAD event with same result
    Thnx in advance
    Juli

    Hi Juli,
    I made some modifications to your code and it works. The cell will be selected even when it's not showed in the first set of lines.
    I think you can improve it by using another event. Try it with Form_load for instance.
                    If pVal.FormTypeEx = "866" Then
                        If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE Then
                            Dim _MatriX As SAPbouiCOM.Matrix
                                Dim i As Integer
                            Matrix = B1Application.Forms.Item(FormUID).Items.Item("4").Specific
                            Matrix.Columns.Item("V0").Cells.Item(Now().Day).Click()
                        End If
                    End If
    Best regards,
    Felipe

  • Crystal Report speed problem on dot matrix printers

    We are attempting to print marketing documents (sales orders) to a dot matrix printer using Crystal Reports. All the add-ons for B1 do this using the crystal report viewer which causes crystal to send true type fonts to the printer, making it very slow. We can run the crystal reports in draft print mode outside of B1, and the performance is good. Is there a way to get the same performance in B1 using Crystal?
    All solutions we have found will require us to launch Crystal reports and have the end user enter parameters, using a link off the application menu works this way. But we are looking for a better solution to print to the dot matrix printer faster.
    Thanks

    Hi Peter,
    When you are printing it from b1 make all the font to the regular type ( not like bold are italic) like that then it will be some how faster...
    Regards
    PL.Chidambaram

  • Problem with ComboBox / Matrix

    Hi all,
    I have this problem... when I try to populate a column with comboxbox ...
    Code:
            Set co = lmatrix.Columns.Add("orgDist", it_COMBO_BOX)
                co.TitleObject.Caption = "Dist"
                co.Editable = True
                co.Visible = True
                co.DataBind.SetBound True, "@DIST", "Code"
            Set DBSource = lfrm.DataSources.DBDataSources.Item("@DIST")
                DBSource.Query
                For x = 0 To DBSource.Size - 1
                    tp1 = Trim(DBSource.GetValue("Code", x))
                    tp2 = Trim(DBSource.GetValue(3, x))
                    co.ValidValues.Add tp1, tp2
                    DBSource.Offset = x
                Next
    - at the 'co.ValidValues.Add tp1,tp2' I receive this error
      'Valid Value - The Value Exceed boundaries'
    - tp1 max value is of 8 Char
    - tp2 max value is of 50 Char
    I've try to insert manually the value like validvalue.add "101","23123123....213" and it work correctly..
    where is my error??
    Bye!!
    PS: Sorry for my english

    Hi,
    There's no problem with your code itself (however you don't need to set the DBDataSource offset, if you are only filling the ComboBox - GetValue picks the right data anyway...). It works fine (at least with 2004 PL23 + 2005 Build 119).
    Looks like a problem with your data (or some "old" bug, but this would be the first time I heard about it...)?
    ...or did you solve it in the meantime?
    Regards,
    Frank

  • Problem with a matrix of string

    When i use the programm after executing progect,during the operation when go to inseert the value of array in the matrix, that compose the Jtable, return me this errors.
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7
    at Invio_cli.vis_c(Invio_cli.java:166)
    at main.main(main.java:43)
    import java.net.*;
    import java.sql.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Invio_cli extends JFrame{
              private int num_rig=0;
              private int num_col=0;
              private int i,j,z;
              private int lung=0;
              private String[] splitta=null;
              private String      cells_s=new String();
              private String columnNum= new String();
              private String numriche=new String();
              private String column_name;
              private String[] split_temp2=null;
              private String[] columnName;
              private String[][] cells;     
              private String risp;
              private String send_data= new String();
              private String temp;
         public void vis_c(Socket s)
              JScrollPane scrollp;
              j=0;
              Socket s_v= s;
              conn_i_c connez= new conn_i_c();
              send_data="220";
              i=connez.send(send_data,s_v);
              risp=connez.readResponse(s_v);
              splitta=risp.split("\\�");
              columnNum=splitta[0];
              column_name=splitta[1];
              numriche=splitta[2];
                   cells_s=splitta[3];
              num_rig=Integer.parseInt(numriche);
              //System.out.println(numriche);
              num_col=Integer.parseInt(columnNum);
              System.out.println(columnNum);
              columnName =column_name.split("\\�");
              cells = new String[num_rig][num_col];
              int counter =0;
              j=0;
              split_temp2=cells_s.split("\\�");
              lung=split_temp2.length;
              System.out.println(lung);
              System.out.println(split_temp2[7]);
                   for(i=0;i<num_rig;i++)
                        for(z=0;z<num_col;z++)
    //THIS IS ROW 166          
         cells[i][z]=split_temp2[z];
                             j++;
                        num_col=num_col+num_col;
              JTable table = new JTable(cells,columnName);
              scrollp = new JScrollPane();
                   //senza il viewport non si vede nulla!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                   scrollp.getViewport().add(table);     
              //CERO IL FRAME CHE CONTERRA IL JPANNEL E JTABLE
                   setSize(800,500);
                   //aggiungo il jscroll con tabella al frame
                   getContentPane().add(scrollp);
                   setVisible(true);
         public void close_c(Socket s){
              Socket sc_s=new Socket();
              conn_i_c conne= new conn_i_c();
              conne.close_c(sc_s);
    WHY????????
    PLEASE HELP ME THANKS!!!!!
    P.S. Sorry for my eng.

    agreed about the code tags....
    but...
    cells = new String[num_rig][num_col];
    for(i=0;i<num_rig;i++) {
       for(z=0;z<num_col;z++) {
         //THIS IS ROW 166
         cells[z]=split_temp2[z];
         j++;
       num_col=num_col+num_col;
    }why are you adding num_col to itself? The number of columns is not changing, and this is causing z to go beyond what you've already set the cells array size to be. Arrays in Java will not grow or shrink after declaring them. If you want a larger array, you need to create a new array and then copy everything to the new array (System.arraycopy).

  • Problem in Adding matrix data  to database

    Hello experts,
    I've designed a matrix using UIAPI code.But,  neither  I can select a row of matrix nor I can add value to row.
    But, I can bind each column to field of  table and  can view the data in matrix  from the table.
    Plz help me to add data of each row of matrix to the User defined table.
    regards
    Subrata

    aim on you case, is your current form have bind to UDO, if yes, you just need to bind the User define table to matrix and add a button current id is "1". don't forget the form object need to define the current UDO name. if all operation has been done, you just need to press the button id is "1", after you modify the matrix value, then the status bar will show operation is success this words, and the value is save to your binded location.
    if you won't create a UDO, just want to insert item to user define table, then I think just UI API couldn't to fulfill your requirement. because matrix bind table just allow user call the value from table, it couldn't help user to modify the database table value. if you really want to save this value, DI API is needed aim on your requirement.
    please review DI API for saving value to UDT.

  • Problems with my matrix...

    Hi,
    I get this error when I try to run through this part of my code:
    "java.lang.NullPointerException"
    What am I doing wrong?
        int counter1=0, counter2=0, sum=0;
        Double temp1, temp2, result;
        Double[] Array1, Array2;
        Double[][] newMatrix, dmatrix;
                while(counter1 < dmatrix.length) {
                for(int i = 0; i < dmatrix[counter1].length; i++) {
                    Array1[i] = dmatrix[counter1]; // <--I believe the errors are here? But it could be due to something else
    System.out.println(Array1[i]);
    counter2 = counter1 + 1;
    while(counter2 < dmatrix.length) {
    for(int j = 0; j < dmatrix[counter2].length; j++) {
    Array2[j] = dmatrix[counter2][j]; // <--I believe the errors are here? But it could be due to something else
    for(int k = 0; k < Array2.length; k++) {
    temp1 = Array1[k];
    temp2 = Array2[k];
    if(temp1.compareTo(temp2) < 0) {
    result = new Double (result.doubleValue() + ( temp1.doubleValue()/temp2.doubleValue() ) );
    else if(temp1.compareTo(temp2) > 0) {
    result = new Double (result.doubleValue() + ( temp2.doubleValue()/temp1.doubleValue() ) );
    sum++;
    System.out.println(result);
    counter1++;
    sum = 0;

    Double[] Array1, Array2;
    Double[][] newMatrix, dmatrix;Wrong. You haven't allocated any memory. Where's the call to new? All you've done is declare variables of a given type.
    You need to do something more like this:
    public class MatrixTester
        public static void main(String [] args)
            int numRows = 5;
            int numCols = 5;
            double [][] matrix = new double[numRows][];
            for (int m = 0; m < numRows; ++m)
                matrix[m] = new double[numCols];
                for (int n = 0; n < numCols; ++n)
                    matrix[m][n] = (double)(m + n);
            for (int m = 0; m < numRows; ++m)
                for (int n = 0; n < numCols; ++n)
                    System.out.print(matrix[m][n] + " ");
                System.out.println();
    }Note the calls to "new".

  • Problem in binding matrix with DBDataSource

    Hi
    I  bind the matix using DBDataSource,but when i again bind the matrix under the existing records it works.
    But when i delete a row from the delete menu and again bind the matrix then it adds an extra row in the matrix.
    when i delete two rows then it adds extra two rows and so on...
    please help..........

    This is for Menu delete before action
    SAPbouiCOM.Matrix oMatrix;
                        oMatrix=(SAPbouiCOM.Matrix)oPCForm.Items.Item(ClsConstant.strPC_matrixPC).Specific;
                        if(iRowNumber > 1)
                             oMatrix.FlushToDataSource();
                             oDbMatrixDataSrcPC.RemoveRecord(iRowNumber-1);
                             oMatrix.LoadFromDataSource();          
    for after action
    oMatrix.FlushToDataSource();
    for(int i=oMatrix.VisualRowCount;i > 0 ;i--)
    stsPO =  ((SAPbouiCOM.EditText)oMatrix.Columns.Item(ClsConstant.strPC_mtxPONo).Cells.Item(i).Specific).Value.ToString();
    if(sPONO == stsPO)
    oMatrix.DeleteRow(Convert.ToInt32(i));
    //oDbMatrixDataSrcPC.RemoveRecord(Convert.ToInt32(iRowNumber)-1);
    oDbMatrixDataSrcPC.RemoveRecord(i-1);
    oMatrix.LoadFromDataSource();     

  • Rwrun60.exe problem when generating matrix delimited reports

    when i am generating reports in delimited format with matrix stayle i am getting following error:
    ProgramError:
    RWRUN60.exe has generated errors and will be closed by windows.you will need to restart the program.
    please advice me urgently .

    Hi
    From Reports 6i -patch-11 onwards, a new desformat called delimiteddata has been added. Tyr using delimteddata desformat instead of delimited format. Please refer to patch-11 release notes to know more about it.
    Thanks
    The Oracle Reports Team

  • Problem in using matrix for addtion

    Hi
    I need to get the total of field called 'RATING' which caqn come more than once for one record. I need to sum it and show the total I gave the following code when Rating is coming three times but I get sum of first and last only...
    Pls help
    I gave this in BEAN
    private void createData(
              Vector rVector,
              Vector column,
              IRecordSet table2,
              int Count) {
              SimpleDateFormat myformatter = new SimpleDateFormat("dd-MMM-yyyy");
              String Hiredate;
              String Name1, Name2, prof;
              int[][] iArray = new int[100][100];
              int i = 0, j = 0, i2 = 1, j2 = 0, row = 0, col = 0;
              Name2 = "";
              double avg1 = 0, avg2 = 0;
              try {
                   table2.beforeFirst();
                   Vector dataVec = new Vector();
                   row = 0;
                   col = 0;
                   while (table2.next()) {
                        Name1 = table2.getString("ENAME");
                        if (dataVec.isEmpty()) {
                             dataVec.addElement(Name1);
                             dataVec.addElement(table2.getString("STELL_DESCP"));
                             dataVec.addElement(table2.getString("PLANS_DESC"));
                             dataVec.addElement(table2.getString("MANAGER"));
                             dataVec.addElement(table2.getString("HIRE_DT"));
                             prof = table2.getString("RATING");
                             if (prof.trim().length() == 0)
                                  prof = "99";
                             iArray[row][col] = Integer.parseInt(prof);
                             dataVec.addElement(prof);
                        } else {
                                  //col = col+1;
                             if (Name2.equalsIgnoreCase(Name1))
                                  prof = table2.getString("RATING");
                                  if (prof.trim().length() == 0)
                                  prof = "99";
                                 iArray[row][col+1] =Integer.parseInt(prof);
                                  dataVec.addElement(prof);
                                  prof = "";
                              else
                                  for (int k = 0; k < Count; k++)
                                       avg1 = avg1 + iArray[row][k];
                                  dataVec.addElement(String.valueOf(avg1));
                                  dataVec.addElement(String.valueOf(avg2));
                                  rVector.addElement(dataVec);
                                  dataVec = new Vector();
                                  col =0;
                                  row = row+1;
                        Name2 = Name1;
                        Name1 = "";
                        //avg1 =0;
                   //     table2.afterLast();
                   //     { //rVector.addElement(dataVec);}     
              } catch (Exception e) {
                   //e.printStackTrace();
              this.setModel(new DefaultTableViewModel(rVector, column));

    Hi try the change... u r not incrementing the col
                        if (dataVec.isEmpty()) {
                        } else {
                             //       col = col+1;
                             if (Name2.equalsIgnoreCase(Name1)) {
                                  prof = table2.getString("RATING");
                                  if (prof.trim().length() == 0)
                                       prof = "99";
                                  iArray[row][col++] = Integer.parseInt(prof);
                                  dataVec.addElement(prof);
                                  prof = "";
                             } else {

Maybe you are looking for

  • Images not displayed properly

    [Migrated from the Syclo Resource Center] prashanthi_vangala   01/03/2012 06:44, Hi,I am working on Agentry 5.4.0I have a list screen where for one of the columns I have a rule to display images ( I use checked and unchecked images ). Earlier the ima

  • Error in B2B Console

    Hi gurus, I am gettig the following error in b2b console while running one of our outbound agreements.This is a strange error and i am seeing it for the first time. StackTrace: Error -: AIP-50014: General Error: Error -: AIP-13118: Business Logic Int

  • Burning imovie projects to dvd as files

    If I use the disc utility to burn a movie project or .dv file ( 6.5 gigs ) to a dvd (dual layer) as a file not a viewable dvd, just as storage, will I loose any quality of the video, I am positive that I would not just want to be sure.

  • Write dynamic box using sapscript

    I would like to write two box layout. but each box layout are variants, so i can wirte a fixed height. how can i when the first box is finished, then close the bottom line, and the start to write second box and the close. Thanks!

  • How to identify used AP in RADIUS Accounting

    We are using 5508 WLC with 3602 APs. Looks like in RADIUS Authentication Called-Station-Id is the MAC address of the AP, but in RADIUS Accounting Called-Station-Id is the MAC address of the WLC. How can we change that behaviour so that Called-Station