none
Use First Aggregate Function in Details Section in RDLC RRS feed

  • Question

  • Hi Guys,

    Is it possible to use First() function in the details section of rdlc?

     

    Thank you in advanced.

    _______________________

    God Bless

    Charlie

    Thursday, April 14, 2011 8:49 AM

Answers

  • I'm not yet clear. Do you want to repeat the product names? or are these "Product Name" rows different product names as well. If the latter is the case then I see that this is a pretty standard case for grouping data, but i just want to make sure.

    Grouping in the generic sense is as follows (although you can use expressions to customize it):

    you have data like

    Category      Name         Price

    Bike            Model1        $300

    Bike            Model2        $100

    Parts           Pedal1         $20

    Parts           Seat1          $40

    ...

    If you group on the category column, then it will look like this:

    Bike             Model1       $300

                       Model2       $100

    Parts            Pedal1        $20

                       Seat1         $40

    So if ReferenceID is filled with all unique values in your case, then grouping on that column doesn't do you much good, because you get exactly one row in each group.

    If none of this is helping, you should supply a mock table that shows exactly what you're trying to achieve (with unique data, etc.)


    Cephas Lin This posting is provided "AS IS" with no warranties.
    Monday, April 18, 2011 2:42 PM
    Moderator

All replies

  • Yes. :)
    Cephas Lin This posting is provided "AS IS" with no warranties.
    Thursday, April 14, 2011 7:37 PM
    Moderator
  • Thanks Cephalin.

     

    Actually I tried it before I posted a question here. It's working but it displays repeatedly. I coded it =First(Fields!columnname.Value, "table1_Group1"), however, it fetched all the values in the table instead of First  value only.

     

    I didn't use hide duplicate property since I am using First Function and I meant not to use it due to the reason that it only hides the preceding row, when the content reaches the next page, it never hides the repeated value.

     

    Thank you Sir in advanced.

     

    _____________________

    God Bless

    Charlie

    Friday, April 15, 2011 1:14 AM
  • Yes, it's like it just displays the whole table like it would without the First() value and then just replace all the values with the First() value.
    It took me a while myself, but here's what you need to do: define the following expression for the group visibility (which is applied to the Hidden property):
    =(Fields!fieldname.Value <> First(Fields!fieldname.Value, "parent_group"))
    It basically says hide every group member that doesn't equal the first member.
     

    Cephas Lin This posting is provided "AS IS" with no warranties.
    Friday, April 15, 2011 6:02 PM
    Moderator
  • Good Day Cephalin.

     

    Thank you.

     

    I see it now but actually, those values are intend to be the same because I grouped it according to i.e. ReferenceID. It looks like:


    Duplicated:

    REFERENCEID    PRODUCT

    REF 0001         Product Name

    REF 0001         Product Name

    REF 0001         Product Name

     

    Hide Duplicates:

    REFERENCEID    PRODUCT

    REF 0001         Product Name

                          Product Name

                          Product Name

     

    I thought hide duplicates property would be enough to make it but the problem is when it reaches the next page, it doesn't hide the value (REF 0001) since hide duplicates property only hides the preceding rows in that page only but not the rows on the next page. i.e.:

     

    Page 1

    REFERENCEID    PRODUCT

    REF 0001         Product Name

                          Product Name

                          Product Name

     

    Page 2

    REFERENCEID    PRODUCT

    REF 0001         Product Name        'REF 0001 should be remain hidden.

                          Product Name

                          Product Name

     

    Can I ask you Ceph? I just want to clear about Parent Group, I read about it but still I did not get the exact usage. I have group in my table named "GroupREF" and being grouped on REFERENCEID since this is only unique data in my table. If I am going to assign a value for Parent Group what would it be?

     

    Thank you Ceph for helping me with this one.

     

    _______________________

    God Bless

    Charlie

    Saturday, April 16, 2011 1:45 AM
  • I'm not yet clear. Do you want to repeat the product names? or are these "Product Name" rows different product names as well. If the latter is the case then I see that this is a pretty standard case for grouping data, but i just want to make sure.

    Grouping in the generic sense is as follows (although you can use expressions to customize it):

    you have data like

    Category      Name         Price

    Bike            Model1        $300

    Bike            Model2        $100

    Parts           Pedal1         $20

    Parts           Seat1          $40

    ...

    If you group on the category column, then it will look like this:

    Bike             Model1       $300

                       Model2       $100

    Parts            Pedal1        $20

                       Seat1         $40

    So if ReferenceID is filled with all unique values in your case, then grouping on that column doesn't do you much good, because you get exactly one row in each group.

    If none of this is helping, you should supply a mock table that shows exactly what you're trying to achieve (with unique data, etc.)


    Cephas Lin This posting is provided "AS IS" with no warranties.
    Monday, April 18, 2011 2:42 PM
    Moderator
  • Hello Cephalin,

     

    Thanks for that. My product name stays as is, whether it has duplicate or non. I am concern with the ReferenceID, it should not be repeated until next page. In my case, your Category is equivalent to my ReferenceID. Do you mean if I group it like your example, I do not have to set the hide duplicate property for ReferenceID?

     

    Thank you again.

     

    ____________________

    God Bless

    Charlie

    Thursday, April 21, 2011 12:48 PM
  • If your data is similar to my example, then yes, all you need to do is to group your data on your ReferenceID row.


    Cephas Lin This posting is provided "AS IS" with no warranties.
    Thursday, April 21, 2011 2:51 PM
    Moderator
  • Ah...I see. Thank you Cephalin for your kindness and effort since from the start until finish.

     

    _________________

    God Bless

    Charlie

    Thursday, April 21, 2011 3:26 PM