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] Issue with quotes in TITLETEXT

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Issue with quotes in TITLETEXT
 Login/Join
 
Gold member
posted
Hello All,

I am providing the code below. I have issue with Titletext.
&MDSE is passed from a field of a table. It is 50 characters long.
The field text contains "," and "'" symbols in the text.
If the text is "It is Adam's desktop". My report is not executing .. Titletext only takes "It is Adam" and it does not understand what is following keyword (in this case "s desktop").

Please help how I could solve this issue. I tried changing the single quotes to double for TITLETEXT, then I have issue with the text containing ",".

  
TABLE FILE MTA
PRINT UDA_VAL_N
BY MDSE_TYPE_N AS ''
ACROSS ATTR_N AS ''
WHERE MDSE_TYPE_N EQ '&MDSE';
ON TABLE PCHOLD FORMAT EXL2K &FLAG
ON TABLE SET PAGE-NUM OFF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,
$
TYPE=REPORT,GRID=OFF,FONT='ARIAL',SIZE=10,COLOR='BLACK',BACKCOLOR='WHITE',STYLE=NORMAL,BORDER=0.5,TITLETEXT='&MDSE.EVAL',$
-*TYPE=TITLE,STYLE=BOLD,COLOR='BLACK',BACKCOLOR=RGB(159 217 253),JUSTIFY=CENTER,$
TYPE=ACROSSTITLE,BORDER-LEFT=OFF,BORDER-RIGHT=OFF,BORDER-TOP=OFF,$
TYPE=ACROSSVALUE,STYLE=BOLD,BACKCOLOR=RGB(200 200 200),$
ENDSTYLE
END

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


In Focus since 2008
WebFOCUS 8.2.0.1
Windows 7 - IE,Chrome,Firefox
Excel, PDF, HTML, AHTML, XML
JavaScript, jQuery, D3.js, Highcharts
 
Posts: 79 | Location: New York | Registered: February 04, 2010Report This Post
Expert
posted Hide Post
My suggestion is to change the single quotes to the '`' character for the TITLETEXT.


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
Expert
posted Hide Post
I can see why the single quote causes a problem:
...,TITLETEXT='&MDSE.EVAL',...
would evaluate to
...,TITLETEXT='It is Adam's desktop',...
which is invalid WebFOCUS syntax.

The documentation states:
quote:
Naming of Worksheets. The default worksheet tab names will be Sheet1, Sheet2, and
so on. You have the option to specify a different worksheet tab name by using the
TITLETEXT keyword in the stylesheet. For example:
TYPE=REPORT, TITLETEXT='Summary Report', $
Excel limits the length of worksheet titles to 31 characters. The following special
characters cannot be used: ':', '?', '*', and '/'.


I tried a comma in a titletext attribute and it works:
-SET &TITLETEXT='TEST,REPORT';

TABLE FILE CAR
PRINT
*
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='&TITLETEXT', $
ENDSTYLE
END
-RUN

I would use CTRAN to remove the apostrophe. I would also use CTRAN to remove the other specified special characters.


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
Gold member
posted Hide Post
Waz,

i have used your suggestion, but strrep did not work. Plz check my code below

 -READ HOLDFILE &MDSE.A50.
-SET &MDSE1 = STRREP(&MDSE.LENGTH, &MDSE, 1, ',', 1, '`', &MDSE.LENGTH, 'A&MDSE.LENGTH'); 


sourcecode
  
 -SET &MDSE1 = STRREP(50, Children's Nutritional Supplements                , 1, ',', 1, '`', 50, 'A50');
 -SET &FLAG = IF 45 EQ 1 THEN 'OPEN' ELSE IF 45 EQ       82 THEN 'CLOSE' ELSE '';
 -TYPE Children's Nutritional Supplements
 Children's Nutritional Supplements
 -TYPE Children's Nutritional Supplements
 Children's Nutritional Supplements
 -*================================



In Focus since 2008
WebFOCUS 8.2.0.1
Windows 7 - IE,Chrome,Firefox
Excel, PDF, HTML, AHTML, XML
JavaScript, jQuery, D3.js, Highcharts
 
Posts: 79 | Location: New York | Registered: February 04, 2010Report This Post
Expert
posted Hide Post
That really isn't source code, it's the result of executing source code.

-SET &MDSE1 = STRREP(50, Children's Nutritional Supplements                , 1, ',', 1, '`', 50, 'A50');
This looks like you're replacing a comma by an accent. To replace an apostrophe, change
','
to
''''


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
Expert
posted Hide Post
In the past and not for titletext, I've replaced apostrophes with "Right Single Quotation Mark":

-*-- Convert Apostrophe to Right Single Quotation Mark -------------------------
-SET &VAR1 = 
-  CTRAN(&VAR1.LENGTH, &VAR1, BYTVAL('''','I3'), BYTVAL('’','I3'), 'A&VAR1.LENGTH');

I just tried this with TITLETEXT and it does not work well - the Right Single Quotation Mark does not display properly.


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
Instead of
  '&MDSE'

or
  '&MDSE.EVAL'


use
  &MDSE.QUOTEDSTRING

(not enclosed in quotes)

This message has been edited. Last edited by: j.gross,
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
One more suggestion:

Since you have
BY MDSE_TYPE_N
coupled with
WHERE MDSE_TYPE_N EQ [a unique value];
you could skip the TITLETEXT bother and just use BYTOC to name the worksheet, leaving it to webfocus to remove characters that offend Excel.
 
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     [SOLVED] Issue with quotes in TITLETEXT

Copyright © 1996-2020 Information Builders