Focal Point
Display the report name in the HTML page dynamically based on a field

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

January 21, 2015, 05:27 AM
info4pal
Display the report name in the HTML page dynamically based on a field
Hi,

Is there a way to display the report heading in a HTML page dynamically based on some field
value in the report :

Say this is the sample code :
TABLE FILE CAR
PRINT COUNTRY
END
-RUN
-EXIT

Say assuming that COUNTRY field has only 1 value and this value keeps on changing in the database and I need this field value
to be used as the report name in the HTML page.I tried using a textbox and other controls
but nothing is working.

Any hints/ideas on how to do this is appreciated.

Thanks a lot in advance.

Regards!


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
January 21, 2015, 07:36 AM
MartinY
Have you tried assigning the value to a variable and then display it ?

Something such as (still assuming that COUNTRY as only one value):
TABLE FILE CAR
BY COUNTRY
WHERE RECORDLIMIT EQ 1;
ON TABLE HOLD AS TITLVAL FORMAT BINARY
END
-RUN
-READFILE TITLVAL
-RUN

-SET &#RPTTITLE = &COUNTRY;

-HTMLFORM BEGIN
<HTML>
<HEAD>
<TITLE>!IBI.AMP.#RPTTITLE;</TITLE>
</HEAD>
<BODY style="OVERFLOW: auto" thumbnailscale="4" elementtype="21" edaconnectionrequired="false">
<SPAN tabIndex=1 id=text1 style="HEIGHT: 40px; WIDTH: 300px; POSITION: absolute; LEFT: 130px; Z-INDEX: 1; TOP: 40px">!IBI.AMP.#RPTTITLE;</SPAN>
</HTML>
-HTMLFORM END



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
January 21, 2015, 07:47 AM
Danny-SRL
You could also insert the value into TITLETEXT:
  
TABLE FILE CAR
BY COUNTRY
WHERE COUNTRY EQ 'ENGLAND';
ON TABLE HOLD AS TITLVAL FORMAT BINARY
END
-RUN
-READFILE TITLVAL
-RUN
TABLE FILE CAR
WHERE COUNTRY EQ 'ENGLAND';
PRINT SALES 
BY CAR BY MODEL BY BODYTYPE
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='&COUNTRY',$
ENDSTYLE
END




Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

January 21, 2015, 07:47 AM
info4pal
Hi Martin,

Thanks a lot for the quick response.
But unfortunately am using the HTML Composer and is there any way to do it in the HTML Composer which is linked to the fex.

Please let me know.

Thanks!


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
January 21, 2015, 07:49 AM
info4pal
Hi Danny,

Thanks for the quick response as well.
Iam actually trying to add an Report heading in HTML page based on a field's value in a table.

Hope Iam clear.

Thanks!


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
January 21, 2015, 07:56 AM
Ram Prasad E
Check below code. It will give you an idea.
TABLE FILE CAR
BY COUNTRY
WHERE READLIMIT EQ 1;
ON TABLE HOLD FORMAT ALPHA
END
-RUN
-READ HOLD &RPT_TITLE.A10.
-SET &COUNTRY = &RPT_TITLE;
-TYPE &RPT_TITLE

TABLE FILE CAR
PRINT
*
WHERE COUNTRY EQ '&COUNTRY';
HEADING
"Report Title : &RPT_TITLE"
""
ON TABLE SET PAGE-NUM NOLEAD
END




WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
January 21, 2015, 08:32 AM
info4pal
Hi Ram,

Thanks for the response.
Iam actually trying to print &RPT_TITLE as the report heading in the HTML page.

Hope Iam clear now.

Thanks a lot in advance!


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
January 21, 2015, 08:48 AM
Tony A
As this is via HTML composer, I would suggest using an AJAX routine to execute a report that will return the value that you want and then insert that into the TITLE component of the DOM.

The jQuery code to change the title component is -
    $(document).ready(function() {
        document.title = 'blah';
    });


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 
January 21, 2015, 08:53 AM
Rifaz
quote:
But unfortunately am using the HTML Composer and is there any way to do it in the HTML Composer which is linked to the fex.


May help, check this out.
Passing parameters by URL in HTML Composer


-Rifaz

WebFOCUS 7.7.x and 8.x
January 22, 2015, 08:30 AM
MartinY
Hi,

My solution does work in HTML Composer. I gave you a HTML form just to show you my technique.

1- In the default domain, open HTML Composer (saved as myhtml.htm per example)
2- Add a text field
3- As the text in the text field put:
!IBI.AMP.#RPTTITLE;

4- Create a fex with the following:
TABLE FILE CAR
BY COUNTRY
WHERE RECORDLIMIT EQ 1;
ON TABLE HOLD AS TITLVAL FORMAT BINARY
END
-RUN
-READFILE TITLVAL
-RUN

-SET &#RPTTITLE = &COUNTRY;

-* syntax for version 8
-HTMLFORM IBFS:/WFC/Repository/DefaultDomain/std_reports/report/myhtml.htm

6- Execute fex in -5-

You should have your text field displaying the variable value.

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


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007