Focal Point
[CLOSED]Pass fex variable to javascript variable of HTML composer

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

January 25, 2018, 12:51 AM
wyp
[CLOSED]Pass fex variable to javascript variable of HTML composer
Can I pass the value of fex variable to javascript variable of HTML composer ?

If "YES", explain me how to do with sample code.

Please help me.

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


WebFOCUS 8.1.05M
Windows, Excel , CSV Outputs
January 25, 2018, 01:05 AM
Chaudhary
You can take a control on your HTML page and bind that control using the fex file.
And using java script can retrieve that controls value


WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) ,
8.2.0.1M , 8.2.0.2 (App-Studio8.2.x),
InfoAssist/+, InfoDiscovery
Output format:-AHTML, PDF, Excel, HTML
Platform:-Windows 7, 8,10
January 25, 2018, 03:40 AM
wyp
Thanks for your reply.

What I want to do is that I want to pass &RECORDS or &LINES to the HTML Composer after run the report.

Although I bind the fex file with my HTML composer, I can't find the &RECORDS or &LINES in parameter tag.

So, how can I retrieve like these values from the js of HTML composer ?


WebFOCUS 8.1.05M
Windows, Excel , CSV Outputs
January 25, 2018, 08:36 AM
Chaudhary
you can try like this and bind your HTML control with LINECOUNT

 TABLE FILE CAR
BY  CAR.COMP.CAR
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS LINECNT

END
-SET &LIN = &LINES;


TABLE FILE LINECNT
SUM COMPUTE LINECOUNT/D20 = &LIN;
CAR NOPRINT
ON TABLE PCHOLD AS LINECNT
END



WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) ,
8.2.0.1M , 8.2.0.2 (App-Studio8.2.x),
InfoAssist/+, InfoDiscovery
Output format:-AHTML, PDF, Excel, HTML
Platform:-Windows 7, 8,10
January 25, 2018, 08:41 AM
Chaudhary
you can try this also if you don't have any where clause in your table file request ,

 
DEFINE FILE CAR 
CNT/D20 = CNT+1;
END

TABLE FILE CAR
SUM
MAX.CNT AS LINECOUNT
CAR.COMP.CAR NOPRINT
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XML
END
 



WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) ,
8.2.0.1M , 8.2.0.2 (App-Studio8.2.x),
InfoAssist/+, InfoDiscovery
Output format:-AHTML, PDF, Excel, HTML
Platform:-Windows 7, 8,10
January 28, 2018, 08:53 PM
wyp
Thanks for your suggestion. But I need to try another way for my report. Sweating


WebFOCUS 8.1.05M
Windows, Excel , CSV Outputs
January 29, 2018, 08:22 AM
Frans
  
TABLE FILE CAR
BY COUNTRY
ON TABLE HOLD
END
-SET &MYLINES = &LINES;

-HTMLFORM mycomposer.htm


Then in your composer file include the variable like this:
var lines = "!IBI.AMP.MYLINES;";


You can also use it in properties, not only javascript.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.