Fill and sort a Matrix/Grid

Hi gurus !!
I want to know if there is a way to fill a Matrix with a sql query or with element of a collection ?
In fact, i want to fill a "grid" or a "matrix" with data wich came from differents tables with join AND have the possibily to sort my "grid" or "matrix" by clicking on RowHeader....
Thanks for your answers.
Laurent.
Message was edited by: Laurent TESTA

Hi Laurent,
Like Louis said; you'll need the Grid object. Multiple tables is not possible with matrix (or you must use a very slow recordset object) You'll find a detailed sample in the SDK sample directory or in the SDK Help: <i>UI-API > Reference > Objects > Grid</i> (Click the link below the page "Adding a Grid item")
Or, if you are using SBO 2005 SP01, you can create the Grid in the Screen Painter, you'll find a detailed instruction in the SDK Help by the topic <i>Screen Painter > Working with the Screen Painter</i>
For the sorting; it's not possible 'right out the box', however, you can create it. Capture mouseclicks on the Grid header, and perform a new query on the grid. See the pseudo code below.
switch(pVal.ColUID)
  case 1:
    sSQL = "SELECT * FROM FOO ORDER BY column1";
    break;
  case 2:
    sSQL = "SELECT * FROM FOO ORDER BY column2";
    break;
MyDataTable.PerformQuery(sSQL);
You might want to make it a bit smarter to sort ascending/descending, but that's up to you...
Hope it helps, good luck,
Rowdy

Similar Messages

  • Dashboards PowerShell Grid Widgets - Grouping and Sorting?

    First of all, to those who made Dashboard PowerShell Grid Widgets possible - Thank you, Thank you, Thank you.  Love it!  So much more power except for the output......
    Is there a way to group and sort my results or is it my system?  Clicking the column header doesn't seem to work, no personalize option, nor does sorting in the script seem to work. 
    Thank you. 
    BTW, it looks like the dashboard is sorting by ID no matter what one does.

    Tried it, doesn't work. Moreover, the example in the link uses CreateInstance
    whereas I'm using CreateFromObject.  Below is my code.  If I run the first two lines from the SCOM PS command prompt, I receive a nicely sorted results.  Not so in the PowerShell Grid Widget (PsGW).  If I change
    my sort property to Id, then the output order matches the PsGW.  So is this a result of using
    CreateFromObject?
    Editorial Feedback for the SCOM Team:  From all the examples I've seen on the web, and most seem to be derivative of two or three MS examples, the trend appears to be that CreateInstance
    is used for the PowerShell Web Browser Widget and everyone seems to be enamored by its capabilities.  It sure is pretty, but for my environment doesn't offer a great deal.  I feel the real meat and potatoes is PsGW - being
    able to create one's own output.  I'd love to see more examples of the methods in ScritpContextObject (who's link I'm unable to add) that have nothing to do with the web. 
    $class = Get-SCOMClass -Name Microsoft.Windows.Cluster.Group
    $clstrGrpRes = Get-SCOMClassInstance -Class $class | ? { $_.HealthState -ne "Uninitialized" } | sort-object -property Name -Descending
    foreach ($gRes in $clstrGrpRes)
    $dataObject = $ScriptContext.CreateFromObject($gRes,"Id=Id,Health=HealthState", $null)
    $dataObject["Cluster"] = $gRes.Name.Split(".")[0]
    $dataObject["Group Resource"] = $gRes.Name.Split(".")[1]
    $dataObject["Hosting Node"] = ($gRes | % { $_.values } | ? { $_.Type.ToString() -eq 'GroupActiveOnNodeDuringDiscovery' } ).value
      $ScriptContext.ReturnCollection.Add($dataObject)
    

  • How i get data in matrix grid from A/P Invoice

    How i get data in matrix grid from A/P Invoice before click add button

    Hi,
    Are you trying to read the data in the matrix of a system form? Then you only have to look for the matrix with the ID you can see by visualising the System Information in B1 and then directly read from the matrix cells (using columns element in matrix), the DBDataSources are not filled in until the document has been added to the database.
    There are many messages in this forum talking about how to read information in matrix item, just make a search for it.
    Hope it helps
    Trinidad.

  • Standard and sorted itab

    what is the diff between standard and sorted itab

    Hi Abhay,
    check the following explanation.
    <b>Standard tables</b>
    This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPENDstatement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option (BINARY) with key access, the response time is logarithmically proportional to the number of table entries.
    <b>Sorted tables</b>
    This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERTstatement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHEREcondition.
    Hope this helps.
    Regards,
    kinshuk

  • ALV OO and refreshing the ALV grid

    Hi,
    i have some problems with my ALV 00 program.
    On screen 1 i have to fill in a material number.
    For that material i'm getting some data and show in screen 2 in a ALV grid.
    Via BACK-button i'm getting back to screen 1 and can fill in another material number.
    But the 2nd (and 3rd, etc) time i fill a material, the ALV grid data from material 1 is shown. Even if the internal table I_ALV where the data is, is changed.
    What should i do ?
    I have initialized the customer container and the grid, but that didn't solved the problem.
    regards,
    Hans

    Hi,
    Try clearing and refreshing the alv grid data table in screen 2.
    Check with this code. this code is working fine. If we go back and change the input, it is showing the output corresponding to the second input only.
    Have you use this method?
    <b> GR_ALVGRID->REFRESH_TABLE_DISPLAY</b>
    TYPE-POOLS : SLIS.
    * Tables                                                              *
    TABLES:
      VBRK,
      VBRP.
    * Parameters and select options OR SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS:
                S_VBELN FOR VBRK-VBELN.
    SELECTION-SCREEN END OF BLOCK B1.
    * Internal Tables                                                     *
    * work areas
    DATA: BEGIN OF IT_VBRP OCCURS 0,
           VBELN LIKE VBRK-VBELN,
           POSNR LIKE VBRP-POSNR,
           UEPOS LIKE VBRP-UEPOS,
           FKIMG LIKE VBRP-FKIMG,
           NETWR LIKE VBRP-NETWR,
           MEINS LIKE VBRP-MEINS.
    DATA : END OF IT_VBRP.
    * Variables                                                           *
    DATA : GR_ALVGRID TYPE REF TO CL_GUI_ALV_GRID,
           GC_CUSTOM_CONTROL_NAME TYPE SCRFNAME VALUE 'CC_ALV',
           GR_CCONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
           GT_FIELDCAT TYPE LVC_T_FCAT,
           GS_LAYOUT TYPE LVC_S_LAYO,
           V_FLAG VALUE 'X'.
    * Start of Program                                                    *
    *       INITIALIZATION.                                               *
    INITIALIZATION.
      S_VBELN-LOW = 1.
      S_VBELN-HIGH = 1000000000.
      S_VBELN-OPTION = 'EQ'.
      S_VBELN-SIGN = 'I'.
      APPEND S_VBELN.
    *       SELECTION-SCREEN                                              *
    AT SELECTION-SCREEN.
      PERFORM VALIDATION.
    *       START-OF-SELECTION                                            *
    START-OF-SELECTION.
      PERFORM GET_DATA.
      CALL SCREEN 0100.
    *       END-OF-SELECTION                                              *
    END-OF-SELECTION.
    *       TOP-OF-PAGE                                                   *
    TOP-OF-PAGE.
    *       END-OF-PAGE                                                   *
    END-OF-PAGE.
    *       AT USER-COMMAND                                               *
    *&      Form  VALIDATION
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM VALIDATION .
      SELECT SINGLE VBELN
      FROM VBRK
      INTO VBRK-VBELN
      WHERE VBELN IN S_VBELN.
      IF SY-SUBRC <> 0.
        MESSAGE E000 WITH 'no billing documents found'.
      ENDIF.
    ENDFORM.                    " VALIDATION
    *&      Form  GET_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM GET_DATA .
      SELECT VBELN
             POSNR
             UEPOS
             FKIMG
             NETWR
             MEINS
      FROM VBRP
      INTO TABLE IT_VBRP
      WHERE VBELN IN S_VBELN.
    ENDFORM.                    " GET_DATA
    *&      Module  DISPLAY_ALV  OUTPUT
    *       text
    MODULE DISPLAY_ALV OUTPUT.
      IF V_FLAG = 'X'.
        PERFORM DISPLAY_ALV.
        PERFORM PREPARE_FIELD_CATALOG CHANGING GT_FIELDCAT.
        PERFORM PREPARE_LAYOUT CHANGING GS_LAYOUT.
       CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
            EXPORTING
    *      I_BUFFER_ACTIVE               =
    *      I_BYPASSING_BUFFER            =
    *      I_CONSISTENCY_CHECK           =
    *      I_STRUCTURE_NAME              = 'VBRP'
    *      IS_VARIANT                    =
    *      I_SAVE                        =
    *      I_DEFAULT                     = 'X'
              IS_LAYOUT                     = GS_LAYOUT
    *      IS_PRINT                      =
    *      IT_SPECIAL_GROUPS             =
    *      IT_TOOLBAR_EXCLUDING          =
    *      IT_HYPERLINK                  =
    *      IT_ALV_GRAPHICS               =
    *      IT_EXCEPT_QINFO               =
            CHANGING
              IT_OUTTAB                     = IT_VBRP[]
              IT_FIELDCATALOG               = GT_FIELDCAT
    *      IT_SORT                       =
    *      IT_FILTER                     =
            EXCEPTIONS
              INVALID_PARAMETER_COMBINATION = 1
              PROGRAM_ERROR                 = 2
              TOO_MANY_LINES                = 3
              OTHERS                        = 4
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          CALL METHOD GR_ALVGRID->SET_READY_FOR_INPUT
            EXPORTING
              I_READY_FOR_INPUT = 1.
        ELSE.
          <b>CALL METHOD GR_ALVGRID->REFRESH_TABLE_DISPLAY
    *    EXPORTING
    *      IS_STABLE      =
    *      I_SOFT_REFRESH =
            EXCEPTIONS
              FINISHED       = 1
              OTHERS         = 2
          IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                       WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.</b>
        ENDIF.
        CLEAR V_FLAG.
      ENDIF.
    ENDMODULE.                 " DISPLAY_ALV  OUTPUT
    *&      Form  DISPLAY_ALV
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM DISPLAY_ALV .
      IF GR_ALVGRID IS INITIAL.
        CREATE OBJECT GR_ALVGRID
          EXPORTING
    *    I_SHELLSTYLE      = 0
    *    I_LIFETIME        =
            I_PARENT          = GR_CCONTAINER
    *    I_APPL_EVENTS     = space
    *    I_PARENTDBG       =
    *    I_APPLOGPARENT    =
    *    I_GRAPHICSPARENT  =
    *    I_NAME            =
          EXCEPTIONS
            ERROR_CNTL_CREATE = 1
            ERROR_CNTL_INIT   = 2
            ERROR_CNTL_LINK   = 3
            ERROR_DP_CREATE   = 4
            OTHERS            = 5
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    ENDFORM.                    " DISPLAY_ALV
    *&      Form  PREPARE_FIELD_CATALOG
    *       text
    *      <--P_GT_FIELDCAT  text
    FORM PREPARE_FIELD_CATALOG  CHANGING P_GT_FIELDCAT TYPE LVC_T_FCAT.
      DATA : LS_FCAT TYPE LVC_S_FCAT,
             L_POS TYPE I.
      L_POS = L_POS + 1.
      LS_FCAT-FIELDNAME = 'VBELN'.
      LS_FCAT-TABNAME = 'IT_VBRP'.
      LS_FCAT-COL_POS = L_POS.
      LS_FCAT-SCRTEXT_M = 'Billing Document'.
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO P_GT_FIELDCAT.
      CLEAR LS_FCAT.
      L_POS = L_POS + 1.
      LS_FCAT-FIELDNAME = 'POSNR'.
      LS_FCAT-TABNAME = 'IT_VBRP'.
      LS_FCAT-COL_POS = L_POS.
      LS_FCAT-SCRTEXT_M = 'Billing Item'.
      LS_FCAT-OUTPUTLEN = '6'.
      APPEND LS_FCAT TO P_GT_FIELDCAT.
      CLEAR LS_FCAT.
      L_POS = L_POS + 1.
      LS_FCAT-FIELDNAME = 'UEPOS'.
      LS_FCAT-TABNAME = 'IT_VBRP'.
      LS_FCAT-COL_POS = L_POS.
      LS_FCAT-SCRTEXT_M = 'Higher Level Item'.
      LS_FCAT-OUTPUTLEN = '6'.
      APPEND LS_FCAT TO P_GT_FIELDCAT.
      CLEAR LS_FCAT.
      L_POS = L_POS + 1.
      LS_FCAT-FIELDNAME = 'FKIMG'.
      LS_FCAT-TABNAME = 'IT_VBRP'.
      LS_FCAT-COL_POS = L_POS.
      LS_FCAT-SCRTEXT_M = 'Invoice Quantity'.
      LS_FCAT-OUTPUTLEN = '13'.
      APPEND LS_FCAT TO P_GT_FIELDCAT.
      CLEAR LS_FCAT.
      L_POS = L_POS + 1.
      LS_FCAT-FIELDNAME = 'NETWR'.
      LS_FCAT-TABNAME = 'IT_VBRP'.
      LS_FCAT-COL_POS = L_POS.
      LS_FCAT-SCRTEXT_M = 'Net Value'.
      LS_FCAT-OUTPUTLEN = '15'.
      APPEND LS_FCAT TO P_GT_FIELDCAT.
      CLEAR LS_FCAT.
      L_POS = L_POS + 1.
      LS_FCAT-FIELDNAME = 'MEINS'.
      LS_FCAT-TABNAME = 'IT_VBRP'.
      LS_FCAT-COL_POS = L_POS.
      LS_FCAT-SCRTEXT_M = 'Unit of Measure'.
      LS_FCAT-OUTPUTLEN = '3'.
      APPEND LS_FCAT TO P_GT_FIELDCAT.
      CLEAR LS_FCAT.
      L_POS = L_POS + 1.
    ENDFORM.                    " PREPARE_FIELD_CATALOG
    *&      Form  PREPARE_LAYOUT
    *       text
    *      <--P_GS_LAYOUT  text
    FORM PREPARE_LAYOUT  CHANGING P_GS_LAYOUT TYPE LVC_S_LAYO.
      P_GS_LAYOUT-ZEBRA = 'X'.
      P_GS_LAYOUT-GRID_TITLE = 'INVOICE DETAILS'.
      P_GS_LAYOUT-SMALLTITLE = 'X'.
      P_GS_LAYOUT-EDIT = 'X'.
    ENDFORM.                    " PREPARE_LAYOUT
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'CANCEL'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
        WHEN 'CANCEL'.
          LEAVE TO SCREEN 0.
        WHEN 'EXIT'.
          CALL TRANSACTION 'SE38'.
        WHEN 'CHANGE'.
          IF GR_ALVGRID->IS_READY_FOR_INPUT( ) = 0.
            CALL METHOD GR_ALVGRID->SET_READY_FOR_INPUT
              EXPORTING
                I_READY_FOR_INPUT = 1.
          ELSE.
            CALL METHOD GR_ALVGRID->SET_READY_FOR_INPUT
              EXPORTING
                I_READY_FOR_INPUT = 0.
          ENDIF.
      ENDCASE.
    Regards,
    Aswin

  • Diff btwn STANDARD and SORTED tbls??

    Hi Experts,
    Just curious to know that, In Wht scenarios/requiremets, we need to create a internal table, like fillowing(or How they differ from TYPE STANDARD TABLE OF)??
    <i><b>it_a504 TYPE SORTED TABLE OF a504 WITH UNIQUE KEY kunnr prodh.
          wa_a504 TYPE a504,</b></i>.
    thanq
    Message was edited by:
            Srikhar

    mainly performance reason ,if you use sorted internal table then it will have good performance than standard intentable
    The internal tables could be catogrised into two.
      indexed   : standard and sorted tables.
      nonindexed: hash tables.
    standard table: it is the one we use generally.In this the data is not sorted and the only thing we can do is just process the data with out any restriction on it.
    sorted tables: it works in two different manner.
                           Frist one: is similar to standard table but the only difference is the data will be filled in a particular manner either ascending or descending.
                          Second one: u can also fill the table keeping any field as primary key.now the data will be filled based on that particular key.
    Hash tables:   u can use this when u want  to fill your  internal table avoiding the duplication of data.it never permits the duplicate record to be stored in a internal table
    Thanks
    seshu

  • WebPart: Display the search result in an spgridview with filter and sort

    hi,
    For explain more in details.
    I need the search result in a table displaying some meta common in the different library.
    I've to have the possibility to filter and sort the grid.
    i'm trying to extend Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart
    i can have the result from the textbox search with: SharedQueryManager.GetInstance(this.Page).QueryManager
    My queryManager is populate in the method: CreateChildControls
    I put the sample code i use. and in the populateData method, my querymanager is null while in the createChildContriol, it's correctly populate with : this.queryManager = SharedQueryManager.GetInstance(this.Page).QueryManager;
    using System;
    using System.ComponentModel;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using Microsoft.SharePoint.Search.Internal.WebControls;
    using Microsoft.Office.Server.Search.Query;
    using Microsoft.Office.Server.Search.WebControls;
    using System.Data;
    using System.Xml;
    namespace CustomSearchResultWebPart.CustomCoreResultWebPart
    [ToolboxItemAttribute(false)]
    public class CustomCoreResultWebPart : Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart
    private ObjectDataSource objDS;
    private const string ObjectDataSourceID = "gridViewDataSource";
    private QueryManager queryManager;
    private SPGridView gridView = new SPGridView();
    protected override void CreateChildControls()
    //here is correctly populate
    this.queryManager = SharedQueryManager.GetInstance(this.Page).QueryManager;
    try
    LoadSearchGrid();
    catch (Exception ex)
    Page.Response.Write(ex.Message + " - " + ex.StackTrace);
    //base.CreateChildControls();
    protected override void OnInit(EventArgs e)
    base.OnInit(e);
    protected override void OnLoad(EventArgs e)
    base.OnLoad(e);
    protected override void OnPreRender(EventArgs e)
    //gridView.DataBind();
    base.OnPreRender(e);
    protected override void Render(HtmlTextWriter writer)
    base.Render(writer);
    public DataTable populateData()
    DataSet dtSet = null;
    DataTable dtTable = null;
    //here is my query manager is null
    if (queryManager != null && queryManager.Count > 0)
    XmlDocument xdoc = new XmlDocument(); //We are using XmlDocument
    xdoc = queryManager.GetResults(queryManager[0]);//xml returned by search
    if (xdoc != null)
    XmlReader xmlReader = new XmlNodeReader(xdoc);
    dtSet = new DataSet();
    dtSet.ReadXml(xmlReader);
    if (dtSet.Tables.Count > 1)
    dtTable = dtSet.Tables["Result"];
    return dtTable;
    private void LoadSearchGrid()
    this.objDS = new ObjectDataSource();
    this.objDS.ID = ObjectDataSourceID;
    this.objDS.SelectMethod = "populateData";
    this.objDS.TypeName = this.GetType().AssemblyQualifiedName;
    this.objDS.ObjectCreating += new ObjectDataSourceObjectEventHandler(objDS_ObjectCreating);
    this.Controls.Add(objDS);
    gridView.ID = "_gridView";
    gridView.AutoGenerateColumns = false;
    gridView.Width = new Unit(100, UnitType.Pixel);
    gridView.EnableViewState = false;
    gridView.AllowPaging = true;
    gridView.PageSize = 5;
    gridView.DataSourceID = ObjectDataSourceID;
    this.Controls.Add(gridView);
    void objDS_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
    //e.ObjectInstance = objDS;
    protected void gridView_RowDataBound(object sender, GridViewRowEventArgs e)
    //throw new NotImplementedException();
    Do you have a sample that i can use or some tutorial?
    thanks for your help

    I added this in my class
    public class CustomResultsDatasource : CoreResultsDatasource
    public CustomResultsDatasource(Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart parentWebPart)
    : base(parentWebPart)
    View = new CustomResultsDatasourceView(this, GetType().Name);
    public class CustomResultsDatasourceView : CoreResultsDatasourceView
    public CustomResultsDatasourceView(SearchResultsBaseDatasource dataSourceOwner, string viewName)
    : base(dataSourceOwner, viewName)
    //make sure we have a value for the datasource
    if (DataSourceOwner == null)
    throw new ArgumentNullException("DataSourceOwner");
    CustomResultsDatasource datasource = this.DataSourceOwner as CustomResultsDatasource;
    this.QueryManager = SharedQueryManager.GetInstance(datasource.ParentWebpart.Page).QueryManager;
    And this in my customSearchResultWebPart
    protected override void CreateDataSource()
    //base.CreateDataSource();
    this.DataSource = new CustomResultsDatasource(this);
    How can i use queryManager in populateData?
    thanks for your help

  • Copy sheets and sort

    I'm new to numbers, and have been learning how to use the software - great tool!
    I have - what should be - a simple request, but I have not found the answer just yet - so I'd like some feedback and direction. I have a sheet set up which I would like to be able to duplicate (on another sheet) where I could sort the second (or third) in a different way, and still only have to make changes on the first sheet as information gets updated/removed/altered.
    Thx,
    Daryl

    Daryl,
    Yes, it's pretty simple. You can use three sheets if you wish, but since this is Numbers, you can put the two (or three) tables on one sheet where they are all in view at once and sort to your heart's content.
    In the second table, in A1, type an =sign and then click on A1 in the first table. Select A1 in the second table and then grab the little circular handle in the lower right corner and pull it down to Fill the expression to all the other rows in column A. Then select the entire column A and again grab the Fill Handle and pull it across to copy the expressions to all the other columns.
    Repeat for the third table.
    Any edits in the first table will appear in the other tables, but the sort orders will be independent.
    Jerry

  • Read and sort a semicolon seperated csv file

    Hi all,
    I need to sort the given csv file columnwise (alphabatically)... which means the corresponding row/rows also have to be sorted. need help.
    the csv file looks like:
    Wear;9;;;
    ;;;Image;1
    ;;;Area;2
    ;;;ner;3
    ;;;Content;1
    ;;;BContainer;1
    ;;;View;1
    VIEW;10;;;
    ;;;get;8
    ;;;ner;1
    ;;;View;1
    ACTIVE;21;;;
    ;;;Image;1
    ;;;get;7
    ;;;Area;4
    ;;;ner;1
    ;;;de.vw.mqbkombi.widgets.TransitionContainer;3
    ;;;Aget2;2
    ;;;ner2;1
    ;;;Sget;1
    ;;;iView;1
    The idea is to first sort Wear,VIEW, ACTIVE alphabatically (columnwise), making sure all the rows that they have are also moved.
    after that, alphabatically sort all the in-between rows.
    would appreciate the help from any expert on csv, excel table.

    doremifasollatido wrote:
    If you know that your columns never have embedded semicolons, you could call String.split to split each row at semicolons. Although you could leave the results in the arrays that String.split gives, you should probably create a Java class to represent each row. It will make your code easier to understand, and you could also more easily represent numeric values as numbers such as primitive int values (so that they sort correctly as numbers instead of as Strings). Then create a List of instances of that Java class, and sort the list using Collections.sort and a custom java.util.Comparator.Or indeed make it Comparable; but I'd agree this is definitely the way to go.
    Also, assuming that all your "secondary" rows, such as:
    ;;;Image;1
    ;;;Area;2
    refer to the preceding "primary" (Wear;9;;;), I'd suggest you fill in the unsupplied values for them. That will allow you to sort them all in one go. It might also be worth including a type in your "Row" class (maybe as an enum); alternatively you could have two different subclasses of a common Row class.
    Winston

  • Cropping and the snap to grid?

    When cropping my crop area (square/rectangle/what-have-you) is always snapping to some sort of invisible grid.  Is this just how Lr4 works or is there a setting I have settup incorrectly?
    And also, When I crop an image I have to move the image into the cropping "square" and cut of a portion of the photo but it's only part of the image I want cropped.  And when I do have the image I press "return" and the image appears to be cropped until I go to crop more of the image.  Suddenly I'm left back at the state before the previous crop.  What am I doing wrong?
    Thanks!  (I hope this makes sense)

    When you are satisfied, you either hit the <enter> key or click on "close" on the crop-panel. It is the bottom of the crop panel, but that is still high on the right-hand panel.
    I do not find a "done" in my LR4.0.
    ...as I am more of a keyboard-guy than mouse-guy I always have to take a look to answer.
    <esc> is the shortest way to abandon the crop endeavour and return to where you started invoking the crop (which could be library module if you used the R key).
    To my knowledge you can only crop in rectangular way. You have different overlays to guide your decision-making (like spiral etc. - toggle with O key), but the result will always be some rectangle, which can be square, of course.
    If you open the padlock you are free to drag the ratio, or you could choose from the drop-down menu "Aspect" one of the presets or enter your own dimensions. LR will recalculate them, though and display maybe different.
    So circular is not possible.
    For circular you could employ a trick e.g. in Print module: create a watermark or identity plate with circular opening, opaque for the rest.

  • My iPod touch shows that it is charging but it actually doesn't charge and I've tried to restore/ restart it but the only icon is the charging icon with the battery icon with a bit of red fill and a small lightning icon below it. Can anybody help me?

    My iPod touch shows that it is charging but it actually doesn't charge and I've tried to restore/ restart it because the only icon is the charging icon, the one with the battery icon with a bit of red fill and a small lightning icon below it. Can anybody help me and give me solutions before I go to an apple service center?

    Place the iPod Touch into DFU mode.  This will be similer to what the factory would do to install the iOS onto new iOS devices.
    Placing it into DFU mode will allow you to "format" and install the current iOS for that device.
    To place your iOS device into DFU mode.
    First connect you iOS device to you computer.
    Open iTunes if not already open
    Now turn off your iOS device using the power swipe.
    Press the home and sleep button on your iOS device for 10 seconds.
    Release the sleep button but carry on holding down the home button.  For another 10 seconds.
    Your iOS device should now be on DFU.  Click on restore and iTunes will download the lastest iOS for your device.
    Hopefully that sorts it if not, you will have to go to a sevice centre or call Apple Care up and get them to collect it and repair it. (replace it)

  • Custom paging and sorting

    Hi all,
    anybody has any experience with custom paging and sorting with oracle 10i. please help. I really appreciae if someone throw some ideas or sample code for me.
    I am working with 10i and asp.net 2.0. I just can not find any sample code for oracle.
    thanks

    CREATE OR REPLACE procedure getempscur(ecur out sys_refcursor) is
        BEGIN
         OPEN ecur for select * from emp;
       end;
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    public class testrefcur
        public static void Main()
            using (OracleConnection con = new OracleConnection("data source=orcl;user id=scott;password=tiger;"))
                con.Open();
                using (OracleCommand cmd = new OracleCommand("getempscur", con))
                    cmd.CommandType = CommandType.StoredProcedure;
                    OracleParameter p2 = new OracleParameter("p2", OracleDbType.RefCursor, ParameterDirection.Output);
                    cmd.Parameters.Add(p2);
                    cmd.ExecuteNonQuery();
                    OracleRefCursor rc = (OracleRefCursor)p2.Value;
                    OracleDataAdapter da = new OracleDataAdapter();
                    DataSet ds = new DataSet();
                    da.Fill(ds, 2, 5 ,"EMP",rc); // contains rows 2-7
                    da.Dispose();
                    rc.Dispose();
    }

  • Sample signal arrays into a matrix and calculate covariance matrix

    i want to gather signals from different channels and put these into a matrix which will be updated at every time step. then this matrix should be normalized and the covariance matrix should be calculated. then i want to calculate the eigenvalues of this latter matrix and display them. this last part(normalize,covariance and eigenvalue) can be done either at every time step or after a specific time interval.(i prefer time interval because i don't need that dense information). my main problem is to update the signal matrix. i tried to use "insert into array" but as the matrix should be empty initially it creates problems while trying to connect this to other blocks. the minor problem is i am new and i canno
    t find a block to calculate the covariance matrix although i realized that the software has the capability to do it while fitting curves etc. thanks for help.

    cigdem,
    i attached two examples which show how you can solve the issue with generating the 2D-array (matrix). i annoted it the best way i could, but if you have any questions, feel free to post them.
    we have a toolkit called "simultion interface toolkit". you can insert matlab-code in LabVIEW with it and vice versus.
    the question about "trigger" is not very specific in this point. normally you trigger the acquisition via a starttrigger and then continue to acquire data either continousely or in "N samples". the time of filling a row the matrix is defined therefore by number of samples and samplerate.
    -Norbert B.
    NI Germany
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.
    Attachments:
    creating_matrix.vi ‏131 KB
    creating_matrix_(2).vi ‏119 KB
    matlab.vi ‏30 KB

  • [svn] 4112: Further work for FXG to SWF transcoding - checking in some work resulting from collaborating with Kaushal to correct FXG transforms and gradient transforms as well as cater for differences between Java AffineTransform and the SWF Matrix type .

    Revision: 4112
    Author: [email protected]
    Date: 2008-11-14 10:05:42 -0800 (Fri, 14 Nov 2008)
    Log Message:
    Further work for FXG to SWF transcoding - checking in some work resulting from collaborating with Kaushal to correct FXG transforms and gradient transforms as well as cater for differences between Java AffineTransform and the SWF Matrix type.
    QE: Not yet.
    Doc: No
    Checkintests: Pass
    Reviewer: Kaushal
    Modified Paths:
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/GraphicContentNode.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/fills/LinearGradientFillNode.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/fills/RadialGradientFillNode.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/strokes/LinearGradientStrokeNode.j ava
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/strokes/RadialGradientStrokeNode.j ava
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/swf/AbstractFXGGraphics.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/swf/TypeHelper.java
    Added Paths:
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/ScalableGradientNode.java

  • How do I get more than one signature option in Fill and sign?

    How do I get more than one signature option in Fill and sign?

    Hi,
    Are you trying to place more than one signature on a PDF document?
    Please explain the workflow.
    Regards,
    Anand

Maybe you are looking for