Focal Point
[SOLVED] mailto in report header

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

August 28, 2013, 03:13 PM
jshiley
[SOLVED] mailto in report header
I am trying to display a mailto link in a report header based off of data passed into the report via variables from the parent report. I tried this:

-SET &POCEMAIL = '<a href="mailto:' || &EVENTPOC_EMAIL || '">' || &EVENTPOC || '</a>';

SET NODATA = ''
-SET &ECHO='ALL';

TABLE FILE CL_CLASS_FILL_PENDING_SUPERVISOR_ACTION
PRINT
     CL_CLASS_FILL_PENDING_SUPERVISOR_ACTION.RS.STUDENT_NAME	AS 'NAME'
     CL_CLASS_FILL_PENDING_SUPERVISOR_ACTION.RS.ORGANIZATIONNAME  AS 'Organization'
     CL_CLASS_FILL_PENDING_SUPERVISOR_ACTION.RS.UIC	AS 'UIC'
     CL_CLASS_FILL_PENDING_SUPERVISOR_ACTION.RS.SUBUIC AS 'Sub-UIC'
     CL_CLASS_FILL_PENDING_SUPERVISOR_ACTION.RS.ORGSTRUCTURE AS 'Org Structure,Code'
     CL_CLASS_FILL_PENDING_SUPERVISOR_ACTION.RS.SUPERVISOR_NAME AS 'Supervisor'
     CL_CLASS_FILL_PENDING_SUPERVISOR_ACTION.RS.DAYSPENDING AS 'Days,Pending'
HEADING
"&REPORT_TITLE  "
"Report Date:  <+0>&REPORT_DATE "
" "
"Event Title: <+0>&EVENTTITLE "
"Event Start Date:  <+0>&EVENTSTARTDATE "
"Event Location:  <+0>&EVENTLOCATION "
"Event Host:  &EVENTHOST "
"Event POC: <+0>&POCEMAIL "



The error I get is "(FOC406) THE FIELDNAME IS NOT RECOGNIZED: a"

It appears that the

<a 

at the beginning of the tag is being interpreted as a field. Any suggestions?

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6.9
Windows
Excel, HTML, and PDF
August 28, 2013, 03:17 PM
Francis Mariani
Please put your code between
[code]
your code here
[/code]
tags, otherwise the HTML in your code gets interpreted by the browser.


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, 2013, 03:19 PM
Francis Mariani
Try using the concatenate character:
-SET &POCEMAIL = '<|a href="mailto:' || &EVENTPOC_EMAIL || '">' || &EVENTPOC || '<|/a>';



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, 2013, 03:47 PM
j.gross
You've got



which will evaluate to:
"Event POC: <+0><a href="mailto:someone@some.dom"> yada yada yada </a> "


Bad. First off, the open-quote before mailto will be interpreted by TABLE as closing the heading line.

Also, before that point, the '<' character, occurring within a heading or footing line, has significance to TABLE:
"<a "
is a directive to insert the value of the field named 'a' at that point -- hence the error message you received.

Just insert &EVENTPOC, unadorned, in the heading, and declare the mailto: hyperlink in the STYLE section.

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
August 28, 2013, 08:07 PM
jshiley
Thank-you Francis and Jack! Jack, your solution worked once I researched how to reference items in a header line within a stylesheet. Francis, I was already using a javascript function in the data section of the parent report that I had found from a different post of yours. I just didn't know I could use it for header items. Thanks again to both of you. The final code looks like this (&POCEMAIL is an email address passed in from the parent report):
HEADING
"&REPORT_TITLE  "
"Report Date:  <+0>&REPORT_DATE "
" "
"Event Title: <+0>&EVENTTITLE "
"Event Start Date:  <+0>&EVENTSTARTDATE "
"Event Location:  <+0>&EVENTLOCATION "
"Event Host:  <+0>&EVENTHOST "
"Event POC: <+0>&EVENTPOC "
" "
WHERE CL_CLASS_FILL_PENDING_SUPERVISOR_ACTION.INPUT.@SCHEDULEID EQ '&SCHEDULEID';
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &OUTPUTFMT
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = navyedacm,
$
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=LANDSCAPE,
$
TYPE=HEADING,
	LINE=8,
	ITEM=2,
	JAVASCRIPT=fnMail('&POCEMAIL'),
.....
ENDSTYLE
END
-HTMLFORM BEGIN
<SCRIPT LANGUAGE=JAVASCRIPT>
function fnMail(Email)
{
window.location = 'mailto: ' + Email;}
</SCRIPT>
!IBI.FIL.H001;
-HTMLFORM END



WebFOCUS 7.6.9
Windows
Excel, HTML, and PDF