Focal Point
[SOLVED] Word Break in Heading Element

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4257007695

January 10, 2011, 04:14 AM
Ramkumar - Webfous
[SOLVED] Word Break in Heading Element
Is it possible to have a Word Break in a Heading element...

HEADING
"PERIOD,1"

My reqmnt is to get Period in the first line and 1 in the Second line.

I cant go for Two seperate lines of Heading because, In Excel It will look Odd on Two Seperate cells. I want the Period
1 in the Same cell.

How to do this ?

This message has been edited. Last edited by: Kerry,


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
January 10, 2011, 08:14 AM
GamP
I tried it like this:
DEFINE FILE CAR
BR/A4='<BR>';
END

TABLE FILE CAR
HEADING
"Heading<BR>LINE<BR>1"
SUM   SEATS
BY COUNTRY BY CAR
ON TABLE PCHOLD FORMAT EXL2K
END
Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 7 - IE11.
in Focus since 1988
January 10, 2011, 10:35 AM
Ramkumar - Webfous
quote:
LINE
1


Hi Gamp,

Thank you very much for the Suggestion. But It does not work properly with Subheads....

DEFINE FILE CAR
BR/A4='<BR>';
END

TABLE FILE CAR
SUM   SEATS
BY COUNTRY BY CAR
ON COUNTRY SUBHEAD
"<+0>Hiii<+0>LINE<BR>1<+0>"
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=LANDSCAPE,
$
TYPE=REPORT, HEADALIGN=BODY,  GRID=OFF,$

TYPE=SUBHEAD, BY=COUNTRY, LINE=1,  OBJECT=TEXT,     ITEM=1,     JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
TYPE=SUBHEAD, BY=COUNTRY, LINE=1,  OBJECT=TEXT,     ITEM=2,     COLOR = RED, JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
TYPE=SUBHEAD, BY=COUNTRY, LINE=1,  OBJECT=FIELD,     ITEM=2,     JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$


END  


The Output comes something like below....





My Requirement is like Line and 1 should come in the same cell... One below other.... This is going to act as Column Title.

HEADALIGN=BODY, is the one that creates problem here....

any Clue on this ?


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
January 10, 2011, 12:44 PM
<JG>
quote:
HEADALIGN=BODY,

Nail on the head as they say.

For what you want, you need to use a template/macro to insert a formula into the cell
that looks something like "Line" & Chr(10) & " 1" (basically, type into the formula bar "text" Alt/CR "text")

Basically a lot of work for a minor cosmetic issue.

I vote for multi line.
January 10, 2011, 03:20 PM
Francis Mariani
Try this, though you will have to revise the style sheet:

-SET &ECHO=ALL;

-DEFAULT &OUTPUT = 'EXL2K';

DEFINE FILE CAR
LINE_BREAK/A11 = IF '&OUTPUT' EQ 'HTML' THEN 'LINE<br />1' ELSE 'LINE 1';
END
-RUN

TABLE FILE CAR
SUM
SEATS

BY COUNTRY 
BY CAR

ON COUNTRY SUBHEAD
"<+0>Hiii<+0><LINE_BREAK><+0>"

ON TABLE PCHOLD FORMAT &OUTPUT

ON TABLE SET STYLE *

UNITS=IN, SQUEEZE=ON, ORIENTATION=LANDSCAPE, $

TYPE=REPORT, HEADALIGN=BODY,  GRID=OFF,$

TYPE=SUBHEAD, BY=COUNTRY, LINE=1,  OBJECT=TEXT,     ITEM=1,     JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
TYPE=SUBHEAD, BY=COUNTRY, LINE=1,  OBJECT=TEXT,     ITEM=2,     COLOR = RED, JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
TYPE=SUBHEAD, BY=COUNTRY, LINE=1,  OBJECT=FIELD,     ITEM=2,     JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
END  
-RUN



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 10, 2011, 03:22 PM
Dan Satchell
One option is to use a background color to eliminate the grid in the SUBHEAD. This allows you to place the SUBHEAD on two or more lines. Just a thought ...

TABLE FILE CAR
 SUM SEATS
 BY COUNTRY
 BY CAR
 ON COUNTRY SUBHEAD
  " <+0>LINE<+0> "
  "Hiii<+0>1<+0>Biii"
 ON TABLE SET STYLE *
  UNITS=IN, SQUEEZE=ON, ORIENTATION=LANDSCAPE, $
  TYPE=SUBHEAD, JUSTIFY=LEFT, SIZE=10, STYLE=BOLD, HEADALIGN=BODY, BACKCOLOR=LIGHT BLUE, $
  TYPE=SUBHEAD, OBJECT=TEXT, ITEM=2, COLOR=RED, $
 ENDSTYLE
 ON TABLE PCHOLD FORMAT EXL2K
END  



WebFOCUS 7.7.05
January 10, 2011, 03:37 PM
Waz
How about going back to the traditional way of breaking a line.
</n>


TABLE FILE CAR
SUM   SEATS
BY COUNTRY BY CAR
ON COUNTRY SUBHEAD
"Hiii</1>LINE</1>"
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=LANDSCAPE,
$
TYPE=REPORT, HEADALIGN=BODY,  GRID=OFF,$

TYPE=SUBHEAD, BY=COUNTRY, LINE=1,  OBJECT=TEXT,     ITEM=1,     JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
TYPE=SUBHEAD, BY=COUNTRY, LINE=1,  OBJECT=TEXT,     ITEM=2,     COLOR = RED, JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
TYPE=SUBHEAD, BY=COUNTRY, LINE=1,  OBJECT=FIELD,     ITEM=2,     JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
END



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

January 10, 2011, 05:16 PM
<JG>
quote:
I cant go for Two seperate lines of Heading because, In Excel It will look Odd on Two Seperate cells. I want the Period
1 in the Same cell.


Macro, or as I said "I vote for multi line."
January 10, 2011, 05:24 PM
Waz
Oops, I should have read more carefully. Frowner


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

January 11, 2011, 02:44 AM
Ramkumar - Webfous
Hi All,

Thanks for all the suggestions.

As Macro would be much complicated for this small cosmetic correction, I had to choose tha Multiline as JG suggested...

And thats not too odd on the looks....

Thanks JG...


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
January 11, 2011, 08:16 AM
Tony A
You can do it within a define but you have to use your knowledge of the output format and deal accordingly.

-DEFAULT &WFFMT = 'EXL2K'
DEFINE FILE CAR
  vbcrlf/A6 = IF &WFFMT EQ 'EXL2K THEN HEXBYT(13,'A1')||HEXBYT(10,'A1') ELSE '<br />';
  MULTIHEAD/A30 = 'LINE'||vbcrlf||'1';
END
TABLE FILE CAR
SUM   SEATS
BY COUNTRY BY CAR
ON COUNTRY SUBHEAD
"<+0>Hiii<+0><MULTIHEAD<+0>"
ON TABLE PCHOLD FORMAT &WFFMT
ON TABLE SET STYLE *
  UNITS=IN, SQUEEZE=ON, ORIENTATION=LANDSCAPE, $
  TYPE=REPORT, HEADALIGN=BODY, GRID=OFF, $
  TYPE=SUBHEAD, BY=COUNTRY, LINE=1,  OBJECT=TEXT,     ITEM=1,     JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
  TYPE=SUBHEAD, BY=COUNTRY, LINE=1,  OBJECT=TEXT,     ITEM=2,     COLOR = RED, JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
  TYPE=SUBHEAD, BY=COUNTRY, LINE=1,  OBJECT=FIELD,     ITEM=2,     JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
END

As your example specifies EXL2K I have used the line breaking used within MS Excel which is carriage return line feed characters, but if this was purely for HTML then I would have to use Gamp's suggestion.

One reason why complete description of your problem is paramount.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
January 12, 2011, 01:30 AM
Ramkumar - Webfous
quote:
-DEFAULT &WFFMT = 'EXL2K'
DEFINE FILE CAR
vbcrlf/A6 = IF &WFFMT EQ 'EXL2K THEN HEXBYT(13,'A1')||HEXBYT(10,'A1') ELSE '
';
MULTIHEAD/A30 = 'LINE'||vbcrlf||'1';
END
TABLE FILE CAR
SUM SEATS
BY COUNTRY BY CAR
ON COUNTRY SUBHEAD
"<+0>Hiii<+0>"
ON TABLE PCHOLD FORMAT &WFFMT
ON TABLE SET STYLE *
UNITS=IN, SQUEEZE=ON, ORIENTATION=LANDSCAPE, $
TYPE=REPORT, HEADALIGN=BODY, GRID=OFF, $
TYPE=SUBHEAD, BY=COUNTRY, LINE=1, OBJECT=TEXT, ITEM=1, JUSTIFY=LEFT, SIZE=10, COLSPAN=1,STYLE=BOLD,$
TYPE=SUBHEAD, BY=COUNTRY, LINE=1, OBJECT=TEXT, ITEM=2, COLOR = RED, JUSTIFY=LEFT, SIZE=10, COLSPAN=1,STYLE=BOLD,$
TYPE=SUBHEAD, BY=COUNTRY, LINE=1, OBJECT=FIELD, ITEM=2, JUSTIFY=LEFT, SIZE=10, COLSPAN=1,STYLE=BOLD,$
END




Your Tip Rocked Tony.... Good One

Really helped it....

Thank you...


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
January 12, 2011, 04:53 AM
Tony A
Only expanding on what JG had already mentioned
quote:
something like "Line" & Chr(10) & " 1"
Again, you just need to think about what you want and the limitations of your various output formats.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10