Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Formatting bits of text in output formats

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Formatting bits of text in output formats
 Login/Join
 
Platinum Member
posted
If I code 'Miscellaneous Cooperative Districts (type 52,53)' (in formatting markup tags) with the "" ('i' inside of carets) and '''' ('/i' inside of carets), then I see (type 52,53) in Italic for my HTML report. Can anyone tell me how to code EXL2K and PDF output that way: So that bits of the heading are formatted differently?

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


WebFOCUS 8.1.05 Windows 7, all output
 
Posts: 107 | Registered: February 18, 2011Report This Post
Expert
posted Hide Post
If you post any code within the
</>
code tags we will be able to see them.

Can you post an example working of one of the sample files like CAR.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
Let me take some time and put that example together. Thanks!!


WebFOCUS 8.1.05 Windows 7, all output
 
Posts: 107 | Registered: February 18, 2011Report This Post
Virtuoso
posted Hide Post
Where exactly are you putting that? in a HEADING, SUBHEAD, SUBFOOT section perhaps?

Why not using the default functionality in WebFOCUS to style your content in italics?

TABLE FILE CAR
PRINT CAR AND MODEL
BY COUNTRY
HEADING
"List of cars (<+0>by Country<+0>)"
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
TYPE=HEADING, OBJECT=TEXT, ITEM=2, STYLE=ITALIC, $
END



That worked seamlessly in HTML, PDF and EXL2K without resorting to specific HTML markup tags. It makes it more "portable" across output formats that support styling.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
Using STYLESHEET to format the text doesn't work for me. I want to format different words of the text in different fonts/sizes/italic. It is all one field. STYLESHEET will format the entire field in a single format. At least that's been my experience.

The focexec actually uses the MacGyver technique to set the text value for 98 different values. (Yep - lots of typing) These values are what I want to format in bits and pieces.
Marilyn


WebFOCUS 8.1.05 Windows 7, all output
 
Posts: 107 | Registered: February 18, 2011Report This Post
Expert
posted Hide Post
njsden, he's using markup tags, I think we need to see the code.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
OK. Someone just dropped a 'hot iron' on my desk. So I mak not get back for a day or two. I WILL prepare some CAR code.


WebFOCUS 8.1.05 Windows 7, all output
 
Posts: 107 | Registered: February 18, 2011Report This Post
Virtuoso
posted Hide Post
quote:
It is all one field


Oh, you had missed that small but important piece of information.

I think there is a MARKUP=ON setting in the stylesheet section that applies when using PDF (I have not used that myself but a search in the forum might give you some samples).

I am not so sure that Excel will allow mixed formatting in one single cell but only testing will tell.

I'll do as Waz says and will wait for the code to show up.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
njsden, I think we were both right and wrong.

If I'm right Marilyn has a field that has HMTL tags in it. They work in HTML but not PDF or Excel.

This works in PDF and HTML, but doesn't in EXL2K.

DEFINE FILE CAR
HEAD_TEXT/A100 = 'Miscellaneous Cooperative Districts <FONT SIZE=8><I>(type 52,53)</I></FONT>' ;
END

TABLE FILE CAR
HEADING
"<HEAD_TEXT"
PRINT COUNTRY
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
 TYPE=HEADING, MARKUP=ON, $
ENDSTYLE
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
You are 'right on'! Thanks!

This code:
 DEFINE FILE CAR
HEAD_TEXT/A100 = '<FONT SIZE=12>Miscellaneous Cooperative Districts <FONT><FONT SIZE=-2><I>(type 52,53)</I></FONT>' ;
END

TABLE FILE CAR
HEADING
"<HEAD_TEXT"
PRINT COUNTRY
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
 TYPE=HEADING, 
MARKUP=ON, 
 $
ENDSTYLE
END
 

works works for italics in PDF and HTML, with MARKUP=ON. I can't seem to change the font size of the first part of the heading in PDF.
I'll explore the "MARKUP=ON".


WebFOCUS 8.1.05 Windows 7, all output
 
Posts: 107 | Registered: February 18, 2011Report This Post
Virtuoso
posted Hide Post
You could use this old trick to "make it work" in Excel:

DEFINE FILE CAR
HEAD_TEXT/A100 = 'Miscellaneous Cooperative Districts <FONT SIZE=8>[i](type 52,53)[/i]</FONT>' ;
END

TABLE FILE CAR
HEADING
"<HEAD_TEXT"
PRINT COUNTRY
ON TABLE HOLD AS HRESULT FORMAT HTMTABLE
ON TABLE SET STYLE *
 TYPE=HEADING, MARKUP=ON, $
ENDSTYLE
END
-RUN

SET HTMLFORMTYPE=XLS
-HTMLFORM BEGIN
<html>
   <head><title>Formatting mark-up!</title></head>
   <body>!IBI.FIL.HRESULT;</body>
</html
-HTMLFORM END



You will technically be creating an HTML document but altering it's MIME spec to open it with Excel which works just fine ... I just hope you're not using EXL2K FORMULA or PIVOT tables in your WebFOCUS output.

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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
Marilyn, if your requirement is not GUI-bound the code below will take care of adjusting the output depending on the chosen format (HTML, PDF or EXL2K). Well, it should technically work with any "styled" format but the markup tags won't be interpreted as you need.

-DEFAULT &WFFMT = 'EXL2K';

-SET &PCHOLD = IF &WFFMT EQ 'EXL2K' THEN 'HOLD AS HRESULT FORMAT HTMTABLE'
-              ELSE 'PCHOLD FORMAT ' | &WFFMT;

DEFINE FILE CAR
HEAD_TEXT/A100 = 'Miscellaneous Cooperative Districts <FONT SIZE=8><I>(type 52,53)</I></FONT>' ;
END

TABLE FILE CAR
HEADING
"<HEAD_TEXT"
PRINT COUNTRY
ON TABLE &PCHOLD
ON TABLE SET STYLE *
 TYPE=HEADING, MARKUP=ON, $
ENDSTYLE
END
-RUN

-IF &WFFMT NE 'EXL2K' THEN GOTO :END;

SET HTMLFORMTYPE=XLS
-HTMLFORM BEGIN
<html>
   <head><title>Formatting mark-up!</title></head>
   <body>!IBI.FIL.HRESULT;</body>
</html
-HTMLFORM END

-:END



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
YOHOO! I have found a way for the same text formatting to work in HTML, PDF, and EXL2K! And it's all WebFOCUS code.
(Thanks for the MARKUP tip. It worked!) It has no effect of EXL2K or HTML, only PDF.
Then I discovered that the first character within the 'text' has to be a formatting character
<
in order to format text in EXL2K. So I have done that 2 different ways. (See NEW_FLD_TEXT and NEW2_FLD_TEXT.) The result is that the first character of the text is a 'blank' character, but that was ok for me.
Consider this:
-SET &TABLE_OUTPUT = 'PCHOLD FORMAT PDF';
-SET &X = IF &TABLE_OUTPUT EQ 'PCHOLD FORMAT HTML' THEN '' ELSE '<+0>';
DEFINE FILE CAR
HEAD_TEXT/A125 = '<font size=10>Miscellaneous Cooperative Districts</font> <font size=-2>[i](some text)[/i]</font>' ;
FLD_TEXT/A100 = IF CAR EQ 'TRIUMPH' THEN '<font size=+2><i>(any text,<font size=-2>smaller text)</i>' ELSE CAR ;
NEW_FLD_TEXT/A100 = IF CAR EQ 'TRIUMPH' THEN CAR ELSE '&X' | CAR | '<font size=+2><i>(any text,<font size=-2>SMALLER TEXT</i></font>' ;
NEW2_FLD_TEXT/A100 = IF CAR EQ 'TRIUMPH' THEN CAR ELSE '<i></i>' | CAR | '<font size=+2><i>(any text,<font size=-2>SMALLER TEXT</i></font>' ;
END
-*
TABLE FILE CAR
HEADING
"<HEAD_TEXT"
PRINT
CAR   AS '<b>Car</b>,<i>Name</i>'
MODEL AS '<i><u>M</u>odel</i>'
FLD_TEXT NEW_FLD_TEXT NEW2_FLD_TEXT
BY COUNTRY
ON TABLE &TABLE_OUTPUT
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     LEFTMARGIN=0.50000,
     RIGHTMARGIN=0.50000,
     TOPMARGIN=0.500000,
     BOTTOMMARGIN=0.500000,
     SQUEEZE=ON,
     ORIENTATION=LANDSCAPE,
     JUSTIFY=LEFT,
     SUMMARY='Text Format Report',
     TITLETEXT='Text Format Report',
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
     COLOR='BLACK',
     STYLE=NORMAL,
     MARKUP=OFF,

$
TYPE=REPORT, FONT=ARIAL, SIZE=10, MARKUP=ON, $
-*
TYPE=HEADING,MARKUP=ON, $
-*
TYPE=DATA, COLUMN=FLD_TEXT, JUSTIFY=LEFT, MARKUP=ON, $
TYPE=DATA, COLUMN=NEW_FLD_TEXT, JUSTIFY=LEFT, MARKUP=ON, $
TYPE=DATA, COLUMN=NEW2_FLD_TEXT, JUSTIFY=LEFT, MARKUP=ON, $
-*
ENDSTYLE
END  


I do have a question, though: Why does the 'NEW_FLD_TEXT' move way over into the 'FLD_TEXT' column? (only in PDF)

Thanks for you help and ideas!!

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


WebFOCUS 8.1.05 Windows 7, all output
 
Posts: 107 | Registered: February 18, 2011Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Formatting bits of text in output formats

Copyright © 1996-2020 Information Builders