group / detail layout

  • Thread starter Thread starter hughess7
  • Start date Start date
H

hughess7

Hi all

Is it possible to print a report like a word table? ie to have the group
heading on the left column and the detail opposite on the right instead of
having the heading at the top with the detail underneath?

Thanks in advance for any help.
Sue
 
hughess7 said:
Is it possible to print a report like a word table? ie to have the group
heading on the left column and the detail opposite on the right instead of
having the heading at the top with the detail underneath?


Probably. Could you provide more details about the effect
you are trying to achieve, maybe a little example of the
group and detail information and how you want them to appear
on the page.
 
hughess7 said:
Is it possible to print a report like a word table? ie to have the group
heading on the left column and the detail opposite on the right instead of
having the heading at the top with the detail underneath?


Probably. Could you provide more details about the effect
you are trying to achieve, maybe a little example of the
group and detail information and how you want them to appear
on the page.
 
Hi, sorry my last reply went direct to Marshall instead of the newsgroups...
basically what I am reporting on is a list of standards which can have one
or more actions against them. It would look better if the standards text
appeared on the left of the report and the Actions against them appeared on
the right.

Currently the report is based on a query which has the standards repeated
for each Action found relating to it (one to many relationship). The report
is grouped so each standards text only appears once in the group header and
the Actions are in the detail section of the report, with a date and
signature box against each action.

So the result is one long paragraph of text with each Action listed
underneath. What I would like to produce if possible similar to the example
below but it is difficult to show the layout properly via this posting...

Std Code Standard Action(s) Action By
Resp
B.1.2.(a) Example text of a std which Action 1 text Date
Signature
could span approx 10 lines Action 2 text Date
Signature
Action 2 cont.

B.1.2 (b) Standard no 2 example Action 1 only Date
Signature
text

B.1.2 (c) Standard no 3 example Action 1 text Date
Signature

Thanks
Sue
 
Hi, sorry my last reply went direct to Marshall instead of the newsgroups...
basically what I am reporting on is a list of standards which can have one
or more actions against them. It would look better if the standards text
appeared on the left of the report and the Actions against them appeared on
the right.

Currently the report is based on a query which has the standards repeated
for each Action found relating to it (one to many relationship). The report
is grouped so each standards text only appears once in the group header and
the Actions are in the detail section of the report, with a date and
signature box against each action.

So the result is one long paragraph of text with each Action listed
underneath. What I would like to produce if possible similar to the example
below but it is difficult to show the layout properly via this posting...

Std Code Standard Action(s) Action By
Resp
B.1.2.(a) Example text of a std which Action 1 text Date
Signature
could span approx 10 lines Action 2 text Date
Signature
Action 2 cont.

B.1.2 (b) Standard no 2 example Action 1 only Date
Signature
text

B.1.2 (c) Standard no 3 example Action 1 text Date
Signature

Thanks
Sue
 
hughess7 said:
basically what I am reporting on is a list of standards which can have one
or more actions against them. It would look better if the standards text
appeared on the left of the report and the Actions against them appeared on
the right.

Currently the report is based on a query which has the standards repeated
for each Action found relating to it (one to many relationship). The report
is grouped so each standards text only appears once in the group header and
the Actions are in the detail section of the report, with a date and
signature box against each action.

So the result is one long paragraph of text with each Action listed
underneath. What I would like to produce if possible similar to the example
below but it is difficult to show the layout properly via this posting...

Std Code Standard Action(s) Action By
Resp
B.1.2.(a) Example text of a std which Action 1 text Date
Signature
could span approx 10 lines Action 2 text Date
Signature
Action 2 cont.

B.1.2 (b) Standard no 2 example Action 1 only Date
Signature
text


I think I got the picture. The long paragraph is in the
group header and you want the details to be to the right of
the paragraph.

If that's a correct interpretation, it's easy to get the
paragraph to the left of the details. The big problem is to
get the next paragraph below that when there are not enough
details to reach the bottom of the current paragraph.

I think that issue may be solvable, but while I try to come
up with a way to do it, you should try the easy part to make
sure I'm on the right track. Just add one line of code to
the group header section's Format event procedure:
Me.MoveLayout = False
If you don't already have it set, I think you will need to
set the group header section's KeepTogether property to Yes.
 
hughess7 said:
basically what I am reporting on is a list of standards which can have one
or more actions against them. It would look better if the standards text
appeared on the left of the report and the Actions against them appeared on
the right.

Currently the report is based on a query which has the standards repeated
for each Action found relating to it (one to many relationship). The report
is grouped so each standards text only appears once in the group header and
the Actions are in the detail section of the report, with a date and
signature box against each action.

So the result is one long paragraph of text with each Action listed
underneath. What I would like to produce if possible similar to the example
below but it is difficult to show the layout properly via this posting...

Std Code Standard Action(s) Action By
Resp
B.1.2.(a) Example text of a std which Action 1 text Date
Signature
could span approx 10 lines Action 2 text Date
Signature
Action 2 cont.

B.1.2 (b) Standard no 2 example Action 1 only Date
Signature
text


I think I got the picture. The long paragraph is in the
group header and you want the details to be to the right of
the paragraph.

If that's a correct interpretation, it's easy to get the
paragraph to the left of the details. The big problem is to
get the next paragraph below that when there are not enough
details to reach the bottom of the current paragraph.

I think that issue may be solvable, but while I try to come
up with a way to do it, you should try the easy part to make
sure I'm on the right track. Just add one line of code to
the group header section's Format event procedure:
Me.MoveLayout = False
If you don't already have it set, I think you will need to
set the group header section's KeepTogether property to Yes.
 
Thanks Marsh, yes that worked with the Actions now displayed to the right of
the Standards text, but as you suspected the Standards text for row 2 etc do
not display properly as they are all squashed up...
 
Thanks Marsh, yes that worked with the Actions now displayed to the right of
the Standards text, but as you suspected the Standards text for row 2 etc do
not display properly as they are all squashed up...
 
hughess7 said:
Thanks Marsh, yes that worked with the Actions now displayed to the right of
the Standards text, but as you suspected the Standards text for row 2 etc do
not display properly as they are all squashed up...


OK, this seems to work.

First, we need to know when the last detail in a group is
being formatted. This is done by adding a text box (named
txtDtlCnt) to the group header section. Set its control
source to =Count(*) so we know how many details are in the
group.

Then add a text box (named txtLine) to the detail section.
Set its control source to =1 and its RunningSum property to
Over Group so we have an identifier in each detail. When
txtLine equals txtDtlCnt, the last detail is being
formatted.

We also need to add another text box (named txtHdrBottom) to
the group header section and leave its control source empty.
This one is used as a place to remember how tall the group
header was after it was formatted.

Now you can use this code to manage the whole mess.

Private Sub Detail_Format( . . .
If Me.txtLine = Me.txtDtlCnt Then 'last detail?
If Me.Top + Me.Height < Me.txtHdrBottom Then
'adjust detail height to reach bottom of the header
Me.Section(0).Height = Me.txtHdrBottom - Me.Top
End If
End If
End Sub

Private Sub GroupHeader0_Format( . . .
Me.MoveLayout = False 'put details on top of header
Me.Section(0).Height = 0 'reset detail height
End Sub

Private Sub GroupHeader0_Print( . . .
Me.txtHdrBottom = Me.Top + Me.Height
End Sub

I think you will like it more if the group header section's
KeepTogether property is set to Yes.
 
hughess7 said:
Thanks Marsh, yes that worked with the Actions now displayed to the right of
the Standards text, but as you suspected the Standards text for row 2 etc do
not display properly as they are all squashed up...


OK, this seems to work.

First, we need to know when the last detail in a group is
being formatted. This is done by adding a text box (named
txtDtlCnt) to the group header section. Set its control
source to =Count(*) so we know how many details are in the
group.

Then add a text box (named txtLine) to the detail section.
Set its control source to =1 and its RunningSum property to
Over Group so we have an identifier in each detail. When
txtLine equals txtDtlCnt, the last detail is being
formatted.

We also need to add another text box (named txtHdrBottom) to
the group header section and leave its control source empty.
This one is used as a place to remember how tall the group
header was after it was formatted.

Now you can use this code to manage the whole mess.

Private Sub Detail_Format( . . .
If Me.txtLine = Me.txtDtlCnt Then 'last detail?
If Me.Top + Me.Height < Me.txtHdrBottom Then
'adjust detail height to reach bottom of the header
Me.Section(0).Height = Me.txtHdrBottom - Me.Top
End If
End If
End Sub

Private Sub GroupHeader0_Format( . . .
Me.MoveLayout = False 'put details on top of header
Me.Section(0).Height = 0 'reset detail height
End Sub

Private Sub GroupHeader0_Print( . . .
Me.txtHdrBottom = Me.Top + Me.Height
End Sub

I think you will like it more if the group header section's
KeepTogether property is set to Yes.
 
Hi Marsh

Thanks for trying to get this working for me! This doesn't work but it might
be because my layout is slightly different to this in that I don't have
anything in the detail section of the report. The query has duplicate issue
codes against different claim numbers on the current review. So to get all
the Issues (Actions) listed only once against the standard I also group on
the Issues so they actually appear in an Issue header and not the detail
section. Would this make a difference to your code?

Sue
 
hughess7 said:
Thanks for trying to get this working for me! This doesn't work but it might
be because my layout is slightly different to this in that I don't have
anything in the detail section of the report. The query has duplicate issue
codes against different claim numbers on the current review. So to get all
the Issues (Actions) listed only once against the standard I also group on
the Issues so they actually appear in an Issue header and not the detail
section. Would this make a difference to your code?


Yes, that prevents the whole thing because we can not
determine the number of issues before processing the issues.

I think the only way out of it is to consolidate the issues
in the report's record source query. That may(?) be as easy
as setting the query's Unique Records property to Yes. If
you can figure out how get the data out of the issues header
and into the detail section, my idea should work.
 
Thanks Marsh

You are right it would work thanks, changing the query to Unique Values=Yes
and moving the Issues to the Detail sections means I can see the Issues
(Actions) on the left hand side now. The only other slight problem is I still
have two group headings - the first being the Standards Category each
standard belongs to. The Actions are now lined up at the top of the Category
group section instead of the standards sections. I will try playing with this
some more tomorrow thanks...

Sue
 
Back
Top