SubReport on Main Report Page Footer - Didnt think it would be so hard.

  • Thread starter Thread starter eligur
  • Start date Start date
E

eligur

Hi everyone,
I have been searching 3 days stright for an answer, with no luck, so I
decided to ask it out loud myself.

Here is my problem.
I am using a report as a catalog for my company. The main report holds
our products with details (each detail is a product based on our
products table). Some of the products show up twice on the main report
(as they have diffrent specifications per line). I thought that instead
of putting the products picture on each line, save space on the page
and put all pictures of all products on the page, as a subreport on the
main reports Footer.
This way I can put only one picture of every product, even if it shows
twice on the main report.
I have wrote some code, that adds the productID to a temp table (code
using the Details Format event of the main report), and then based my
subreport grouping on that table.
I have thought the subreport requeries its recordsource on every page,
and by that will always take the products from the temp table, that
changes on every page.
I cannot get this to print out correctly, and trying to understand if I
am even thinking in the right direction at all.
Is there another way to print pictures of items on the bottom of the
page , which takes the picture name from the all the details on the
report??

Will update if I find anything new, hope someone can help.

Thanks in advance
Eli
 
I am using a report as a catalog for my company. The main report holds
our products with details (each detail is a product based on our
products table). Some of the products show up twice on the main report
(as they have diffrent specifications per line). I thought that instead
of putting the products picture on each line, save space on the page
and put all pictures of all products on the page, as a subreport on the
main reports Footer.
This way I can put only one picture of every product, even if it shows
twice on the main report.
I have wrote some code, that adds the productID to a temp table (code
using the Details Format event of the main report), and then based my
subreport grouping on that table.
I have thought the subreport requeries its recordsource on every page,
and by that will always take the products from the temp table, that
changes on every page.
I cannot get this to print out correctly, and trying to understand if I
am even thinking in the right direction at all.
Is there another way to print pictures of items on the bottom of the
page , which takes the picture name from the all the details on the
report??


I don't think you're going to get much help with this
situation. First, the PAGE footer section can not
grow/shrink, so you have to provide space for the maximum
possible number of pictures regardless of whether you
display all the pictures or not. Putting the pictures in a
subreport that you display in the main report's page footer
will not make any difference.

Another serious roadblock is that a subreport's record
source is determined the first time the subreport appears so
you can not expect to change the subreport data on the fly.
The only control you have is the subreport control's Link
Master/Child properties and I don't see how you can use that
to do what you want.

If you'll provide more details about your report, someone
may be able to come up with another way to avoid displaying
a picture multiple times.
 
Hi Marsh,
I understand all problems , on why a sub report should not be used
here. I still have no answer to my problem. Let me give you alittle
more details about my report (catalog).
This report is based on a "catalog" table. In that table, I have all my
products, with their number, and the car application they go to (my
products are for automotives).
A product can be in 2 diffrent cars, and will have 2 records in the
catalog (or more).
This is where my problem begins. When I print the report, I need the
main report to group and sort by the following : "Car Make" , "Car
Model", "Car Liters" .
So a page on my report can look something like this :

Ford
Forcus
2 Liter
Product number 1154 - Front Left
Product number 1156 - Front Right

2.5 Liters
Product number 1154 - Front Left
Product number 1157 - Front Right

EXPLORER

etc.
etc.

Up to here all is fine, but I would like at the bottom of the page, or
at the side, print the pictures of all products on the page. I do not
want product 1154 to be printed twice, and so I cannot put the pictures
under the "liters" grouping.
I know , I cannot guess how many products will be on any given page,
but as I know the maximum will not be more then 10, I can decide to
leave the amount of space needed for 10 on every page (pictures will
not be big, and will not take so much rooom).

Thanks in advance

Eli
 
I understand all problems , on why a sub report should not be used
here. I still have no answer to my problem. Let me give you alittle
more details about my report (catalog).
This report is based on a "catalog" table. In that table, I have all my
products, with their number, and the car application they go to (my
products are for automotives).
A product can be in 2 diffrent cars, and will have 2 records in the
catalog (or more).
This is where my problem begins. When I print the report, I need the
main report to group and sort by the following : "Car Make" , "Car
Model", "Car Liters" .
So a page on my report can look something like this :

Ford
Forcus
2 Liter
Product number 1154 - Front Left
Product number 1156 - Front Right

2.5 Liters
Product number 1154 - Front Left
Product number 1157 - Front Right

EXPLORER

etc.
etc.

Up to here all is fine, but I would like at the bottom of the page, or
at the side, print the pictures of all products on the page. I do not
want product 1154 to be printed twice, and so I cannot put the pictures
under the "liters" grouping.
I know , I cannot guess how many products will be on any given page,
but as I know the maximum will not be more then 10, I can decide to
leave the amount of space needed for 10 on every page (pictures will
not be big, and will not take so much rooom).


Let's try this if you have enough room in the page footer
section for all 10 pictures (and you absolutely certain
there will never be more than 10 on a page).

Create the 10 image controls in the page footer section and
name them img1, img2, . . . img10.

Use the page header section's Format event to clear the
Picture property of all the image controls:

Dim k As Integer
For k = 1 To 10
Me("img" & k).Picture = ""
Next k

Now add code to the detail section's Format event to set the
picture if it hasn't been set before:

Dim k As Integer
For k = 1 To 10
With Me.Controls("img" & k)
If .Picture = Me!picturepathfield Then
Exit For 'already set
ElseIf .Picture = "" Then
.Picture = Me!picturepathfield
Exit For
End If
End With
Next k

I don't work with very many images, so I hope I got that
straight.
 
Back
Top