Focal Point
Using Image Map, how to include output value in link

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

September 14, 2007, 04:29 PM
<M_RIOS75>
Using Image Map, how to include output value in link
We are using an image map of US. When someone clicks on a state, such as FL, they drill down to a report for that state. This is working but we would like to add an output control so the user can select from PDF, EXCEL, etc.

The trick here is somehow grabbing that output value from that control and inserting it into the URL I've created to pass to the fex.

This is where we are stuck. We can always add a link onto the HTML report output to dump it to another output, but we'd like the option on the initial launch page. Any suggestions??
September 14, 2007, 04:42 PM
FrankDutch
You can put the amper value in the start of the launch page and pass that chosen value with the link to the sub report.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

October 16, 2007, 05:08 PM
<M_RIOS75>
Ok.. I think I understand what your saying here, I think my next question really is, How?
October 16, 2007, 05:31 PM
Francis Mariani
How is your URL being built when clicking on the image map?


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
October 16, 2007, 06:19 PM
<M_RIOS75>
The URL is static within the HTML Code. To append to this URL seems really tricky. Looking into this issue further, looks like my approach may need to change here.

I am trying to include the onclick function within my link to retrieve the value from the dropdown box.
October 16, 2007, 07:32 PM
Francis Mariani
OK, here's an example using an image map. I apologize for the large image - it's from wikipedia.

<HTML>
<HEAD>
<TITLE>New Document</TITLE>
<script language="JavaScript">
function RunReport(Province)
{
document.form1.PROVINCE.value = Province;
document.form1.submit();
}
</script>
</HEAD>

<BODY marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" style="margin: 0px;">

<form name="form1" action='/ibi_apps/WFServlet' method='get' target="ReportWindow">

<input type="hidden" name="IBIF_focexec" value="dummy1">
<input type="hidden" name="PROVINCE" value="">
<input type="radio" name="OUTPUT" value="PDF" checked>PDF<input type="radio" name="OUTPUT" value="HTML">HTML<input type="radio" name="OUTPUT" value="EXL2K">Excel<br>

<A HREF="canada.map"><img src="http://upload.wikimedia.org/wikipedia/commons/2/2a/Map_Canada_political-fr.png" ISMAP USEMAP="#provinces" style="border-style:none"></a>

<map id="provinces" name="provinces">
<area shape="circle" alt="" coords="167,415,94" nohref onClick="RunReport('YUKON');" title="" />
<area shape="circle" alt="" coords="529,480,134" nohref onClick="RunReport('NUNAVUT');" title="" />
<area shape="circle" alt="" coords="708,836,100" nohref onClick="RunReport('ONTARIO');" title="" />
<area shape="circle" alt="" coords="882,755,107" nohref onClick="RunReport('QUEBEC');" title="" />
<area shape="circle" alt="" coords="305,695,60" nohref onClick="RunReport('ALBERTA')" title="" />
<area shape="default" nohref="nohref" alt="" />
</map>
</form>
</BODY>
</HTML>



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
October 17, 2007, 03:01 AM
Tony A
The important item here is to have a form control with a name attribute that you will use as the amper variable name within WebFOCUS.

In his example Francis has called his OUTPUT and used radio 'button' controls to provide the User with their choices. It could as easily be a SELECT (combo box) control. -

<select name="WFFMT">
 <option value="PDF">Printable Output</option>
 <option value="HTML">Display Output</option>
 <option value="EXL2K">Datasheet Output</option>
</select>

Note: I know that the closing option tag is not strictly necessary but older versions of Netscape used to require it and old habits die hard Wink.

Incidently, within the GUI, if you choose USER as the output format the variable &WFFMT is used. For consistancy I use this as the variable name within all the fexes that I write that have multiple output formats.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
October 17, 2007, 11:42 AM
<M_RIOS75>
Thanks Francis! Using your suggestions with some minimal tweaking is getting pretty much what I need. I ran into a little confusion when trying to add additional forms but I think I'll be ok. I need to add some additional report filters (product codes). This does pose the question..I am populating the radio button/drop downs as static values, how could I populate a dropdown from a data source and still pull it into my link?

Thanks Tony as well, I tried your suggestion for a different value I need to pass.

I'll post the "final" code when I get there.
October 17, 2007, 12:39 PM
Francis Mariani
quote:
how could I populate a dropdown from a data source and still pull it into my link


I assume you're doing this by coding it, not by using the DevStudio GUI. The easiest way to populate a dropdown list from a data source would be to create a HOLD file that contains the options and then embed the HOLD file in the HTML.

Something like this very basic example:

TABLE FILE CAR
SUM
COMPUTE SELDATA/A100 =
'<OPTION VALUE="' || COUNTRY || '">' || COUNTRY  || '</OPTION>';
BY COUNTRY        NOPRINT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS S_LEVEL1 FORMAT ALPHA
END
-RUN

-HTMLFORM BEGIN
<select name="SELECT1" size="1">
  <option value=ALL>ALL</option>
  !IBI.FIL.S_LEVEL1;
</select>
-HTMLFORM END

Marvin, would you mind reading this posting, Friendly reminder: Please update your signatures, it will help knowing what version and platform you develop on.

Cheers,


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
October 17, 2007, 01:45 PM
<M_RIOS75>
Poking around I was able to get a drop down to populate from a data source and integrate it into my form tag. I am still somewhat new to this..thanks for the help!

SELECT id=COMMODITY style="Z-INDEX: 5; LEFT: 200px; WIDTH: 50px; POSITION: absolute; TOP: 40px" tabIndex=1 name=COMMODITY sourcetype="typeMaster" datafieldtype="VARCHAR" datatype="1" operation="NONE" addalloption="0" datafield="DXCMCD" displayfield datasource="FRSMLL1.MAS" ibic_server="EDASERVE" ibiapp_app="#" IBIMR_folder="#salesreporti">
October 17, 2007, 01:49 PM
Francis Mariani
You're welcome.


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
October 29, 2007, 11:30 AM
<M_RIOS75>
Another curveball thrown was they wanted to hover over states and see the % of total sales. We did this by using the HTMLFORM commands and populating the amper value (&WA_STRING) within ALT. It came out good, thanks all again.
October 29, 2007, 04:09 PM
Francis Mariani
You may also wish to use the "title" attribute as per this article: Net Mechanic - HTML Tip: Using ALT And TITLE Attributes


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
November 05, 2007, 10:51 AM
Spence
francis,
i've tried running your example and i can not get the fex (dummy) to run. i did create a fex named dummy, when i click on a provinces YUKON the fex dummy is not found. what am i missing here?


WF 8 version 8.2.04. Windows.
In focus since 1990.
November 05, 2007, 03:56 PM
Francis Mariani
The fex dummy has to be in an App folder that's part of the app path.

If you're doing this in MRE, quite a few more parameters are required, like domain name, folder name, etc.


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
November 05, 2007, 04:26 PM
Spence
i'm just running this in dev studio


WF 8 version 8.2.04. Windows.
In focus since 1990.
November 05, 2007, 04:37 PM
Francis Mariani
Yes, but where are the programs stored? DevStudio points to APP folders and MRE Domains.


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
November 06, 2007, 09:05 AM
Spence
i needed to have the dummy.fex in a mre domain.
thanks for your help.


WF 8 version 8.2.04. Windows.
In focus since 1990.
November 06, 2007, 09:40 AM
Francis Mariani
Spence, the quickest way to determine what MRE parameters are required for a fex is to Publish it. This creates an HTML file with the required form parameters. Then you can simply copy these parameters into the Image Map HTML file. To make things easier, I'd put the Image Map HTML file in the same domain as the executed fex.


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