how to group by one column, sort by another column

Stimulsoft Reports.NET discussion
xiaoliyuan
Posts: 4
Joined: Mon May 17, 2010 5:42 pm

how to group by one column, sort by another column

Post by xiaoliyuan »

Hi all,
In the report, there is a datasource for a list of products. I have added a groupheader to group them by product ID, but I don't want to sort them by productID , instead I want to sort the products by product description. Anyone can help me with this?
Thanks
Ben
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

how to group by one column, sort by another column

Post by Jan »

Hello Ben,

Please set SortDirection property of GrooupHeaderBand to None. After then add required sorting to DataBand.

Thank you.
xiaoliyuan
Posts: 4
Joined: Mon May 17, 2010 5:42 pm

how to group by one column, sort by another column

Post by xiaoliyuan »

great, thanks. It works:biggrin: :biggrin: :biggrin: :biggrin: :biggrin: :biggrin:
hana
Posts: 14
Joined: Tue Jun 14, 2011 3:17 am

how to group by one column, sort by another column

Post by hana »

I have the same problam but I dont understood your help
what do you meen " add required sorting to DataBand"?
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

how to group by one column, sort by another column

Post by Ivan »

Hello,
hana wrote:I have the same problam but I dont understood your help
what do you meen " add required sorting to DataBand"?
Please set the Sort property of the databand to: SortBy=product_description_field, Ascending.

Thank you.
hana
Posts: 14
Joined: Tue Jun 14, 2011 3:17 am

how to group by one column, sort by another column

Post by hana »

I want to group by ProductID
but to view the groups sorting by ProductName

I didnt mean that I wanted to sort the data of every group but to sort the groups
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

how to group by one column, sort by another column

Post by Andrew »

Hello,

Does the only ProductName correspond to each ProductID?
Then you can group by ProductName.

Thank you.
hana
Posts: 14
Joined: Tue Jun 14, 2011 3:17 am

how to group by one column, sort by another column

Post by hana »

hello,

"ProductName" was just example

I want to sort by column that not correspond to each ProductID

what can I do?
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

how to group by one column, sort by another column

Post by Ivan »

Hello,

Can you please send us a sample report template with data?

Thank you.
wprmdev
Posts: 19
Joined: Fri Jun 07, 2019 6:52 pm

Re: how to group by one column, sort by another column

Post by wprmdev »

I have the same problem. I have a dataset with the following structure:

SupplierId, SupplierName, ProductId, ProductName.

I need to group by SupplierId and sort by SupplierName.

And the DataBand sorts by ProductName.

Why not group by SupplierName? We can't guarantee that the name is unique. The ID is responsible for that.

This is a common situation. To me, it doesn't make sense to use a name or description instead of the ID.

Is there a solution for this?

I am using version: 2024.3.2
Post Reply