Connecting Tech Pros Worldwide Help | Site Map

How to sense when a label is full?

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 06:09 PM
(Pete Cresswell)
Guest
 
Posts: n/a
Default How to sense when a label is full?

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, 06:10 PM
Stephen Lebans
Guest
 
Posts: n/a
Default 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, 06:10 PM
PC Datasheet
Guest
 
Posts: n/a
Default 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]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.