Connecting Tech Pros Worldwide Help | Site Map

How to sense when a label is full?

  #1  
Old November 12th, 2005, 07:09 PM
(Pete Cresswell)
Guest
 
Posts: n/a
I'm delivering a filter-on-the-fly report to my main client.

It's a report that, as part of the Open() event, opens up a little floater
screen that lets the user choose various filtering criteria and then, when the
user clicks "Apply", concocts some SQL and applies it to the report and
documents same by loading up a label in the report's header.

Only fly in the ointment is that I don't know how big the user's filter SQL will
be and I'd like to grow/shrink the label accordingly.

Brute force would be force new lines every so often, count the lines, multiply
the line count by the height of the font and resize the control accordingly.

Is there a more legant way? I know a text box can do the CanGrow/CanShrink
thing - but a text box doesn't work in this situation because it has to be
updated while the report thinks it's printing...and that doesn't seem to be
allowed.

Is there a more elegant way than counting lines?
--
PeteCresswell
  #2  
Old November 12th, 2005, 07:10 PM
Stephen Lebans
Guest
 
Posts: n/a

re: How to sense when a label is full?


No need to count the lines Pete. See:
http://www.lebans.com/textwidth-height.htm
TextHeightWidth.zip is a replacement for the Report object's TextWidth
and TextHeight methods. It is multiline aware and can work in both
Report and Form views. Includes a sample report to show you how to
autosize individual controls with different formatting on the same line
to simulate RTF style text.

--

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


"(Pete Cresswell)" <x@y.z> wrote in message
news:9cae00drao98lc4j3h1prmns1bto3lbddu@4ax.com...[color=blue]
> I'm delivering a filter-on-the-fly report to my main client.
>
> It's a report that, as part of the Open() event, opens up a little[/color]
floater[color=blue]
> screen that lets the user choose various filtering criteria and then,[/color]
when the[color=blue]
> user clicks "Apply", concocts some SQL and applies it to the report[/color]
and[color=blue]
> documents same by loading up a label in the report's header.
>
> Only fly in the ointment is that I don't know how big the user's[/color]
filter SQL will[color=blue]
> be and I'd like to grow/shrink the label accordingly.
>
> Brute force would be force new lines every so often, count the lines,[/color]
multiply[color=blue]
> the line count by the height of the font and resize the control[/color]
accordingly.[color=blue]
>
> Is there a more legant way? I know a text box can do the[/color]
CanGrow/CanShrink[color=blue]
> thing - but a text box doesn't work in this situation because it has[/color]
to be[color=blue]
> updated while the report thinks it's printing...and that doesn't seem[/color]
to be[color=blue]
> allowed.
>
> Is there a more elegant way than counting lines?
> --
> PeteCresswell[/color]

  #3  
Old November 12th, 2005, 07:10 PM
PC Datasheet
Guest
 
Posts: n/a

re: How to sense when a label is full?


Pete,

Can you set the width and the height (in twips) of the label by the Len of the
caption?


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
resource@pcdatasheet.com
www.pcdatasheet.com


"(Pete Cresswell)" <x@y.z> wrote in message
news:9cae00drao98lc4j3h1prmns1bto3lbddu@4ax.com...[color=blue]
> I'm delivering a filter-on-the-fly report to my main client.
>
> It's a report that, as part of the Open() event, opens up a little floater
> screen that lets the user choose various filtering criteria and then, when the
> user clicks "Apply", concocts some SQL and applies it to the report and
> documents same by loading up a label in the report's header.
>
> Only fly in the ointment is that I don't know how big the user's filter SQL[/color]
will[color=blue]
> be and I'd like to grow/shrink the label accordingly.
>
> Brute force would be force new lines every so often, count the lines, multiply
> the line count by the height of the font and resize the control accordingly.
>
> Is there a more legant way? I know a text box can do the CanGrow/CanShrink
> thing - but a text box doesn't work in this situation because it has to be
> updated while the report thinks it's printing...and that doesn't seem to be
> allowed.
>
> Is there a more elegant way than counting lines?
> --
> PeteCresswell[/color]


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
File Upload - how do I get full path, or cache a reference? vol30w60 answers 2 June 27th, 2008 05:16 PM
Is this possible... Daniel answers 8 January 9th, 2006 07:05 PM
How to understand the use of namespaces ... clintonG answers 17 November 17th, 2005 11:49 AM
can't get text field to align with textarea field jlemay@alumni.princeton.edu answers 14 July 24th, 2005 12:50 AM