|
|
|
|
|
|
Re: Printing tab character [message #653375 is a reply to message #653371] |
Mon, 04 July 2016 04:59 |
cookiemonster
Messages: 13925 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Tab is in a sense a variable number of spaces (and even that's a simplification):
SQL> select '1)' ||chr(9) || 'Test' as text, 'tab' as type from dual
union all
select '1)' || lpad(' ', 6) || 'Test', 'spaces' from dual; 2 3
TEXT TYPE
------------ ------
1) Test tab
1) Test spaces
SQL> select '11)' ||chr(9) || 'Test' as text, 'tab' as type from dual
union all
select '11)' || lpad(' ', 6) || 'Test', 'spaces' from dual; 2 3
TEXT TYPE
------------- ------
11) Test tab
11) Test spaces
And that's with a fixed width font in sqlplus. What happens with a variable width font?
|
|
|
|
Re: Printing tab character [message #653397 is a reply to message #653396] |
Mon, 04 July 2016 11:02 |
cookiemonster
Messages: 13925 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Again, the output will only be correct if you use a fixed width font. Otherwise there is zero guarantee you can make spaces take the same space a tab would.
Unfortunately I have no idea why the tab isn't working
|
|
|
Re: Printing tab character [message #653405 is a reply to message #653397] |
Mon, 04 July 2016 15:00 |
|
Littlefoot
Messages: 21811 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Right; screenshot suggests Arial or Tahoma or similar proportional font. I'm not saying that Hashmi should try to find number of spaces which would look exactly as a TAB character. It would be OK if he sets, say, 10 Arial spaces at the beginning of each paragraph. These 10 spaces would still be 10 spaces in the second paragraph as well as in the third etc.
So, LF, don't be lazy, if you can't explain it with words, *show* it. So here you go: I created a table with two columns:create table test
(par number,
text varchar2(4000)); and inserted 3 paragraphs. Then I created a report whose query looks like this:select
par || ')' || lpad(' ', 10) || text value
from test
order by par As you can see, I concatenated 10 spaces. The result:
See the yellow markings? Indentation is just the same, and I didn't use non-proportional font (such as Courier). If I did, the result would still be the same (although - obviously - looking differently):
I believe it doesn't really matter whether indentation equals 0.8 cm or 1.3 cm. If it does, you'd have to try several options until you find the closest one.
I hope I managed to make the point. If not, oh well, I can't do any better, sorry.
P.S. TAB doesn't work for me either (Oracle 11g, Reports Builder 10g).
|
|
|
|
Re: Printing tab character [message #653422 is a reply to message #653406] |
Tue, 05 July 2016 03:29 |
cookiemonster
Messages: 13925 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
What you've got to think about is if there are 10 paragraphs. Numbers take the same space in most fonts so if you follow number) by a fixed number of spaces the text after that will always align. But spaces aren't the same width as numbers, so just taking a space off of the 10 line won't make it align with the 9 line.
|
|
|
|
Re: Printing tab character [message #653453 is a reply to message #653445] |
Wed, 06 July 2016 03:18 |
cookiemonster
Messages: 13925 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
I think the problem is that tab is something the display program has to have code to handle, since it doesn't have a fixed width and different programs give different levels of indentation. Just spotted that PL/SQL developer displays them as spaces but if you copy and paste into something else the tab is treated as a tab.
If you output the report as pdf I'd be very suprised if the tab didn't display properly.
|
|
|
|
|
|
|
|