Link to home
Start Free TrialLog in
Avatar of gaynes
gaynes

asked on

Size OLE in report like CanGrow

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!
Avatar of harfang
harfang
Flag of Switzerland image

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°)
Avatar of gaynes
gaynes

ASKER

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.
Avatar of Jeffrey Coachman
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
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°)
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
Avatar of gaynes

ASKER

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.
<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
Avatar of gaynes

ASKER

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?
I'll post it tonight.
Avatar of gaynes

ASKER

ok - I am going to the client's office at 1 central
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:-(

Nobody says "Thanks" anymore...
Avatar of gaynes

ASKER

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!!
This was actually an interesting question
Avatar of gaynes

ASKER

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.
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
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.