Skip to Content
author's profile photo Former Member
Former Member

Collapse Grid and sort data

Hi all,

I have a grid on an UDO form. I fill the grid with this query :

SELECT U_IFC_SlpN, U_IFC_PRO, U_IFC_PRON, U_IFC_DocN, U_IFC_TYP, U_IFC_ECH, U_IFC_STA, U_IFC_CC, U_IFC_CN, U_IFC_MHT, U_IFC_MBM, U_IFC_MBP, U_IFC_MNM, U_IFC_MNP, U_IFC_COM, U_IFC_CDU, U_IFC_REG FROM [@IFC_BDC1] WHERE DocEntry=" + oEdit.Value + " ORDER BY U_IFC_SlpN, U_IFC_DocN

When i do this code : oGrid.CollapseLevel = 1;

i'm lost the sort by U_IFC_DocN. i don't understand why ? is there a solution to this problem ?

i make a link in the U_IFC_DocN column and when i click on the link, the value is incorrect (i have two type of documents). The link open the wrong document with the wrong number.

Thanks for your response.

Best regards

Michael

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 02:06 PM

    Hi Michael,

    i tried it in the past and the grid seems after collapse to sort the records ascending and order by you wrote in query is missing. For me was solution to append row number to the collapsed collumn as

    select right(' ' + convert(varchar, ROW_NUMBER() OVER (ORDER BY U_IFC_DocN desc)),5 ) + '. ' + U_IFC_DocN, ....

    The result is, that this will the same result in order by U_IFC_DocN as in standard sorting by collapse, but you will have number of record before each U_IFC_DocN value.

    I didn`t found any other solution for this.

    Hope it helps you.

    Petr

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      try it with the ROW_NUMBER() as I wrote before, than you will open the right document correspond with the grid. The result will be then:

      _____1._Sales manager

      pro1 project A -->1 13

      _____2._Purchase manager

      pro1 project A -->1 13

      Where _ is space.

      At the beginning will be number of row and sort in the datasource and grid will be the same.

      Petr

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 05:00 PM

    hi micheal

    When I am creating columns for linked documents in a grid.

    I create one column per document type.

    So AR Invoices get Col 1, Credit Memos get column 2. I then bind the column to the linked object type.

    I've found my customer prefer this approach as it very clearly demonstrates the difference between the two document types (and it's easier to implement).

    Also, if you are not doing so already, you must use docentry not docnum

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.