single line with word wrap in reports filed [message #405612] |
Thu, 28 May 2009 11:04 |
nastyjillu
Messages: 211 Registered: February 2009
|
Senior Member |
|
|
Hi,
i have a requirement.
in my report, there is a description field. that field may have value with 10 lines also.
but i want to display only one line and that too with word wrap.
if iam in the middle of the word at the end of the line, then it shouldnt display the whole word.
i didnt find any word wrap property in report fields.
i didnot find multi line 'yes/no' property also. in forms we have thse properties. not in reports.
thanks
jillu
|
|
|
|
|
Re: single line with word wrap in reports filed [message #405677 is a reply to message #405643] |
Fri, 29 May 2009 00:27 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
If you want to display only one line, set field's vertical and horizontal elasticities to "fixed". It will then truncate text that doesn't fit. Though, how can you wrap a word in a single line? If it is wrapped, it then makes at least 2 lines, not 1.
Trigger? What good would it do? A "single line" can be obtained by selecting a SUBSTRING of the text. However, if you choose proportional font (such as Arial or Times New Roman), you can't tell exactly how many letters make one line. Furthermore, it means that non-proportional font might be the right choice (such as Courier, for example).
However, someone might get another, better idea. Wait and see.
|
|
|
Re: single line with word wrap in reports filed [message #406033 is a reply to message #405677] |
Mon, 01 June 2009 18:18 |
nastyjillu
Messages: 211 Registered: February 2009
|
Senior Member |
|
|
i got an idea. i wrote a function. that will take the column_name as input. and gives the single line with word wrap as output.
lets suppose that i have only 47 chars in a horizontal line in a report. that we can easily predict. as horizontal line is fixed.
see the function below.
CREATE OR REPLACE function xxtempfunction(m in varchar2)
return varchar2 is
i number;
j varchar2(200);
k number;
l number;
begin
select length(m) into l from dual;
if l<47 then
return(m);
for i in 1..47
loop
select substr(m,i,1) into j from dual;
if j=' ' then
k:=i;
end if;
if i=47 then
if j=' ' then
select substr(m,1,i-1) into j from dual;
else
select substr(m,1,k) into j from dual;
end if;
end if;
end loop;
return(j);
end if;
end;
/
i will call this function in select query in report builder, and pass column name as input parameter. this works fine.
but this is a database function. i want to create funtion in program unit section of report builder.
if i do that, iam getting below error. my select query is as given below. XX is the funtion given above that i created in report builder.
select xx('b') from xxtemp
where a=5;
error is:
ora-00904:"XX" invalid identifier
select ==>xx('b') from xxtemp.
|
|
|
|
|
|
Re: single line with word wrap in reports filed [message #406547 is a reply to message #406434] |
Thu, 04 June 2009 09:26 |
nastyjillu
Messages: 211 Registered: February 2009
|
Senior Member |
|
|
so basically i have to create a placeholders column. for example placeholder column is c_p.
i should put this in the group where i have other columns.
and in the formula coulmn i have to assign the output of the function to this place holder right??
for example
in formula column i will write below code.
function cf return char is
begin
select xxtempfunction(b) into :c_p from table_name;
end;
is this correct??
|
|
|
Re: single line with word wrap in reports filed [message #406575 is a reply to message #406547] |
Thu, 04 June 2009 12:33 |
nastyjillu
Messages: 211 Registered: February 2009
|
Senior Member |
|
|
i got it.
i created function called xx
then created formula column called c_f, and placeholder column called cp_1
code in formula column is
function CF_1FORMULA0005 return Char is
l varchar2(2000);
begin
select c.b into l from table_a ci, table_b LA
WHERE LA.ID = :P_ID
AND LA.L_CODE = :P_CODE
AND LA.CID = CI.ID;
:cp_1:=XX(l,92);
return(:cp_1);
end;
assigned cp_q1 to the group.
this works .
have one more question. if the description is hard returned, then???????/
i would be loosing data simply.
how to get the value in next line, if it is hard returned??
for example, my desc is
the item is
valueable.preserve it
i want the whole thing in one line. as there is still empty space in the first line.
hope you understood
thanks
jillu
|
|
|
|
Re: single line with word wrap in reports filed [message #407630 is a reply to message #406595] |
Wed, 10 June 2009 19:04 |
nastyjillu
Messages: 211 Registered: February 2009
|
Senior Member |
|
|
Hi, i was wondering about why iam not able to make use of function created in report.
i created a function in the program units section of the report.
and iam using that function in the datamodel query. but it thrws below error :
ORA-00904:"XX_DSC":invalid identifier
SELECT DISTINCT(C.ID),==>
XX_DSC(C.DESC,90)
FROM C_ITMS C,L_ADDS L
XX_DSC is the function. it takes column value and a number. and returns the single line value with word wrap.
if i create the same function in the database, then the report is working fine.
why not with the report builder function??
thanks jillu
|
|
|
Re: single line with word wrap in reports filed [message #407787 is a reply to message #407630] |
Thu, 11 June 2009 10:47 |
nastyjillu
Messages: 211 Registered: February 2009
|
Senior Member |
|
|
i got the solution in metalink
[B]ORA-00904 Error When Try To Call Local Function In Report SQL Query[/B]
[B]Cause[/B]
The only things you can reference in a SQL query are columns and functions accessible in the
database (since this is where the query is executed).
[B]Solution[/B]
You need to create the function in the database.
thanks
jillu
|
|
|
|
|