Joined: 25 Jan 2008
Location: United Kingdom
Online Status: Offline
Posts: 9
Topic: Last record in a group (puzzled) Posted: 02 Oct 2009 at 5:39am
Hi,
I am using Crystal 9 to extract data from a Syteline ERP system. I am accessing a table which logs production planning transactions for each manufactured item. I need the report to replicate the exact record sort order that is visible on the screen so that I can perform a calculation on the most recent record for each item. The screen sort order also happens to be the way the database displays the records in Enterprise Manager. So, Easy you may say !
When I pull all the records from the table into the report the record sort order matches the screen and database as you would expect. When I group the report on item the sort order remains correct so that when I move the required field from Detail into the Group Footer it will display the last record for each item. I can then perform the calculation and hide the details - job done.
However when I add a selection parameter so that I can select a single item or a range of items the sort order changes so that the last record for each item in the report no longer matches the last record on screen or out of the database. It does not do this for all records just odd ones making the report un-reliable. There is a date field in the table but it is not time stamped so I cannot use it to guarantee sorting chronologically.
My Question Why would adding a selection parameter alter the sort order of the records ? The report is just grouped on Item, there is no other selection, grouping or sorting going on in the report. Why would it only re-sort on certain records ?
Is there code to guarantee that Crystal displays records in the order that they come from the database ?
Joined: 25 Jan 2008
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 02 Oct 2009 at 7:08am
Thanks lockwelle for your quick reply, I did try using original order. For some of the erroneous items it corrected the sort order but for others which were previously OK it messed them up.
Anyway I have just this afternoon managed to get the report error free. I discovered that the Syteline ERP screen used about 5 different fields to sort the data not just the date. When I sorted my report on all 5 fields then the data matched.
However I would still like to try and understand why the addition of a parameter field would change the sort order on certain records, on what was a very simple report.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum