Avoid extra space in field when "fixed" vertical elasticity is selected [message #615909] |
Wed, 11 June 2014 02:23 |
sandeepgujje
Messages: 28 Registered: January 2012 Location: India
|
Junior Member |
|
|
Hi All
Im having a report where one field displays user name in three lines.
If I use vertical elasticity as "Expand" for that user name field with out any main frame, the problem is it can extend to 4th or 5th line also, which should not happen because of the space limitation
If I kept that user name field inside a fixed main frame which is having 3 lines width, the problem is when the user name ends in second line, then an empty line is coming extra since that is inside a fixed frame
Please suggest a method to avoid the empty line when used a fixed frame
Thanks in advance
Sandy
[Updated on: Wed, 11 June 2014 02:23] Report message to a moderator
|
|
|
|
|
|
Re: Avoid extra space in field when "fixed" vertical elasticity is selected [message #615927 is a reply to message #615918] |
Wed, 11 June 2014 04:36 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
As of vertical elasticity (VE): - set field's VE to "contract"
- set frame's VE to "variable"
Works as expected (at least, for my test case).
Here's onother option (which isn't pretty at all, but ... I can't think of anything smarter now).
Suppose that your query looks like this:select id, user_name from a1_test As you are limited with space, you might separate USER_NAME into three columns, using the SUBSTR function, such as:
select id,
substr(user_name, 1, 15) name_1,
substr(user_name, 16, 15) name_2,
substr(user_name, 31, 15) name_3
from a1_test
where id = :par_id
Paper Layout:
Everything (fields & frames) have vertical elasticity set to "Variable".
Additionally, apply format trigger for the F_NAME_3 field, which will not display it if its length = 0:
function F_name_3FormatTrigger return boolean is
begin
return (:name_3 is not null);
end;
Table contents:SQL> select * From a1_test;
ID USER_NAME
---------- -----------------------------------------------------------------
1 This is a long text which exceeds length of 3 lines (max allowed)
2 Text shorter than 3 lines - shrink!
Let's try it:
As you can see, it is ugly - SUBSTR doesn't pay attention to words so it breaks a line in a stupid manner. You could write a function which takes care about it and call that function instead of SUBSTR.
On the other hand, as you use a proportional font, restricting line length doesn't have to be the best choice.
|
|
|
|
|
|