Skip to main content
Participant
May 22, 2014
Answered

Shrink to Fit Text - ColdFusion Report Builder

  • May 22, 2014
  • 1 reply
  • 1290 views

In ColdFusion Report Builder, is there a way to shrink text to fit a particular area? (as opposed to stretching with overflow)

Any help would be greatly appreciated!

- Chris

This topic has been closed for replies.
Correct answer cam-chris

I did find another solution that does work relatively well.  I added multiple fields for the one field on the report, having each of these fields on the report using a different font size.  For each of these fields, I applied print conditions to assess the width (in pixels) of the text as an image.  Based on the width of the image, the correct field with the font-size is used and all the text is within the particular area.  This results with the desired effect.

For example, if the width of the text as an image is 383.73 pixels, the print condition where the font size is 26 is used.

Width of Text in Pixels
Greather Than or Equal ToLess Than or Equal ToFont Size
0.00374.9928
375.00399.9926
400.00429.9924
430.00469.9922
470.00509.9920
510.00579.9918

1 reply

EddieLotter
Inspiring
May 27, 2014

cam-chris wrote:

In ColdFusion Report Builder, is there a way to shrink text to fit a particular area? (as opposed to stretching with overflow)

Unfortunately not. The "Stretch with overflow" property is a grow-only setting. There is no equivalent property to do the opposite.

What scenario are you trying to deal with? There may be other solutions.

cam-chrisAuthorCorrect answer
Participant
May 27, 2014

I did find another solution that does work relatively well.  I added multiple fields for the one field on the report, having each of these fields on the report using a different font size.  For each of these fields, I applied print conditions to assess the width (in pixels) of the text as an image.  Based on the width of the image, the correct field with the font-size is used and all the text is within the particular area.  This results with the desired effect.

For example, if the width of the text as an image is 383.73 pixels, the print condition where the font size is 26 is used.

Width of Text in Pixels
Greather Than or Equal ToLess Than or Equal ToFont Size
0.00374.9928
375.00399.9926
400.00429.9924
430.00469.9922
470.00509.9920
510.00579.9918
EddieLotter
Inspiring
May 27, 2014

Nice.

Thanks for posting your solution.