Variable row heights in BusObj

I’m using BusObj 4.1.3 on NT and I have a report as follows:


Listserv Archives (BOB member since 2002-06-25)

I don’t think you can do this in BO (like you can in Excel). I can conceive
of a workaround … but you probably won’t like it…

Assume that the comment field has a maximum width of, say, 30. But you want
the column in your report to have a width of 10.

Instead of only having one object in your universe called “Comment”, split
it into three objects, “Comment Line 1”, “Comment Line 2” and “Comment Line
3”:

    Comment Line 1 = substr( Comment, 1, 10 );
    Comment Line 2 = substr( Comment, 11, 10 ) WHERE length( Comment ) >

10;
Comment Line 3 = substr( Comment, 21, 10 ) WHERE length( Comment ) >
20;

The WHEREs are important.

Now, instead of building your query with the result objects Title and
Comment, build three queries UNIONed together, the first on Title and
Comment Line 1, the second on Title and Comment Line 2, the third on Title
and Comment Line 3.

The SQL would look something like this:

    SELECT TITLE, substr( Comment, 1, 10 )
    FROM TABLE
    UNION ALL
    SELECT TITLE, substr( Comment, 11, 10 )
    FROM TABLE
    WHERE length( Comment ) > 10
    UNION ALL
    SELECT TITLE, substr( Comment, 21, 10 )
    FROM TABLE
    WHERE length( Comment ) > 20

If you have two records in your table,

    Title = 'Title One'
    Comment = 'Good.'

    Title = 'Title Two'
    Comment = 'This title needs much work.'

Your query will return the following results:

    Title One   Good.
    Title Two       This title
    Title Two        needs muc
    Title Two       h work.

(You can tweak the substr functions above to do word wrapping if necessary,
but it would be REALLY ugly…)

The WHEREs are necessary, because if you don’t have them, the second and
third subqueries will ALSO return a row for Title One with null comments,
and you don’t want that.

Of course, the WHEREs mean you can’t include Comment Line 1, 2, and 3 in the
same query. If you do, you will ONLY retrieve rows where length( Comment )

20:

    SELECT TITLE, substr( Comment, 1, 10 ), substr( Comment, 11, 10 ),
    substr( Comment, 21, 10 )
    FROM TABLE
    WHERE length( Comment ) > 10 AND length( Comment ) > 20

Because of this, I would suggest implementing these as User Objects, not as
“real” objects in the universe.

I told you you probably wouldn’t like this!

Maybe someone else has a cleaner way of doing this…


Erich Hurst
Compaq Computer Corporation

“It is so easy to break eggs without making omlettes.” – C.S. Lewis


Listserv Archives (BOB member since 2002-06-25)

I need each row to size itself to a the height necessary to fit
the full comment text. The longest comments requires a third of a page
row height, so I cannot make every row that size.

James,

I don’t know how much you simplified the report, so this may not be
an option.

Try this approach:
-Set the comment as section master.
-Rearrange the sorts so the automatic sort on comment is gone
(this may take temporarily placing cells in de section area).
-Set the wrap on in the section master.
-Align the master cell so it is right to the table block i.s.o.
above and insert a cell above it to hold the title.

It will give you some whitespace because of the sections,
but you will not loose as many space as when sizing all comments
alike.

Good luck,
Marianne Wagt


Listserv Archives (BOB member since 2002-06-25)