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]Getting rid of leading spaces in hyperlink

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Getting rid of leading spaces in hyperlink
 Login/Join
 
Silver Member
posted
Hi All,

I have a report that displays information by office. Some office have child offices that we have chosen to offset with 4 spaces and display in italics. The office column is a drill down column that dills to another report. Currently, because of the spaces the hyperlink for child offices is displaying with the leading spaces being part of the hyperlink. See sample below.

Is there a way to exclude leading spaces when showing the cell as a hyperlink (maybe including html in code)?

Thanks
B

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


WebFOCUS 7.7
Windows
All Output (Excel, HTML, PDF)
 
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010Report This Post
Virtuoso
posted Hide Post
Well, if your report is to be delivered in HTML only, you could add some kind of indicator to your output to determine if an indentation is to be displayed and use Javascript to manipulate the HTML output accordingly.

DEFINE FILE CAR
NEW_CAR/A50 = IF CAR EQ 'JAGUAR' OR 'JENSEN' OR 'MASERATI' THEN '@' || CAR ELSE CAR;
END
TABLE FILE CAR
SUM
RETAIL_COST AS 'Retail'
DEALER_COST AS 'Dealer'
BY COUNTRY  AS 'Country'
BY NEW_CAR  AS 'Car'
ON TABLE HOLD AS HRESULTS FORMAT HTMTABLE
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=NEW_CAR, FOCEXEC=DUMMY, $
END
-RUN
-HTMLFORM BEGIN
<html><head><title>My cars</title></head>
<body>!IBI.FIL.HRESULTS;</body>
<script type="text/Javascript">

    window.onload = function() {
	   // Do your Javascript magic here to implement indentation when @ is found!
           // blah
    };
</script>
</html>
-HTMLFORM END


I'll leave the Javascript piece for you to play with, which should traverse your document, find all of the elements and modify them *if* the anchor's text (or innerHTML) value starts with '@'.

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
Or ... you can build the hyperlinks yourself!

DEFINE FILE CAR
CAR_LINK/A200 =  IF (CAR EQ 'JAGUAR' OR 'JENSEN' OR 'MASERATI') 
                THEN '<div>&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;<a href="/ibi_apps/WFServlet?IBIF_ex=myproc.fex">' || CAR || '</a></div>' 
                ELSE '<a href="/ibi_apps/WFServlet?IBIF_ex=myproc.fex">' || CAR || '</a>';
END
TABLE FILE CAR
SUM
RETAIL_COST AS 'Retail'
DEALER_COST AS 'Dealer'
BY COUNTRY  AS 'Country'
BY CAR_LINK AS 'Car' 
ON TABLE SET STYLE *
END


Of course, you'll be attempting to re-implement a feature that WF provides out-of-the-box but it is still an option.

Hope that helps.

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
Silver Member
posted Hide Post
Thank you njsden for both replies. I really like your second post but how would I pass parameters to the downstream report if I'm creating the link in the define?


WebFOCUS 7.7
Windows
All Output (Excel, HTML, PDF)
 
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010Report This Post
Platinum Member
posted Hide Post
Why can't you use the TRIM function and trim all leading spaces?


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
 
Posts: 127 | Location: San Antonio | Registered: May 29, 2009Report This Post
Silver Member
posted Hide Post
the spaces denote a child office. It's a visual queue along with the italics.


WebFOCUS 7.7
Windows
All Output (Excel, HTML, PDF)
 
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010Report This Post
Virtuoso
posted Hide Post
bflemi3, just concatenate the value wherever you need it. For example, to run myproc.fex passing a value to &MYCAR, you could have something like this:

CAR_LINK/A200 = IF (CAR EQ 'JAGUAR' OR 'JENSEN' OR 'MASERATI') 
                THEN '<div>&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;<a href="/ibi_apps/WFServlet?IBIF_ex=myproc.fex&|MYCAR=' || CAR || '">' || CAR || '</a></div>' 
                ELSE '<a href="/ibi_apps/WFServlet?IBIF_ex=myproc.fex&|MYCAR=' || CAR || '">' || CAR || '</a>';


It is a bit cumbersome particularly if you'll be dealing with many parameters but that's the cost to pay when one chooses not to take advantage of the standard functionality that comes with the product.

You could use FOCEXEC along with Javascript code to manipulate the anchors after the output has been generated, but that may not necessarily be simpler. Sort of a trade off due to the special requirement you have.

Best,
Neftali.



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
You might be able to do all of the formatting in the StyleSheet:

TABLE FILE CAR
 SUM
  RETAIL_COST AS 'Retail'
  DEALER_COST AS 'Dealer'
  COMPUTE CHILD_FLAG/A1 = IF CAR EQ 'JENSEN' OR 'MASERATI' THEN 'Y' ELSE 'N'; NOPRINT
 BY COUNTRY   AS 'Country'
 BY CAR       AS 'Car'
 ON TABLE SET STYLE *
  TYPE=DATA, COLUMN=CAR, FOCEXEC=DUMMY, JUSTIFY=LEFT, WHEN=CHILD_FLAG EQ 'N',  $
  TYPE=DATA, COLUMN=CAR, FOCEXEC=DUMMY, STYLE=ITALIC, JUSTIFY=RIGHT, WHEN=CHILD_FLAG EQ 'Y', $
 ENDSTYLE
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Silver Member
posted Hide Post
OK, I'll give it a shot njsden. Thank you for your help.

B


WebFOCUS 7.7
Windows
All Output (Excel, HTML, PDF)
 
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010Report This Post
Expert
posted Hide Post
You could do this in a cascading style sheet, assuming this is only HTML.

-HTMLFORM BEGIN
  <style>
    .Indent {
      padding-left: 20px;
    }
  </style>
-HTMLFORM END


DEFINE FILE CAR
 CHILD/A1 = IF COUNTRY EQ 'ITALY' THEN 'Y' ELSE 'N' ;
END
TABLE FILE CAR
 PRINT CHILD NOPRINT
 BY COUNTRY
 ON TABLE SET HTMLCSS ON
 ON TABLE SET CSSURL mycss.css
 ON TABLE SET STYLE *
  TYPE=DATA, COLUMN=COUNTRY, FOCEXEC=drill, $
  TYPE=DATA, COLUMN=COUNTRY, WHEN=CHILD EQ 'Y', CLASS=Indent, FOCEXEC=drill, $
 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
Virtuoso
posted Hide Post
Cool! I like that alternative. Much cleaner and easier to implement.

Good One



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
Silver Member
posted Hide Post
quote:
Originally posted by njsden:
Cool! I like that alternative. Much cleaner and easier to implement.

Good One


I agree. Thanks Waz!


WebFOCUS 7.7
Windows
All Output (Excel, HTML, PDF)
 
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010Report This Post
Silver Member
posted Hide Post
This works great.

But, there's always a but, does anyone know how to deal with this for pdf and excel outputs?


WebFOCUS 7.7
Windows
All Output (Excel, HTML, PDF)
 
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010Report This Post
Expert
posted Hide Post
You may have to deal with each individually, although I wonder if you created the HTML report and sent it to Excel with SET HTMLFORMTYPE, whether it will still work.

As for PDF, here is an old programmers trick.

DEFINE FILE CAR
 CHILD/A1 = IF COUNTRY EQ 'ITALY' THEN 'Y' ELSE 'N' ;

 CTY1/A4  = IF CHILD EQ 'Y' THEN ' '     ELSE EDIT(COUNTRY,'9999') ;
 CTY2/A10 = IF CHILD EQ 'Y' THEN COUNTRY ELSE EDIT(COUNTRY,'$$$$999999') ;

END
TABLE FILE CAR
 PRINT CHILD NOPRINT
 BY COUNTRY  NOPRINT
 BY CTY1  AS 'COUN'
 BY CTY2  AS 'TRY' IN +0
 ON TABLE PCHOLD FORMAT PDF
 ON TABLE SET STYLE *
  TYPE=DATA, COLUMN=CTY2, FOCEXEC=drill, $
  TYPE=DATA, COLUMN=CTY2, WHEN=CHILD EQ 'Y', FOCEXEC=drill, $
  TYPE=DATA, COLUMN=CTY1, WHEN=CHILD EQ 'N', FOCEXEC=drill, $
 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
Silver Member
posted Hide Post
Thank you Waz, I'll look into this.


WebFOCUS 7.7
Windows
All Output (Excel, HTML, PDF)
 
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010Report 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]Getting rid of leading spaces in hyperlink

Copyright © 1996-2020 Information Builders