Sorting a grid with CollapseLevel = 1

hi
i have a grid in my form, and i use a DataTable to fill up that grid. My sql commando was 2 fields in order by. And it works fine.
They are represented by [COL 1] and [COL 5] DESC.
COL 1 ! COL 2 ! COL 3 ! COL 4 ! COL 5
01 Ex ! 00001 ! 00001 ! 00001 ! Y
02 Im ! 00002 ! 00002 ! 00002 ! Y
02 Im ! 00002 ! 00002 ! 00003 ! N
<u><i><b>03 Re ! 00003 ! 00003 ! 00006 ! Y
03 Re ! 00003 ! 00003 ! 00004 ! N
03 Re ! 00003 ! 00003 ! 00005 ! N</b></i></u>
After i apply the CollpaseLevel=1 it becomes
COL 1 ! COL 2 ! COL 3 ! COL 4 ! COL 5
01 Ex !
________00001 ! 00001 ! 00001 ! Y
02 Im !
________00002 ! 00002 ! 00002 ! Y
________00002 ! 00002 ! 00003 ! N
03 Re !
<u><i><b>________00003 ! 00003 ! 00005 ! N
________00003 ! 00003 ! 00004 ! N
________00003 ! 00003 ! 00006 ! Y</b></i></u>
It should be order first by [COL 5] in descendente order but it just changes.
How can i keep de order that i have defined in strsql statment.
thanks in advance
Nelson Soares

I afraid it's not possible to use collaps level and doing "complex" sorting at the same time (I don't think what you trying is complex but it is for the grid).. In general try looking at this thread: Re: Subtotals with collapslevel in Grid
>Grid and collaps level:
>- Work with it quite some time and my conclusion is >that what you see initially after setting collapslevel >is what's possible... I would call the grid a big >disappointment when it comes to colapslevel/tree->view... Simple to use, but impossible to customize...
I have never to date had a problem that the collaps level could solve ...

Similar Messages

  • Get value in Grid with CollapseLevel

    Hi all,
    I have a grid with CollapseLevel=2
    In my datatable, i have 2 lines.
    When i load my grid i have 5 lines (Grid.Rows.Count)
    i want to get the value of the selected lines. How can i do ??
    Example :
    2 lines in datatable
    5 lines in my grid in mode view
    if i select the line 5, pVal.Row has the value 5 but this number of lines does not exists in my datatable.
    Thanks for your response.
    Best regards
    Michael.

    Hi,
    you may check if the row is selected in cycle as
    if oGrid.Rows(x).IsSelected() = true then
    and when is selected, receive the value directly from grid and not from datatable or from datatble as
    oGrid.GetDataTableRowIndex(x) where x is selected row in matrix and result is row in datatable and the value you will receive from datatable.
    hope it helps
    Petr

  • Sort a Grid while using CollapseLevel

    I'm using a Grid with data that I need sorted.  I can use the SQL statement to sort the data how I need it.  But I would also like to use CollapseLevel.  When I do that my data gets scrambled.  Have any of you found a work around for this?

    Hi,
    I´m sorry to tell that there are no good news. The Grid object hasn´t any Ordering functionallity nowadays, and the only way to get that is to execute the SQL statement again. As Grid object needs the format to be designed each time new data is entered, you will have to do it each time the sorting is done.
    Regards,
    Ibai Peñ

  • How can i create a grid with summary row

    Hello Professionals,
    I'm wondering how could i create a grid like the grid below, i want to create a grid with summary row,
    i have tried to create it using collapsing but it didn't work as required.
    Any suggestions?, i want to know just the starting point so i can make deep investigations.
    Thanks in Advance,

    Hi Karem,
    this can be achieved by just assigning a datatable containing the data plus some formatting of grid. Meaning there is no feature for that.
    The datatable can be filled manually or by sql query. Then you have to attach some events for updating the values ( validate after for gid item ).
    A small example for a sql query showing last month quotations and orders with summary :
    select 1 as Sort,cast(DocNum as varchar) as DocNum,DocTotal,convert(varchar, DocDate,104) from OQUT where DocDate between  DATEADD(month, -1, GETDATE()) AND GETDATE()
    UNION ALL
    Select 2 as Sort,'Summary ( Quotation ) : ',sum(DocTotal), convert(varchar,  DATEADD(month, -1, GETDATE()),104)+' - '+convert(varchar,   GETDATE(),104) from OQUT where DocDate between  DATEADD(month, -1, GETDATE()) AND GETDATE()
    UNION ALL
    select 3 as Sort,cast(DocNum as varchar) as DocNum,DocTotal,convert(varchar, DocDate,104) from ORDR where DocDate between  DATEADD(month, -1, GETDATE()) AND GETDATE()
    UNION ALL
    Select 4 as Sort,'Summary ( Order ) : ',sum(DocTotal), convert(varchar,  DATEADD(month, -1, GETDATE()),104)+' - '+convert(varchar,   GETDATE(),104) from ORDR where DocDate between  DATEADD(month, -1, GETDATE()) AND GETDATE()
    ORDER by Sort
    regards,
    Maik

  • Load Grid with data from System.Data.DataTable

    Hi all.
    A have a System.Data.DataTable e need load a grid with data from this DataTable.
    How Load a Grid with data from System.Data.DataTable?

    Hi Francisco,
    actually i don't think that you can use a .NET datatable to fill a business one grid.
    the business one has it's own datatable.
    in c# it would look like this:
    oForm.DataSources.DataTables.Add("MyDataTable");
    ((SAPbouiCOM.Grid)(oForm.Items.Item("grid").Specific)).DataTable = oForm.DataSources.DataTables.Item("MyDataTable");
    oForm.DataSources.DataTables.Item(0).ExecuteQuery("SELECT Field FROM [dbname].dbo.TABLE");
    ((SAPbouiCOM.Grid)(oForm.Items.Item("grid").Specific)).CollapseLevel = 1;
    ((SAPbouiCOM.Grid)(oForm.Items.Item("grid").Specific)).AutoResizeColumns();
    ((SAPbouiCOM.Grid)(oForm.Items.Item("grid").Specific)).SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single;
    good night
    lg David

  • Extjs grid with pagination

    hi,
    i just start learning how to integrate extjs with oracle apex.
    i manage to create a normal extjs grid but got problem when trying to create
    a grid with pagination.
    lets say ihave 100 rows of data, and i want to show only 10 rows of data per page, so how should i do that?
    i know i need to send a request to so that i will get data 1-10 for the first page, and then when i click next,
    i will get data 11-20 and so on.
    but i dont know how to make it happen. i cannot find any example on the net.
    how to know what is the current data set, (is it 1-10 or 11-20) , so that i can pass the correct values for start, to the application
    process?
    hope someone here can help me.
    thanks,
    -aku
    Edited by: akulala on Sep 5, 2010 6:25 AM

    Hi Aku
    As far as I recall, alot of this came from Mark Lancaster so I would advise googling for his blog and having a look there - it may well make a lot more sense than this does.
    I normally build my ExtJS script up at page loaed time using a package and print it out using htp.prn. So for the pagination, I would print out something like this...
        htp.p('<script>var u = (window.location.href.indexOf("?") > 0) ? window.location.href.substring(0,window.location.href.indexOf("?")) : window.location.href;
               var baseURL = u.substring(0,u.lastIndexOf("/"));
               var gridURL = baseURL + ''/wwv_flow.show?p_flow_id='' + Ext.getDom(''pFlowId'').value + ''&p_flow_step_id=0&p_instance='' + '||
              'Ext.getDom(''pInstance'').value + ''&p_request=APPLICATION_PROCESS%3DejPaginate'';</script>');And then my store would be defined as something like this...
    myStore = new Ext.data.Store({
                  storeId: 'myStore',
                  proxy: new Ext.data.ScriptTagProxy({
                  url: gridURL,
                  nocache: false,
                  callbackParam: 'p_widget_num_return'
                  baseParams: {'x01':'&APP_ID.', 'x02':'&APP_PAGE_ID.', 'x03':'xyz'},  //the xyz would be your region
                                                                                       //ID passed into the procedure I gave you in my previous post
                  remoteSort: true,
                  paramNames: {
                  start: 'x04', // The parameter name which specifies the start row
                  limit: 'x05', // The parameter name which specifies number of rows to return
                  sort: 'x06',  // The parameter name which specifies the column to sort on
                  dir: 'x07'    // The parameter name which specifies the sort direction
                  reader: myReader
                  });And my application process (ejPaginate in the above example) would look something like this...
    BEGIN
      htp.p(wwv_flow.g_widget_num_return||'(');
      get_grid_json(p_app_id => wwv_flow.g_x01,
                        p_app_page_id => wwv_flow.g_x02,
                        p_region_id => TO_NUMBER(wwv_flow.g_x03),
                        p_start => NVL(wwv_flow.g_x04,0),
                        p_limit => NVL(wwv_flow.g_x05,10),
                        p_sort => wwv_flow.g_x06,
                        p_dir => wwv_flow.g_x07);
      htp.p(')');
    END;Hope this helps you along.
    Cheers
    Ben

  • Samples for creating a calibration grid with supplied points. Not a Grid graphic

    Hi again.
    I have a desire to create a calibration grid for my images captured with IMAQ methods from Measurement Studio.
    I already take measurements and such based on a calibrated Grid from a .jpg. But now I am interested in allowing my user to create a calibration grid on the fly based on selecting points in a template image and supplying real world values.
    The manual section 6 on grid calibration makes some reference to the CWIMAQVision.LearnCalibrationPoints method. But little information is supplied.  Does NI have a sample of a "Create your grid from points" sort of idea?
    As I would also like to be able to define this grid with points, and then put a perspective on it.
    Looks like it should be able to be achieved.
    Thanks

    it's ok, I figured it out.
    just using Flash builder 4.5 grid containers

  • Sort GridControl modeled with parameterized query (bug?)

    I am using JDev 3.2.3. I created a ViewObject in expert mode which contained a parameterized query:
    select emp_name, salary
    from employees
    where
    dept_no = :1
    Then, through a few workarounds, I managed to create a BC4J data form containing a GridControl linked to the ViewObject.
    Cleared the associated empsRowSetInfo.queryOnOpen(false).
    Created a button with action event:
    empsRowSetInfo.setQueryConditionParams(new Object[] {
    deptId
    empsRowSetInfo.executeQuery();
    This all works fine.
    ***The problem***
    If you press on a header to re-sort the grid, a bad sql query error is thrown and details shows the following bad query:
    select * from (
    select emp_name, salary
    from employees
    where
    dept_no = :1)
    order by asc emp_name
    ORA-00904: invalid column name
    The GridControl headers appear to be getting their own copy of the ViewObject's query, then misinterpretting it. This works fine for non-parameterized queries since the column names are explicit. However :1 is not a column name but a place holder in my parameterized query.
    Shouldn't the headers be using the same mechanism to sort the grid as used to populate the grid model originally?
    Any suggestions for a workaround? Pressing a column header fatally breaks the form. Pressing the button again to re-execute the original query continues to throw the error!
    Thanks,

    This is clearly a bug.
    DAC is in 9.0.2 + replaced by JClient.
    It might be hard to get a fix for this problem.
    As far as a workaround.
    You can provide your own SortDelegate.
    Start with diagnosing the problem by extracting the SortDelegate class out of 'dacf-src.zip'.
    Change it into a mySortDelegate.java.
    Set the sortDelegate property on the gridControl. (use an instance of mySortDelegate).
    You should be able to step into your implementation and see what the problem is.
    Hopefully you will be able to fix the problem in your sortDelegate class.

  • Button event causes sort on grid column

    This is an unwanted behavior. I have a data grid with buttons in the column header. When clicked a pop-up is initiated but at the same time that column is sorted. How can I disable the sorting, just during the buttonclick event?
    This is the line of code that enables the pop-up:
    column.addEventListener(ButtonHeaderEvent.BUTTON_C LICK, openSliderPanel);

    That is correct.  Here are more specifics:
    import flash.events.Event;
    public class ButtonHeaderEvent extends Event {
        public static const BUTTON_CLICK:String = "buttonClick";
        public var eventX:Number;
        public var eventY:Number;
        public function ButtonHeaderEvent(type:String, x:Number, y:Number) {
            super(type);
            eventX = x;
            eventY = y;

  • Sorting on Grid column

    Hello Experts,
    I have an UDF with a grid that I have to sort by one column.
    I'm manually filling the grid not using an sql query with DataTable, so I can't use the "order by" clause for sorting.
    Can anyone help me ?
    Thanks for your time in advance.
    Best regards
    Andrea

    Andrea,
    If i well understood I insert the new values in the grid already ordered using the row index parameter in method myGrid.DataTable.Rows.Add()
    Yes, that's correct.
    So why I'd need to catch the TitleObject double click event and re-order the grid's values ?
    You only need to do this in order to emulate B1 Grid's sort functionality. With it, if a user double clicks a column, the grid will sort it self.
    How can I find the right row index for the alphanumeric grid column ?
    What do you mean by "the right row index"?
    If you fill the grid, or more correctly, the Grid's DataTable row by row, just use myGrid.DataTable.Rows.Count -1 as the index.
    Regards,
    Vítor Vieira

  • Not able to sort any grid after Tools upgrade from 8.49.10 to 8.50.07

    Not able to sort any grid after Tools upgrade from 8.49.10 to 8.50.07, also when I click on any prompt button the prompt values are displaying in a separate screen rather than displaying in a model window.

    I have resolved it by applying stylesheets and clearing the cache.
    Thanks,
    Jayaprakash Tedla

  • Back from ALV Grid with multiple refresh

    I have a report that from a selection screen shows an editable ALV Grid, and after I save it, it will refresh the grid.
    My problem is when I hit the BACK button it returns to the "previous grid" instead of the selection screen
    I am using the following:
    WHEN 'BACK_C'.
      LEAVE to SCREEN '0'.
    How can I force it to go back to the selection screen?
    sidenote: I have tried using call
    selection-screen '1000'
    but it adds a new problem as in the selection screen hitting back will return to the grid and I can never exit the report.

    Neither solution works.
    If it helps, I'm refreshing the grid with:
    DATA : ref_grid TYPE REF TO cl_gui_alv_grid.
      IF ref_grid IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = ref_grid.
      ENDIF.
    CALL METHOD ref_grid->refresh_table_display( ).
    It seems when I refresh the grid it generates a completely independent grid screen and there's no way to skip them all and return to the selection screen.

  • Display amount in ALV Grid with different Decimal Places based on Currency

    HI Experts,
    Working with ALV Report i have one Amount field NETWR which is having Length 15 and Decimal Places 2.
    we have two different types of currency's AED and KWD and AED having 2 decimal Places and KWD having 3 decimal places.
    im using FM: REUSE_ALV_GRID_DISPLAY for Display. value storing in Table was like this
    AED---22.56
    KWD---225.65
    i need to display values like AED : 22.56

    HI Experts,
    Working with ALV Report i have one Amount field NETWR which is having Length 15 and Decimal Places 2. we have two different types of currency's AED and KWD and AED having 2 decimal Places and KWD having 3 decimal places.
    im using FM: REUSE_ALV_GRID_DISPLAY for Display. value storing in Table was like this
    AED---22.56
    KWD---225.65 (converting this value to 22.565 using BAPI_CURRENCY_GETDECIMALS according to currency in my Report)
    i need to display values like AED : 22.56
                                             KWD---22.565 but here field is NETWR with 2 decimal.
    Need to Display amount in ALV Grid with different Decimal Places based on Currency
    Regards,
    Dileep Kumar Reddy

  • What organizer app has a really good WEEK VIEW like my Palm Pilot - it's a grid with days across the top.  Below each day- the day is divided into hourly grids.  When events are schdeuled across  week - you get a mosaic of time blocks.  Analogue - great

    What organizer app has a really good WEEK VIEW like my Palm Pilot - it's a grid with days across the top.  Below each day- the day
    is divided into hourly grids.  When events are schdeuled across  week - you get a mosaic of time blocks.  Analogue view is  great way
    to comprehend the time obligations as a molar pattern.
    thx,
    Fritz

    I use Week Cal on the iPod.  I think it was only $1.99.  It is a lot better and does a lot more than the one that came with the Palm Pilot.
    As you know, unlike the Palm Pilot, the iPod does not come with a desktop application that you can sync your iPod calendar to.  Since I don't use Outlook, I have to use a Cloud based calendar to sync with my PC.  I use Hotmail's calendar for that.  (If your computer is a MAC, you can use iCal)

  • Grid with check box.

    Hi,
    I want to make a grid with check box. I want to have two column in the grid. One column of the grid will show some column name of a table and the other column will contain check box. If I tick the check box of a the selected row of the grid then the value (e.g. Y or N) will store in the particulr table.
    I have written some code regardig this. But I am not getting my problem solved. I am sending the code sample below.
    oNewItem = oOrderForm.Items.Add("MyGrid", SAPbouiCOM.BoFormItemTypes.it_GRID)
            oNewItem.Left = 20
            oNewItem.Top = 30
            oNewItem.Width = 198
            oNewItem.Height = 130
    oGrid = oNewItem.Specific
    Dim str As String
            str = "SELECT COLUMN_NAME AS FACILITIES, '' AS TICK FROM PIONEER.INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'OITM' AND ORDINAL_POSITION BETWEEN 102 AND 165"
            oOrderForm.DataSources.DataTables.Add("MyDataTable")
            oOrderForm.DataSources.DataTables.Item(0).ExecuteQuery(str)
            oGrid.DataTable = oOrderForm.DataSources.DataTables.Item("MyDataTable")
            ' Set columns size
            oGrid.Columns.Item(0).Width = 270
            oGrid.Columns.Item(0).Editable = False
            oGrid.Columns.Item(1).Width = 70
            oGrid.Columns.Item(1).Type.gct_CheckBox.GetValues()
    From The last line I am getting problem. Please any one can help me for this problem.
    Thank you
    Amit Kumar Shai

    Hi
    The last line should read like this
    oGrid.Columns.Item(1).Type = SAPbouiCOM.BoGridColumnType.gct_CheckBox

Maybe you are looking for

  • Payables Open Interface Import getting errors out

    Hello All, I am trying to run "Payables Open Interface Import" program to upload the invoice but the program is getting error out, in the log file at the end i am getting the below error: (Insert ap inv dists 1a) Inside the insert function (Insert ap

  • Conditions in scale pricing in purchase info record

    Dear Experts, Need your valuable inputs on the following issue: We have entered into an agreement with a vendor with the following clause: 1 PAC of material ABC costs Rs. 13000/- In every month , the first PAC bought will be priced at Rs 13000/- and

  • Is it possible to use my snow leopard software for my macbook pro on an iMac or more iMacs?

    Here is the reason why i'm asking this question that sounds silly to me in a way...... i got the 2011 15.4inches macbook pro 2 weeks ago ..... it came with the last snow leopard os x but since the lion was out and i was eligible for an upgrade i got

  • Samsung NX100 RAW Support?

    I've been trying to use Aperture with the Samsung NX100.  In most conditions there is too much red/magenta.  In some photos it is absolutely out of control.  For example, a couple of indoor portraits had the person's face bright magenta, and a pine c

  • JS Errors with SpryDOMUtils.js and SpryAccordion.js

    Hi NG, i was searching the whole day. The accordion was in IE not working and i get lot of JS erros. Finaly i know now, that when i remove the SpryDOMUtils.js all works fine. But.... i whant to open all the pages from the accordion. Is there any info