Four Js Development Tools Forum

Discussions by product => Reporting tools (GRW, GRE) => Topic started by: Frances W. on February 22, 2015, 11:37:14 pm



Title: Use data in html
Post by: Frances W. on February 22, 2015, 11:37:14 pm
Apologies if this is painfully obvious, but how do you include data sent to the report in a html box? E.g. to display a reported date in bold in an otherwise plain text paragraph?

Thanks,
Frances


Title: Re: Use data in html
Post by: Romain W. on February 23, 2015, 04:08:04 pm
Hi Frances,

I guess the data is sent from the 4GL source code, right? You have to send an HTML code as a URL. For example:
In .4gl:
LET var="data:text/html,<HTML><BODY>This is a date: <B>" || TODAY || "</B> End</BODY></HTML>"
PRINT var

In .4rp:
Define a HTMLBox and specify 'var' as 'Text'

At runtime, you'll see the following in the generated report:
This is a date: 02/23/2015 End

Does it help? If not, can you tell me how you'd finally like the date to appear on the report document and what variable is sent from the 4GL source? Thanks.

Regards,
Romain W.


Title: Re: Use data in html
Post by: Frances W. on February 24, 2015, 01:43:02 pm
That's perfect, thank you.


Title: Re: Use data in html
Post by: Reuben B. on March 01, 2015, 10:36:43 pm
As per the documentation https://4js.com/online_documentation/fjs-gst-manual-html/#c_grd_layoutelements_htmlbox.html, you may wish to consider urlencoding the data.