Skip to Content
0
Former Member
Apr 27, 2009 at 01:04 PM

Change text object width (or position) with record count formula

1778 Views

I am running Crystal Reports 2008 on a Business Objects 3.1 environment.

I have a textbox in a report that need to grow (width) depending on the number of records shown. I also need the position of other textboxes to change with the records returned.

The report is a cross tab, and I want to center the tittles (outside crosstab) to fit. The width change is to display a u201CSilveru201D box behind certain fields (to break up the report).

I believe I should be able to accomplish this by right clicking on the object, going to u201CSize and Positionu201D, and adding a formula to the X: position or Width. When I click on the formula editor shown in the Object Size and Position I added the following formula (for width adjustment):

If COUNT({DAILY_DISTRICT_RECAP.OFFICENUM}) = 1 then

2.529

Else If COUNT({DAILY_DISTRICT_RECAP.OFFICENUM}) = 2 then

3.745

Else If COUNT({DAILY_DISTRICT_RECAP.OFFICENUM}) = 3 then

4.961

Else If COUNT({DAILY_DISTRICT_RECAP.OFFICENUM}) = 4 then

6.176

Else If COUNT({DAILY_DISTRICT_RECAP.OFFICENUM}) = 5 then

7.392

Else

7.392

When I run the report the count of the records changes, but the width (or position) remain the same. Am I missing something?

Scott