Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field that can grow

Status
Not open for further replies.

bucket28

IS-IT--Management
Jul 8, 2002
10
US
I have a reort setup that shows pcs currently on hand, a min, a warning level and a max.
I need a report that will visualy show we need to produce parts based on the set levels.
Is there a way to set a formula to a field width....I have the formulas I just dont know where to use them.

I know this sounds wierd...Basically I need a field of some sort that will grow based on the onhand quantity then will change color based on the min max levels.

Thanks
 
Bucket,

By "field width" you mean you want the field to grow left to right say as opposed to using the "Can Grow" formatting which would allow your field to expand downward?

 
Yes I want the field to grow left to right.
 
Bucket,

This may be very crude and perhaps others will have better suggestions, but here goes.

I created a text box with size and position x 0.00 y 0.60 h 0.15 w 0.50 to represent blocks of 5 pc's. I then put the following formulas in the format fields that apply:
(Note: I used a variable in a formula to represent the number of PC's on hand, you would use the actual field or summary)
Code:
Format field\Border\top\x-2
-------------------------------
Local NumberVar Incr:=5;
IIF({@PC's on Hand} >= Incr,1,0)

Format field\Border\bottom\x-2
-------------------------------
Local NumberVar Incr:=5;
IIF({@PC's on Hand} >= Incr,1,0)

Format field\Border\Background\x-2
-------------------------------
Local NumberVar Incr:=5;
IIF({@PC's on Hand} >= Incr,crBlue,crNoColor)

I then copied this text box 5 more times and place each one right next to the other on the right and adjusting the NumberVar Incr by 5 for each one. I don't know what the sensativity of your numbers needs to be or if there is some minimum value (250 for example) that you would start at and increment by whatever you needed.

Hopefully this is a start in the right direction for you.

Lloyd
 
Bucket,

I've come up with an alternate solution that would give you much more precise results however you will be limited by the number of characters that can be displayed across your page. That being said here goes:
Code:
Create this formula
//{@PCsOnHandBar}
StringVar PCsBar := ReplicateString ("I",{table.NoPCs});
PCsBar

IF you have to maintain a "floor" or minimum number of PC's on hand you can modify the above formula like this

//{@PCsOnHandBar} (Modified for floor of 25 PC's)
StringVar PCsBar := ReplicateString ("I",IIF({table.NoPCs}<25,25,{table.NoPCs}));
PCsBar

Additionally if you want to set the starting point to something other than zero you could modify the formula like this

//{@PCsOnHandBar} (Modified for 25 = 0 display of PC's)
StringVar PCsBar := ReplicateString ("I",IIF({table.NoPCs}<=25,0,{table.NoPCs}-25));
PCsBar

Then you need to place this formula in your report, make the field the width of the entire page and format it with single borders all around (top, bottom, left, right) and check the "tight horizontal" check box. Make the font color and border color the same and you will get the effect of a bar that expands to the right for the number of "I" characters which is set by your table value of number of PC's.

Hope this is helpful,
Lloyd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top