Size OLE in report like CanGrow

gaynes
gaynes used Ask the Experts™
on
I am doing a catalog for a client. If the last page runs short, they want to put an ad on it. I have set up some OLE fields for them to paste the ad jpgs into, but since OLE onjects do not have the CanGrow property, They don't adjust. The size varies based on what space is left on the page. With a text item I could just size it all the way down and set CanGrow, but this option is not there. Is there another way sto do this, work-around, add-on? Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
As far as I know, you can't extract metrics from an OLE object. It would seem better to store images as BLOB anyway, but that's probably another matter; if OLE jpegs print fine, why not use them?

Perhaps you can provide another field or fields with the "preferred size" of each ad? So it becomes the user's responsibility to choose the best print size... You can use the format event of the section to adjust the size of the container, using the "zoom" setting.

(°v°)

Author

Commented:
I suppose I could programmatically size the report footer and the control on format. I would have them put in the size and it could use it..hmm.
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
Instead of the requirement being "If the last page runs short," which is vague, and could mean anything from 1/10th of an inch (not much room for any images there ;-)  )  ...to 10 inches.

If the specification was something like if there are less than half the records present...

Then this would be easier...

;-)

Jeff
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

I do believe that it's your best option. Especially for printing: the pixel size of a jpeg won't tell you at what size the image should be printed anyway...

(°v°)
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
Try this and let me know if it is acceptable.

Notes:
33 records will fit on a page.
If you delete more then 5 records, the image will appear.

(Again, with less than 5 missing records, the image would be to small to be displayed at a reasonable size)

Deleting more and more records will cause the image to grow to fit the empty space.
Until only one record is left on the last page, then the Image will be at it's maximum size.

Deleting this one record will cause the page count to be reduced by 1, thus, starting the cycle over.
Play around with it.

Again, let me know if this is acceptable

;-)

JeffCoachman

Access-EEQ24874532DisplayDynamic.mdb

Author

Commented:
works cool - but design view was locked on the report - how did you do it? Also, what if they have multiple ads? Would they have to do a composite ad? BTW - how did you lock the report? It's not an .mde.
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
<but design view was locked on the report>
<how did you lock the report? It's not an .mde. >
The file is an MDE file.
;-)
I simply added ".mdb" to the end of the file name.
    ( for example: DatabaseName.mde.mdb )
...But the file name gets truncated when posted here.

<what if they have multiple ads? Would they have to do a composite ad?>
Yes, what I have done will work for only one image.

(multiple ads is a new requirement, not listed in your original post.)

Just getting this to work as it stands now, was a considerable challenge.

Making this work for more than one image would require a significantly greater investment in time.

But again, AFAICT, it does meet your original requirements as stated in your original post.

If the sample is acceptable in it's present form, let me know.

;-)

JeffCoachman

Author

Commented:
It worked, but I would need the code to test it for mine. I have it in the report footer, but it should work the same. Are you willing to give me the code to try?
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
I'll post it tonight.

Author

Commented:
ok - I am going to the client's office at 1 central
MIS Liason
Most Valuable Expert 2012
Commented:
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
:-(

Nobody says "Thanks" anymore...

Author

Commented:
Sorry - Thanks! It won't actually work for this project because it has columns but it will work for others. I appreciate your hard work!!
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
;-)
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
This was actually an interesting question

Author

Commented:
I was surprised that it wasn't in another thread somewhere. Usually everything is at least basically covered. I have been doing Access development for 17 years since the program came out and it never ceases to amaze me.
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
LOL!

I have been using Access for 12 years and the amount of things I *don't * know never ceases to amaze me.

That's why I am here.

    ABL

Always Be Learning...
;-)

Jeff
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
The Report must be opened in "Print Preview"

Note that when the number of records is less than the max number of records that will fit on the page, the "Ad" image will grow to fill the un-used space.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial