Can you please help me with the sorting/grouping of this Crystal Report file?
I have a crystal report; purchase order file.
The original entry of the data was in the order of product code 1003, 1006, 1005. (Screen shot attached, EntryInDatabaseOrderExample)
When you view the Purchase Order in CR PDF the order of product code 1005, 1006, 1003 (PDF Attached)
I can’t figure out why the order in the crystal file isn’t in the same order as how it was entered into the database.
Attached is the file saved with data. Look at PO Number PO00136.
YOur report has 2 groups
Group 1 - Document Number
Group 2 - Formula - Structured Group
totext({TRANSDETAILS.ZStrStkItemView}) + totext({TRANSDETAILS.ForeignUnitPrice})
Groups serve as sorting fields so your report is sorted by Document Number then within each Document Number group the records are sorted by the Structured Group formula
If you want it sorted by the Product code you need to
1. Group on the product code rather than the Structured Group
2. You can try to convert the productCode to a number - Val({ProductCode})
Insert in in the detail section
Right click it
Click INSERT --> SUMMARY
Set Summary to SUM
Insert it in the GF2
Click REPORT --> GROUP SORT EXPERT
Change None to ALL
Select the Sum of ProductCodeValue as the sort field
mlmcc
jspc
ASKER
No, not by Product Code, it needs to be sorted by how it was entered into the database. (Order entry)
Also I cannot convert Product Code to a number as this field contains both numbers and alpha.
You have a LineNumber field. If that reflects the order in which the items were added, then you would theoretically want to sort by that before your StructuredGroup formula (eg. add a group on LineNumber and put it above the group on StructuredGroup). However, when I tried that, it seemed to change the output on your report pretty drastically, so I suspect that that isn't the answer in this case.
Group 1 - Document Number
Group 2 - Formula - Structured Group
totext({TRANSDETAILS.ZStrS
Groups serve as sorting fields so your report is sorted by Document Number then within each Document Number group the records are sorted by the Structured Group formula
If you want it sorted by the Product code you need to
1. Group on the product code rather than the Structured Group
2. You can try to convert the productCode to a number - Val({ProductCode})
Insert in in the detail section
Right click it
Click INSERT --> SUMMARY
Set Summary to SUM
Insert it in the GF2
Click REPORT --> GROUP SORT EXPERT
Change None to ALL
Select the Sum of ProductCodeValue as the sort field
mlmcc