Sorting and Grouping a Report with a SubReport

  • Thread starter Thread starter Sierras
  • Start date Start date
S

Sierras

Hello

Is it possible to group the report by one parameter and sort by
another?

My report and subreport are linked by a unique id. They are grouped
by this id. But I would like to sort by another field (ie product)
but still keep the grouping by ID

For example:

Main Report has a rptid and a Product field

Subreport has a rptid, SomeData1 and SomeData2 field


Right now, it gives me a report like this

rptid 1 Product Z
SomeData1
SomeData2

rptid 2 Product A
SomeData1
SomeData2
-----------------------------
I would like to have:

rptid 2 Product A
SomeData1
SomeData2

rptid 1 Product Z
SomeData1
SomeData2

Thanks
 
I do have the query sorted correctly and it shows fine when I just run
the query. But when I launch the report, it seems to disregard the
sorting in the query and only uses what I have set up in the
grouping/Sorting of the report.

Thing is, I can't find a way to group the data with one field and sort
with another. Seems like they can not be split up.
 
Grouping is the same as sorting with the addition of a
header and/or footer section.

Sorting and Grouping totally override whatever was done in
the query, so sorting the query is just a waste of time.

Your example does not demonstrate what you want to do when a
product occurs in more than on rptid nor when a rptid occurs
in more than one product. The way you showed what you want,
you could just sort/group on the product field (or maybe on
the product in one level and the rptid on the next level).
--
Marsh
MVP [MS Access]


I do have the query sorted correctly and it shows fine when I just run
the query. But when I launch the report, it seems to disregard the
sorting in the query and only uses what I have set up in the
grouping/Sorting of the report.

Thing is, I can't find a way to group the data with one field and sort
with another. Seems like they can not be split up. []
 
I tried to use the product field, but the results are not what I want
as it no longer keeps the rptid grouped. This is what I'd like to
happen in the scenerio you described:

Right now, it gives me a report like this

rptid 1 Product Z
SomeData1
SomeData2

rptid 2 Product A
SomeData1
SomeData2

rptid 3 Product A
SomeData1

rptid 4 Product C
SomeData2
-----------------------------
I would like to have:

rptid 2 Product A
SomeData1
SomeData2

rptid 3 Product A
SomeData1

rptid 4 Product C
SomeData2

rptid 1 Product Z
SomeData1
SomeData2
 
Well I finally figured out how to make this work, but it isn't very
pretty. There must be a better way.
I created a group for product and 2con rptid and also created a group
header for both.
But I didn't put anything into the product header section nor the
detail section. All the data is in the rptid section. It works, but
I'm sure there must be a better way. For instance, I can't believe
that to make this work I have to have nothing in the detail section...
Is this normal??
 
Sierras said:
Well I finally figured out how to make this work, but it isn't very
pretty. There must be a better way.
I created a group for product and 2con rptid and also created a group
header for both.
But I didn't put anything into the product header section nor the
detail section. All the data is in the rptid section. It works, but
I'm sure there must be a better way. For instance, I can't believe
that to make this work I have to have nothing in the detail section...
Is this normal??

Possible, but not normal.

I would think you would wat to set the top level of Sorting
and Grouping to sort on Product and the second level to
group on rptid. The rptid group header would then have a
text box fot reptid and another for product, The detail
section would have a text box for the data fields.

If that won't do what you want, then I suspect that the
report's record source table/query is unusual.
 
Back
Top