Home » Developer & Programmer » Reports & Discoverer » Report 11g and Bullet List (Report builder 11g)
Report 11g and Bullet List [message #585374] Fri, 24 May 2013 07:38 Go to next message
neimad
Messages: 13
Registered: April 2013
Location: Canada
Junior Member
Hi,

I'm coming here to get help about Report Builder.

I need to create bullet list on a report.
I use BBCode tag to define my bullet list inside a paragraph

  • Hello
  • Foobar


my report are PDF Format with type CACHE

like here we use [|LIST] to define a list
on OTN Oracle Forum someone told me a soluce about html output, but i prefer to stay with PDF format.

thanks for your help.
Re: Report 11g and Bullet List [message #585376 is a reply to message #585374] Fri, 24 May 2013 07:50 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Try to concatenate bullet character with the rest of text, for example:
SQL> with text as
  2    (select 'Hello' col from dual union
  3     select 'Foobar' from dual
  4    )
  5  select chr(42) ||' '|| col result
  6  from text;

RESULT
--------
* Foobar
* Hello

SQL>

What is CHR(bullet character)? No idea, try with any variation of
SQL> select level, chr(level)
  2  from dual
  3  connect by level <= 255;

     LEVEL C
---------- -
         1 ☺
         2 ☻
         3 ♥
         4 ♦
         5 ♣
         6 ♠
         7
         8
         9
        10
        11 ♂
        12 ♀
        13
        14 ♫
        15 ☼
        16 ►
...
Re: Report 11g and Bullet List [message #585385 is a reply to message #585376] Fri, 24 May 2013 09:53 Go to previous messageGo to next message
neimad
Messages: 13
Registered: April 2013
Location: Canada
Junior Member
Thanks for your reply. It's helping a lot.

is it possible to have space if the bullet list have more than one line?
Like :
* sdfjasklfjsaldfjaslfddas
  sjdfkasjdflasfjdasklfjaslf

* sdfjsladfj

can we do that? i can add space like a tab key to have space before the DOT but i want to align text for not going back on another line.

thanks

[EDITED by LF: applied [code] tags]

[Updated on: Fri, 24 May 2013 13:52] by Moderator

Report message to a moderator

Re: Report 11g and Bullet List [message #585402 is a reply to message #585385] Fri, 24 May 2013 11:23 Go to previous messageGo to next message
neimad
Messages: 13
Registered: April 2013
Location: Canada
Junior Member
Hi again,

I have tryed this
CURSOR CUR_Liste IS
  select chr(42) ||'    '|| V_listText
	from dual;


inside my function, but i get error.

The reason i use cursor, is because i manage my BBCode inside a function.
if i see text in my paragraph with [|LIST] i call the function and return the new string.

someone have idea how i can use the query with a CURSOR or any other way?

thanks
Re: Report 11g and Bullet List [message #585404 is a reply to message #585402] Fri, 24 May 2013 14:14 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
"Bullets" I suggested just pretend to be bullets; I don't know whether you can apply such a formatting in Reports. Actually, maybe 11g supports something like that, but I don't use that version. As far as I can tell (for Reports 10g), even if you copy/paste formatted text (with bullets) from, say, MS Word into Reports, only the first line will be properly formatted - the rest will begin from the beginning of the line, i.e. no indentation.

What you could do is a function (just as you tried to). It would be kind of simpler if you used a non-proportional font (such as Courier New) because you could calculate number of letters you accept in every line. Proportional fonts are tricky because you can't tell how long will a line be (MWX take much more space than ijl). However, you might try it, test and adjust, based on what you see on the screen.

A function would split text you select into substrings (obviously, using the SUBSTR function). Here's an example (not too pretty, but I hope you'll get the idea):
SQL> create or replace function f_split (par_col in varchar2)
  2    return varchar2
  3  is
  4    retval varchar2(1000);
  5  begin
  6    for i in 0 .. length(par_col) / 50 loop
  7      retval := retval ||
  8                case when i = 0 then '*  '
  9                     else            '   '
 10                end ||
 11                substr(par_col, 50 * i, 50) || ' '|| chr(10);
 12    end loop;
 13    return (retval);
 14  end f_split;
 15  /

Function created.

SQL> with test as
  2    (select 1 id,
  3       'Back to the Future is a 1985 American science fiction adventurecomedy film.' ||
  4       ' It was directed by Robert Zemeckis, produced by Steven Spielberg, and stars' col
  5       from dual
  6     union
  7     select 2,
  8       ' Michael J. Fox, Christopher Lloyd, Lea Thompson and Crispin Glover'
  9      from dual
 10     union
 11     select 3,
 12       'The film tells the story of Marty McFly' col
 13      from dual
 14    )
 15  select f_split(col)
 16  from test
 17  order by id;

F_SPLIT(COL)
--------------------------------------------------------------------------------
*  Back to the Future is a 1985 American science fict
   tion adventurecomedy film. It was directed by Robe
   rt Zemeckis, produced by Steven Spielberg, and sta
   rs

*   Michael J. Fox, Christopher Lloyd, Lea Thompson a
   and Crispin Glover

*  The film tells the story of Marty McFly



SQL>

[Updated on: Fri, 24 May 2013 14:15]

Report message to a moderator

Re: Report 11g and Bullet List [message #585405 is a reply to message #585404] Fri, 24 May 2013 14:17 Go to previous message
neimad
Messages: 13
Registered: April 2013
Location: Canada
Junior Member
wow, thanks for your help. i never expected about that!

[Updated on: Fri, 24 May 2013 14:23]

Report message to a moderator

Previous Topic: Masking number to word
Next Topic: Difference between formula column and function in program unit.
Goto Forum:
  


Current Time: Fri Mar 29 06:15:43 CDT 2024