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     Change font for first character of string in a DEFINE

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Change font for first character of string in a DEFINE
 Login/Join
 
Gold member
posted
Is there a way just to modify the font of a first character of a string in a DEFINE statement.


WebFocus 7.6.6
Oracle 10
Windows XP
 
Posts: 60 | Registered: March 13, 2007Report This Post
Virtuoso
posted Hide Post
When you say modify - what do you want to do to it? If you want to change colors or styles this is done in the Stylesheet.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Virtuoso
posted Hide Post
I think I understand your question - you want the first character of a string to appear in a different font/size than the rest of the string, right? There isn't a way to do this for a single field. There ARE ways to make it appear that way.

If the field is being displayed in a heading/footing, you'll have to break it into two separate fields suppose you have the field NAME/A20:
NAME1/A1=EDIT(NAME,'9');
NAME2/A19=SUBSTR(20,NAME,2,20,19,NAME2);

Then in your heading
HEADING
"<NAME1<+0><NAME2"

and in the stylesheet
TYPE=HEADING, LINE=1, ITEM=1, FONT=ARIAL,$
TYPE=HEADING, LINE=1, ITEM=2, FONT=COURIER,$

If you want this to appear in a column of a report, it will be a little trickier, but will still involve breaking the field up into two fields and squeezing them together to make it appear as if they are a single field - then you have to play with column headings to make them appear as if the two were a single column as well.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Gold member
posted Hide Post
This is a field in a report body - The user wants the first character of the field to be a different font.


WebFocus 7.6.6
Oracle 10
Windows XP
 
Posts: 60 | Registered: March 13, 2007Report This Post
Virtuoso
posted Hide Post
I'm assuming that "field in a report body" means that it appears as its own column. Styling can only be applied to an object in a report, such as a line, field, text item, column, etc. and unfortunately not to partial contents of a column/field. So about the only option as I mentioned before is to break the field up. When that field happens to be a column, it's going to be hard to get things to line up properly to make it look good. Here's an examnple, but it still looks a little funny due to the horizontal spacing required by different fonts and the separate fields.

DEFINE FILE CAR
CAR1/A1=EDIT(CAR,'9');
CAR2/A19=SUBSTR(20,CAR,2,20,19,CAR2);
END
TABLE FILE CAR
PRINT
     CAR1 AS ''
     CAR2 AS 'CAR'
     CAR
BY COUNTRY
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
TYPE=DATA,
     COLUMN=N2,
     FONT='TIMES NEW ROMAN',
     STYLE=BOLD,
$
TYPE=DATA,
     COLUMN=N3,
     FONT='COURIER',
$
TYPE=REPORT,
     COLUMN=N3,
     POSITION=+0.000000,
$
ENDSTYLE
END


This won't look good for an HTML report, however. The gap between columns appears.

For an HTML-only report, you might try hardcoding the tags for font changes into the field itself like the following:
DEFINE FILE CAR
CAR1/A34='<B><I>'|EDIT(CAR,'9')|'</B></I>'|SUBSTR(20,CAR,2,20,19,'A19');
END
TABLE FILE CAR
PRINT
     CAR1 
     CAR
BY COUNTRY
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
ENDSTYLE
END

If you could use this with a cascading stylesheet, you may be able to specify a different font using an HTML tag which could give you what you want.

Couple of suggestions, anyways. Good luck.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Virtuoso
posted Hide Post
The CLASS attribute in the Focus stylesheet is the hook for applying CSS.

See Applying External Cascading Style Sheet Formatting.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report 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     Change font for first character of string in a DEFINE

Copyright © 1996-2020 Information Builders