Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Grouping / sorting problem

edited August 2003 in General
Hello,

I have a master/detail report that takes its data from 2 SQL queries, (1
each for the master & detail tables) and feeds the data through two linked
ppDBPipelines. Initially, the data was sorted by the key of the master
table, a group placed in the main report and a subreport added for the
detail lines. This works perfectly.

Now however, I want to sort the report firstly by a different field, and
then by the key of the master table. I have changed the SQL queries to sort
the data appropriately (and checked it by placing 2 grids on the form) and
added a second group to the main report. This does not work. The result I
get is:

Field B value 1
Key field value 1 for field B value 1
Key field value 2
...
Last key field value for field B value 1( with the appropriate detail
records printing for each key field value)
Field B Value 2
Key field value 1 for field B value 2
The report then proceeds to print all the detail records for all the key
field values up to the point where the key field value exceeds the last key
field value printed for field B value 1.

This format is continues for the rest of the report.

What am I doing wrong!

I am using ReportBuilder 6.03, Delphi 6 professional, accessing the data
from SQL sever 2000 using ADO

Thanks

Steve Everington

Comments

  • edited August 2003
    Hi Steve,

    ReportBuilder will only traverse the data according to the way it is sorted
    in your dataset. You will need to reorder your dataset to get the results
    you need perhaps by creating a new dataset to handle the first field you
    need to sort.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.