Focal Point
[SOLVED] Pass user Text to the Fex Using a Text Area to use in Heading

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

May 09, 2018, 03:54 PM
iBeny
[SOLVED] Pass user Text to the Fex Using a Text Area to use in Heading
Hi Experts,

I am trying to create Launch Page on which i have given 2 Text Areas to the Users (Heading Notes and Footing Notes). I would be using the text typed in them in an ahtml report's SUBHEAD and SUBFOOT.
I am pre-populating the Heading Notes Text Area using a javascript function, What text should be displayed is being decided on selection of Report name and Language.
Using below code (I used \n because i want below 2 different lines :
else if ((document.getElementById('combobox1').value == 'pi') && (document.getElementById('combobox2').value == 'en'))
{
document.getElementById('textarea1').value = '" Private Equity Relationships Established as at September 30, 2017"\n' + '"All Figures as at September 30, 2017 (except where footnoted)"';
}


I have format the text with the Double Quotes so that this can be mapped to a Dialog Manager variable and i can directly use it in the SUBHEAD section.

When i pass this variable in the SUBHEAD, only the First line is getting Printed and rest of the lines are not being picked up.

However when i try to -TYPE &HEAD, it gives:

"Private Equity Relationships Established as at September 30, 2017" "All Figures as at September 30, 2017 (except where footnoted)"

I cannot attach the pictures to show what's happening, Can you think of a way i can achieve this and Create the Heading on the Fly using User input?

This message has been edited. Last edited by: FP Mod Chuck,


Webfocus 8105,8808,7703,7611, EXL2K,HTML,PDF,COMT,AHTML Info Assist+ , Reportcaster
May 10, 2018, 07:41 AM
MartinY
« \n » is only recognized by the HTML not in Focus SUBHEAD, so if you still want to proceed that way, I suggest that you create 2 DM variable that will be passed to your report.

First var for first SUBHEAD line
Second var for second SUHEAD line

Also you should not need to include the double quotes.


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
May 10, 2018, 09:52 AM
iBeny
Hi MartinY,

Thanks for your reply, However this is One Example, Number of Subhead Lines can change from 2 to 8 as i am giving user a Text Area to input whatever he wants to see in the Subhead, How can i preserve the formatting?

I am passing this text in the On TABLE SUBHEAD.
Can you think of a way by which i can achieve this?

Also each line in the heading should have Double Quotes, i can use use "&HEAD.EVAL" though.


Webfocus 8105,8808,7703,7611, EXL2K,HTML,PDF,COMT,AHTML Info Assist+ , Reportcaster
May 10, 2018, 11:27 AM
MartinY
How would you know how many lines you (should) have ?


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
May 10, 2018, 02:01 PM
TexasStingray
A trick you could use is when the user click the run button.

1. using javascript capture the value in a variable.
2. copy the it into a new variable replacing the "\n" with a
"</1>"

3 set the input box to this new value.
4. Send it to WebFOCUS
5. Set the input back to the first variable, thus restoring what the user typed.




Scott

This works for me in WF8201.

-SET &HEAD = '"Heading 1" "Heading 2" "Heading 3"' ;
-SET &HEAD = REPLACE(&HEAD, '" "', '"'|CHAR(13)|'"');
 TABLE FILE GGSALES
 &HEAD
 SUM UNITS 
 BY REGION
 END 
In older releases you will have to use functions STRREP() and HEXBYT().


WebFOCUS 8.2.06
Thank you Gurus for your inputs.
@dbeagan: as i am currently on 8.0.8 (used 8201 in last organization Wink ) i used STRREP and HEXBYT() to achieve the same, I have used ~ as a delimiter and instructed the user to use this wherever they need a new line in there text.
I'll sure keep in mind the REPLACE Function for future.


Webfocus 8105,8808,7703,7611, EXL2K,HTML,PDF,COMT,AHTML Info Assist+ , Reportcaster