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] Formating separate part of an alphanumeric field

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Formating separate part of an alphanumeric field
 Login/Join
 
Silver Member
posted
Hi everybody,
I have the following styling issue :
I have a single alphanumeric column and I have to set a particular range from it to BOLD but without splitting it into different columns.
Is it possible to do it ?
Thanks in advance.

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


WF 7.6.5 / OS: XP / FOCUS
 
Posts: 42 | Registered: September 01, 2008Report This Post
Expert
posted Hide Post
Something Like This???


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Silver Member
posted Hide Post
Yes , exactly. But the examples work for html only ... I forgot to mention that the output is a PDF file.


WF 7.6.5 / OS: XP / FOCUS
 
Posts: 42 | Registered: September 01, 2008Report This Post
Expert
posted Hide Post
Martin_fmi,

Well, now that I upgraded to ADOBE 9.1, HTMLFORMTYPE=PDF in 7.6.8 doesn't work.

Marvelous!!!

File does not begin with '%PDF-' is the error...

You may be able to try it, try Francis' syntax:

  
-SET &SEARCH = 'A';

-SET &STRREP = '<span class=hi>' || &SEARCH || '</span>';

TABLE FILE CAR
PRINT
COMPUTE COUNTRYX/A100 =
  STRREP (10, COUNTRY, 2, '&SEARCH', &STRREP.LENGTH, '&STRREP', 100, 'A100');

WHERE COUNTRY LIKE '%&SEARCH|%'

ON TABLE HOLD AS H001 FORMAT HTML
END
-RUN
SET HTMLFORMTYPE = PDF
-RUN
-HTMLFORM BEGIN
<html>
<head>
<style type="text/css">
.hi { color: red; }
</style>
</head>

<body>
!IBI.FIL.H001;
</body>
</html>
-HTMLFORM END
-EXIT


Don't know it this will work; if not, I have no ideas, maybe Mickey does...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Silver Member
posted Hide Post
quote:
'%PDF-


Thanks Tom , bur it gives me the same error : File does not begin with '%PDF-' . The problem is that the client is using ADOBE as a PDF reader ...

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


WF 7.6.5 / OS: XP / FOCUS
 
Posts: 42 | Registered: September 01, 2008Report This Post
<JG>
posted
When you use HTMLFROMTYPE it passes the instructions to the browser to tell it what
application to open the document with.

So if you say PDF it will open in PDF and Acrobat reader cannot open HTML or excel
it can only open PDFs
 
Report This Post
Expert
posted Hide Post
JG, Good morning,

I thought that was the intent of HTMLFORMTYPE, although, as Francis states in other posts, it is not documented very well.

If you HOLD FORMAT HTMTABLE/HTML and use SET HTMLFORMTYPE=XLS, it opens in EXCEL, without EXCEL styling.
If you use DOC, it opens in WORD

PDF is the anomoly, I guess. From one of your previous posts you HOLD FORMAT PDF, then, SET HTMLFORMTYPE=PDF

I guess I don't understand why bother to allow the code without error, SET HTMLFORMTYPE=PDF, and then ADOBE is unable to open.

I wonder if it is a MIME problem???

BTW, I ran it at one of my clients, 7.6.1:

https://XXXX.XXXXXX.edu/ibi_ap...PG_File=ohsujvsa.pdf

So, it outputs with .pdf extension, but, the error message appears there, also...

Oh well, no-can-do in ADOBE...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
<JG>
posted
Tom,

The reason word and excel work is because they both know what html is, both can read it and write it.

PDF on the other hand does not.

The only option available to do what Martin_fmi wants is to use an HTML to PDF converter.
Then you can use the HTMLFORMTYPE as the file will be valid.

One that I use is ABC Text Converter http://www.processtext.com/abctxt.html
(Windows only) It's very cheap and can be run in command line mode making it perfect for
use with WebFOCUS and -HTMLFORM.

It's very useful as it also allows you to encrypt, password protect and disable being
allowed to print the file (great in protected and sensitive environments)

And it also imports and outputs many other formats and is very cheap at $75 for a site license.

There are similar tools available in unix environments
 
Report This Post
Expert
posted Hide Post
JG,

Thanks. Good info...

So, can you test the above code and output to PDF using the ABC converter???

That would be a good test...

Thanks for all your assistance on this board, JG, and, I hope I speak for more than a few!!! Smiler

Tom

P.S. How come no one asks you to update your profile????? Big Grin


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
<JG>
posted
Tom you need a slightly different approach.

This works just fine

 
FILEDEF H001 DISK H001.htm (APPEND
-RUN
-WRITE H001 <html>
-WRITE H001 <head>
-WRITE H001 <style type="text/css">
-WRITE H001 .hi { color: red; }
-WRITE H001 </style>
-WRITE H001 </head>
-WRITE H001 <body>

-SET &SEARCH = 'A';
-SET &STRREP = '<span class=hi>' || &SEARCH || '</span>';

TABLE FILE CAR
PRINT
COMPUTE COUNTRYX/A100 =
  STRREP (10, COUNTRY, 2, '&SEARCH', &STRREP.LENGTH, '&STRREP', 100, 'A100');

WHERE COUNTRY LIKE '%&SEARCH|%'

ON TABLE HOLD AS H001 FORMAT HTMTABLE
END
-RUN
-WRITE H001 </body>
-WRITE H001 </html>
-RUN
! abctext.exe "H001.htm" "H001.pdf" 0 0
-RUN
SET HTMLFORMTYPE=PDF
-HTMLFORM BEGIN
!IBI.FIL.H001;
-HTMLFORM END
 


I have updated my profile but for some reason it does not display.
 
Report This Post
Expert
posted Hide Post
JG,

OK, thanks. It looks like the abctext.exe will execute in place of ADOBE; correct? I would think your -WRITE's could actually be placed in the -HTMLFORM below, as well, OR, does it ALL have to be in the file?

Since I want to have the ability to do this, I will purchase the ABC converter.

To update your profile, make sure you fill in the box:

(**required) Signature: Please fill out your WebFOCUS release, OS/Platform, and expected Output format(s), AND also the fields below:
HTML permitted only if you have specific permission.


Click on the SUBMIT buttton at the bottom(I'm sure you know this already)...

Tom

EDIT:

BTW, do a HTML to PDF search and there is a bunch of options, some cheap, some not-so-much!!!

FYI

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
<JG>
posted
quote:
Click on the SUBMIT button at the bottom(I'm sure you know this already)...

That's exactly what I did. It's there but does not display. I can only assume it's because I have the hide option selected
for show online presence.

Anyway to the point.

No you can not have the extra HTML components in the HTML form.

The writes are required because the html you convert, must be complete before you convert it.

Remember PDF does not understand CSS or HTML so if you use HTMLFORMTYPE=PDF the only thing you are allowed
to give it is a single, complete PDF document.

If you get the converter install it in a directory path without spaces (not the default "Program Files\ABC Amber Text Converter\"
(I usually stick it under "C:\IBI\ABCTEXT\") and make sure that you add it to the PATH environmental variable.


Update

Tom Unfortunately I seem to have found an issue with the text converter and it is not converting the output correctly.
I've contacted the support people.

This message has been edited. Last edited by: <JG>,
 
Report This Post
Expert
posted Hide Post
quote:
File does not begin with '%PDF-'


FYI

PDF documents must begin with the text '%PDF'

they are a very specific format.


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
Silver Member
posted Hide Post
Thank you all for the replies. We've managed to leap across the problem but a different one emerged that is related to the same thing. Even if the items in the suboots are separate I was unable to find a way to reduce the space generated by the '>' marker so that it is equivalent to the regular space between items.For example

 TABLE FILE CAR
PRINT COUNTRY NOPRINT
COMPUTE V1/A3 = 'AAA'; NOPRINT
COMPUTE V2/A3 = 'BBB'; NOPRINT
COMPUTE V3/A3 = 'CCC'; NOPRINT
COMPUTE V4/A3 = 'DDD'; NOPRINT
COMPUTE V5/A3 = 'EEE'; NOPRINT
HEADING
"<V1><V2><V3><V4><V5>"
"AAA BBB CCC DDD EEE"
ON TABLE PCHOLD FORMAT PDF
END
-RUN
 


As well I don't to use the WIDTH attribute because there are many subfoots in the report and it would be a nightmare ... So I was wondering if there is any such possibility ...


WF 7.6.5 / OS: XP / FOCUS
 
Posts: 42 | Registered: September 01, 2008Report This Post
<JG>
posted
If you only need PDF or PowerPoint then

 
 TABLE FILE CAR
PRINT COUNTRY NOPRINT
COMPUTE V1/A3 = 'AAA'; NOPRINT
COMPUTE V2/A3 = 'BBB'; NOPRINT
COMPUTE V3/A3 = 'CCC'; NOPRINT
COMPUTE V4/A3 = 'DDD'; NOPRINT
COMPUTE V5/A3 = 'EEE'; NOPRINT
HEADING
"<V1><-1><V2><-1><V3><-1><V4><-1><V5>"
"AAA BBB CCC DDD EEE"
ON TABLE PCHOLD FORMAT PDF
END
-RUN

This message has been edited. Last edited by: <JG>,
 
Report This Post
Silver Member
posted Hide Post
Thanks for the tip but I cannot make it work in my case ... See for example:
DEFINE FILE CAR
VAL1/A27 WITH COUNTRY = 'AAA' | ' ' | 'BBB' | ' ' | 'CCC' | ' ' | 'DDD' | ' ' | 'EEE <-PRINT';
END
-RUN

TABLE FILE CAR
PRINT COUNTRY NOPRINT
VAL1 AS ''
COMPUTE V1/A3 = 'AAA'; NOPRINT
COMPUTE V2/A3 = 'BBB'; NOPRINT
COMPUTE V3/A3 = 'CCC'; NOPRINT
COMPUTE V4/A3 = 'DDD'; NOPRINT
COMPUTE V5/A3 = 'EEE'; NOPRINT
COMPUTE SP/A1 = HEXBYT(160, 'A1'); NOPRINT
HEADING
"<V1><-1> <V2><-1> <V3><-1> <V4><-1> <V5>"
"<V1><-1><SP><-1><V2><-1><SP><-1><V3><-1><SP><-1><V4><-1><SP><-1><V5>"
"AAA<+1>BBB<+1>CCC<+1>DDD<+1>EEE"
"AAA BBB CCC DDD EEE"
ON TABLE PCHOLD FORMAT PDF
END
-RUN



The 4th line of the subfoot is aligned well , but the previous 3 are not. I tryed adding <-1><+1> between them and only a space after <-1> (lines 1 , 2 of the subfoot) but fails ...


WF 7.6.5 / OS: XP / FOCUS
 
Posts: 42 | Registered: September 01, 2008Report This Post
Expert
posted Hide Post
By the way, according to Waz, PDF is one of the formats recognized by HTMLFORMTYPE, as he specifies here: Smiley - Unicode 263A, though I don't believe it until I see IBI documentation discussing HTMLFORMTYPE, which I haven't found yet.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Martin,

I'm running WF 7.6.7.

I think the problem rests with the font used. See the following:
  
 TABLE FILE CAR
PRINT COUNTRY NOPRINT
COMPUTE V1/A3 = 'AAA'; NOPRINT
COMPUTE V2/A3 = 'BBB'; NOPRINT
COMPUTE V3/A3 = 'CCC'; NOPRINT
COMPUTE V4/A3 = 'DDD'; NOPRINT
COMPUTE V5/A3 = 'EEE'; NOPRINT
HEADING
"<V1 <V2 <V3 <V4 <V5"
"AAA BBB CCC DDD EEE"
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, FONT=COURIER NEW, SIZE=10, $
ENDSTYLE
END


Change the font to ARIAL and the alignment moves. Maybe IBI can shed some light...


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
<JG>
posted
quote:
HTMLFORMTYPE

Francis I've done an internal search

and it's very badly documented.

 
HTMLFORMTYPE Sets the output format type of an -HTMLFORM report.


5.2 documentation nothing before, nothing after.

Whole of the interal systems 65 hits.

It really should be documented correctly.
 
Report This Post
Silver Member
posted Hide Post
Danny - with COURIER NEW font is ok with other fonts - not as you say. Interesting thing ...


WF 7.6.5 / OS: XP / FOCUS
 
Posts: 42 | Registered: September 01, 2008Report 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] Formating separate part of an alphanumeric field

Copyright © 1996-2020 Information Builders