cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Report Sorting Groups (1, 1.1, 1.1.1, 1.2, 1.2.1,, 2, 2.1, etc.) and sub-totals per group?

0 Kudos
314

In my report used for quotes and invoices I've got two groups: main voucher-postion number and sub-groups of the main position.

I'd like to achive this kind of sorting with sub-totals:

1

1.1

1.1.1

1.1.2

  • Sub-total of sub-group 1.1. (running total for 1.1.1 to 1.1.x)
  • Sub-total of main group 1 (running total for all positions grouped in 1)

2.

2.1

...

  • Sub-total of sub-group 2.1. (running total for 2.1.1 to 2.1.x)
  • Sub-total of main group 2 (running total for all positions grouped in 2)

10

10.1

10.1.1

  • Sub-total of sub-group 10.1.
  • Sub-total of main group 10

etc.

From this post I got most of it to work: https://answers.sap.com/questions/8017433/crystal-report-record-sorting---numerical.html (many thanks to the cotributers! 🙂

But, in my current report is showing e.g.:

1.

1.1

1.1.1

10.1

11.1

2.

2.1

etc.

Any ideas how to get the sub-groups aligned with the main voucher-positions for anything >9?

View Entire Topic
DellSC
Active Contributor
0 Kudos

This is because of the way that numbers sort when they are converted to strings. So, for each of the groups you need to use numbers with leading zeros when the number is less than 10. You can display the group title like you are, but you would need to convert them for the groups to sort correctly. The will look like this:

01.

01.01

01.01.01

02.

02.01

...

10.

10.01

11.

11.01

etc.

-Dell