Focal Point
[SOLVED] SIMPLE HYPERLINK SYNTAX

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4547052326

August 16, 2012, 11:35 AM
phoenixfox
[SOLVED] SIMPLE HYPERLINK SYNTAX
Hello. I am still having trouble figuring out how to include a simple hyperlink in my defined paragraph. I have a simple defined paragraph and I want one word within that paragraph to link to a webpage in the output. What is the syntax to do this? I can't imagine it's difficult but I don't have experience doing this and I can't seem to find anything concrete in the documentation. Help! Thanks

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


WebFOCUS 7.6
Windows, All Outputs
August 16, 2012, 12:49 PM
Francis Mariani
DEFINE FILE CAR
COUNTRY_LINK/A200 = '<a href="http://www.google.ca/#hl=en&|output=search&|q=' || COUNTRY | '" target=win_google>' | COUNTRY | '</>';
END

TABLE FILE CAR
SUM
SALES
BY COUNTRY_LINK AS COUNTRY
END



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
August 16, 2012, 01:44 PM
Doug
NICE... Simple and Niceeeee....
August 21, 2012, 04:11 PM
phoenixfox
I have my defined hyperlink:
-*******************
DEFINE FILE STEP2
HYPERLINK/A50 = 'Residency Determination Office';
END
-******************
Now, if I have a defined paragraph, not a column, how do I surround the neccessary word?


WebFOCUS 7.6
Windows, All Outputs
August 22, 2012, 08:13 AM
J
I assume when you say surround the necessary word that you mean display a certain word as the hyperlink text. Depending on how your paragraph is going to be set up, simply use another define with a parsing function. If you could give us an idea of what these paragraphs are going to consist of, that would be helpful.


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
August 22, 2012, 08:58 AM
phoenixfox
J, yes, that is exactly what I'm speaking of. A certain word within the paragraph as the hyperlink text. Here is a sample paragraph that's very similar to what my actual paragraph will be. It's also a defined paragraph.
-********************************************
DEFINE
PARAGRAPH1/A1000 = IF F8 EQ '2-YR' THEN 'This is my test paragraph. This is the paragraph that will print in my output.'
END
-*********************************************


WebFOCUS 7.6
Windows, All Outputs
August 22, 2012, 10:05 AM
J
So what are you going to be looking for in the paragraph? is it the F8 EQ '2-YR' or what? It looks like you will already have the part you need to be displayed in either a define or a variable. All you need to do is concatenate that define/variable into your Hyperlink define. ie:
 HYPERLINK/A50=''|| &yourvarible || '' 
Then for the paragraph Define, concatenate the hyperlink within the paragraph.

Basically we need to know how you are determining the "necessary word"


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
August 23, 2012, 08:36 AM
phoenixfox
Within my defined paragraph I will have a sentence like "Please contact the Office of the Registrar for assistance." If I want to make the "Office of the Registrar" a link to the Registrar's home page, I will need to define that in my HYPERLINK/A50 = '||http://www.registrar.com||'.
Then what?


WebFOCUS 7.6
Windows, All Outputs
August 23, 2012, 09:30 AM
J
Sorry it didn't show up correctly. I am assuming that Office of the Registrar or whatever value that is is coming from a variable or a field and that is the only part of that sentence that changes each time. You will have to create a hyperling (ignore my example above...) and concatenate the variable/column into the link as well as your target.
You will need to create static conditions for each value it looks like; example with if statement:
i.e. Hyperlink/A50 = IF &department EQ 'Registrar' THEN
 '<a href="http://www.registrar.com" target="_blank">' || 'Please contact the Office of the ' || &department || ' for assistance.' ELSE IF &department=...</a>' 

This may not be exactly your example, but you could use the code I have given you. If you have something similar to this, then you won't even need to define the paragraph. There are functions you can use instead of the if statements, but this will get you started.

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


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
August 23, 2012, 02:07 PM
jbmuir
Here's a styling example from the WebFOCUS documentation that may help you:

TABLE FILE GGSALES
ON TABLE SET PAGE-NUM OFF
SUM UNITS AND DOLLARS
BY CATEGORY BY REGION
HEADING
"Regional Sales Report"
"Click here to access the IB homepage."
" "
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $ 
TYPE=HEADING, LINE=2, OBJECT=TEXT, ITEM=1,
   URL=http://www.ibi.com, $
ENDSTYLE
END



WF 7.1.6 moving to WF 7.7, Solaris 10, HTML,PDF,XL
August 28, 2012, 03:23 PM
phoenixfox
All of this is very helpful. Thank you and let me see what I can come up with.


WebFOCUS 7.6
Windows, All Outputs
August 28, 2012, 04:38 PM
phoenixfox
I was so close. I have my define stmts as such.
-********************************************
hyperlink/A150='Residency Determination Office';
open_caret/A1='<';
closed_caret/A1='>';
full_link/A200=open_caret || 'A source=' || hyperlink || 'closed';
-*********************************************
However, when I try to concatenate the text within the defined paragraph, it fails. What am I missing. I know I am so close.


WebFOCUS 7.6
Windows, All Outputs
August 28, 2012, 04:58 PM
Francis Mariani
Are you complicating things?

DEFINE FILE CAR
hyperlink/A150='<a href="http://resdetermination.uncc.edu" target="_blank">Residency Determination Office</a>';
END

TABLE FILE CAR
SUM 
SALES
hyperlink
BY COUNTRY
END

(Please always use code tags when posting code, because we cannot see your html.

[code]
your code here
[/code]



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
August 28, 2012, 05:05 PM
Francis Mariani
Updated to include a paragraph:

DEFINE FILE CAR
hyperlink/A150='<a href="http://resdetermination.uncc.edu" target="_blank">Residency Determination Office</a>';
paragraph/A1000=
  'This is my paragraph. There is a country that requires a visit to the' ||
  (' ' | hyperlink || ', from where you may apply for a visa.');
END

TABLE FILE CAR
SUM
SALES
paragraph
BY COUNTRY
END



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
August 29, 2012, 08:18 AM
phoenixfox
Francis, you're great. I believe I was complicating things because I was getting so many different ways to do the link from many different people. I'm going to try your example since you showed how to concatenate within the paragraph. That was the part I was confused on. Thanks. I'll let you know if I do it right.


WebFOCUS 7.6
Windows, All Outputs
August 29, 2012, 08:54 AM
phoenixfox
Here is my defined paragraph. The concatenation is still not working.
DEFINE
PARAGRAPH3/A1000 = IF F8 EQ 'RE_SD2' THEN 'Your residency for tuition purposes is ' | RES_STAT || '. If you feel this incorrect, you must fill out a residency application and submit it to the ' ' | hyperlink || '.'
ELSE ' ';
END


The report will run by the link is still not there.


WebFOCUS 7.6
Windows, All Outputs
August 29, 2012, 09:10 AM
phoenixfox
Correction. The paragraph prints like such:
"Your residency for tuition purposes is Out-Of-State. If you feel this incorrect, you must fill out a residency application and submit it to the Residency Determination Office."


WebFOCUS 7.6
Windows, All Outputs
August 29, 2012, 09:12 AM
phoenixfox
Ignore that last entry. The HTML converted itself. It actually prints with all the html code. If only it would convert in Excel. Is there a setting that I need to use? I'm almost there.


WebFOCUS 7.6
Windows, All Outputs
August 29, 2012, 09:46 AM
Francis Mariani
Please provide the full define and table file code, within code tags.

This message has been edited. Last edited by: Francis Mariani,


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
August 29, 2012, 11:03 AM
phoenixfox
DEFINE FILE STEP2
hyperlink/A150='<a href="http://resdetermination.uncc.edu" target="_blank">Residency Determination Office</a>';
PARAGRAPH3/A1000 =  IF F8 EQ 'RE_SD' THEN 'Your residency for tuition purposes is ' | RES_STAT || '. If you feel this incorrect, you must fill out a residency application and submit it to the'  || ' ' | hyperlink ||' . '
ELSE '';
END
TABLE FILE STEP2
PRINT
NAME
ID
PARAGRAPH3
END



WebFOCUS 7.6
Windows, All Outputs
August 29, 2012, 11:27 AM
GamP
Did you mean to indeed hold this in Excel?
There is a possibility to port hyperlinks to excel, but it will mean that the entire cell will become a hyperlink, not just some few words in the cell, unless I'm mistaken. Consider this bit of code:
DEFINE FILE CAR
hyperlink/A150='<a href="http://resdetermination.uncc.edu" target="_blank">Residency Determination Office</a>';
PARAGRAPH3/A1000 =  IF COUNTRY EQ 'ENGLAND' THEN 'Your residency for tuition purposes is ' | 'Out-Of-State' ||
                    '. If you feel this incorrect, you must fill out a residency application and submit it to the'  ||
                    ' ' | hyperlink ||'.' ELSE 'Ok';
END
TABLE FILE CAR
PRINT
COUNTRY
PARAGRAPH3
ON TABLE HOLD FORMAT HTML
END
SET HTMLFORMTYPE=XLS
-RUN
-HTMLFORM HOLD
-RUN
Maybe someone else can take it from here and get you what you need?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
August 29, 2012, 02:12 PM
phoenixfox
Well, GamP, you are on to something. When I added the piece below to the end of my script, the output was HTML and the link was there. Perfect. Except I really needed the output to be in Excel. I'm learning something new everyday. Thanks

ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
END



WebFOCUS 7.6
Windows, All Outputs
September 07, 2012, 01:52 PM
phoenixfox
THIS THREAD IS COMPLETE. I STILL DIDN'T GET IT TO PRODUCE EXCEL OUTPUT WITH THE LINK IN IT BUT I GIVE UP. THANKS


WebFOCUS 7.6
Windows, All Outputs
March 29, 2018, 04:38 PM
Francis Mariani
See Excel and URLs with Ampers


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