Order by a group
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
Order by a group
I have a datatable that has all the expirations amounts of all the customers.
In each row (representing an expiration) i have the name of the customer and the amount of the debt to pay for that single expiration.
I need a report where i have the total expirations for each customers, ordered by total expirations value.
Example:
Original datatable:
Mr Smith 100,00
Mr Smith 42,00
Mr Ross 30,00
Mr Ross 80,00
Mr White 400,00
Mr White 10,00
I need this final result:
- Report ordered for descending total expirations amounts:
Mr White: Tot. 410,00
Mr Smith: Tot. 142,00
Mr Ross: Tot. 110,00
How can i do this?
Thanks.
In each row (representing an expiration) i have the name of the customer and the amount of the debt to pay for that single expiration.
I need a report where i have the total expirations for each customers, ordered by total expirations value.
Example:
Original datatable:
Mr Smith 100,00
Mr Smith 42,00
Mr Ross 30,00
Mr Ross 80,00
Mr White 400,00
Mr White 10,00
I need this final result:
- Report ordered for descending total expirations amounts:
Mr White: Tot. 410,00
Mr Smith: Tot. 142,00
Mr Ross: Tot. 110,00
How can i do this?
Thanks.
Order by a group
Add to page GroupHeaderBand and DataBand. Set height of DataBand to zero. Set condition of GroupHeaderBand to {representing}. Set property SortDirection of GroupHeaderBand to Descending. Place textbox to GroupHeaderBand and type following expression: {representing} {Sum(expiration)}.
Thank you.
Thank you.
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
Order by a group
Sorry, i receive two compiling errors (the same error but twice):
(translated from Italian)
-> error CS0103: The name "representing" doesn't exist in current context
Thanks.
(translated from Italian)
-> error CS0103: The name "representing" doesn't exist in current context
Thanks.
Order by a group
Instead {representing} you need use {YourDataSource.ColumnName}.
Thank you.
Thank you.
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
Order by a group
No error, but the output is ordered by "Customer name" in descending order, while i wanted it to be ordered by "Total expiration amount" (of each Customer) in descending order.
I have assumed that to {representing} i have to substitute the "Customer name" column.
Thanks.
I have assumed that to {representing} i have to substitute the "Customer name" column.
Thanks.
Order by a group
Sometimes I use the "Data from other Datasource" to do stuff like this.
You can Create a new Datasource in your report based off an existing Datasource registered with the report.
This way you can group by Customer Name, and Total the amount into their own columns respectively.
You can then add this new Datasource to the Page as a Databand and Sort by Amount.Sum descending.
Sample: Download
But maybe there's an even quicker approach? This is just what I do.
You can Create a new Datasource in your report based off an existing Datasource registered with the report.
This way you can group by Customer Name, and Total the amount into their own columns respectively.
You can then add this new Datasource to the Page as a Databand and Sort by Amount.Sum descending.
Sample: Download
But maybe there's an even quicker approach? This is just what I do.