Resizing 'details' section per row

P

Philip

I'm trying to produce a report whose 'detail' section may
vary in height between one record and the next. The
report is based upon a query which contains an OLE
image. The query also contains the display height and
width of the image. I am currently trying to set the
height (and width) of the OLE control via the 'OnFormat'
event associated with the 'Detail' section (eg
Me.OLEfield.Height = Me!DisplayHeight * intTwipsPerCm).
The problem is that the 'detail' section height for the
entire report is set to the maximum height used for any
given record. I've set 'Can Grow' and 'Can Shrink'
to 'Yes' to no avail. I want the section height to vary
(as if 'Can Grow' normally behaves).
 
R

Rick Brandt

Philip said:
I'm trying to produce a report whose 'detail' section may
vary in height between one record and the next. The
report is based upon a query which contains an OLE
image. The query also contains the display height and
width of the image. I am currently trying to set the
height (and width) of the OLE control via the 'OnFormat'
event associated with the 'Detail' section (eg
Me.OLEfield.Height = Me!DisplayHeight * intTwipsPerCm).
The problem is that the 'detail' section height for the
entire report is set to the maximum height used for any
given record. I've set 'Can Grow' and 'Can Shrink'
to 'Yes' to no avail. I want the section height to vary
(as if 'Can Grow' normally behaves).

You might be able to fudge this by including in your query an expression that has a
variable number of characters in it that is dependent on the size of the image. Then
place a control on the report that is only a character wide with CanGrow enabled.
This should cause the detail section to expand and shrink accordingly. You will just
need to experiment with a font size and multiplier factor that will cause the growth
to correspond correctly with the image size.
 
P

Philip

Thanks Stephen that was great - however... whilst your VB
knowledge is superior to mine (!), I think that your
suggestion still doesn't appear to resize the height of
the 'Detail' section on the report. I am able to resize
the OLE control, but the section height is constant
through-out the report and is set to the MAXIMUM height
encountered for a given record (ie it leaves big blank
spaces even when the OLE control is small). Any other
ideas.
Regards,
Philip
 
S

Stephen Lebans

Philip the A2K version of AutosizeOLE works properly. The source code
comments for A97 explain that only A2K or higher allow you to reset the
height of the Detail section within it's FOrmat event.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
P

Philip

Thanks very much for rapid response. I'll try your
suggestion under A2K at home this evening.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top