Focal Point
[CLOSED]HTML input into variable

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

November 11, 2015, 06:07 AM
SSander
[CLOSED]HTML input into variable
We have created WebFOCUS AdHoc tool for quick data testing - where you give him synonym and are abel to report on top of it. Good old - make everything into BY / SUM / ACROSS variables.
But now we have ended up in situation that end users have started using it even more widly and some Business Analyst know that we have "Relative dates" calculations on WebFocus session. Variables where we calculate different dates for example &THISYRMN (current year/month), &PRV_MNT_END (previouse month end), &YST_LST_YR (yesterday last year) etc. They have used these variables in InfoAssist where statements.
Now these business people are requesting that other not so advanced business users who use this AdHOC tool could be able to use these variables aswell, but now it seems WebFOCUS is not resolving these variables.

Quick example how its built up:
HTML passes &FILTERS variable to report and its value is following "WHERE YEARMONTH EQ '&THISYRMN'";

So everything seems OK but WebFOCUS is now thinking that &THISYRMN is string not variable - my idea was that this is either going to give me prompt or atleast replacing the "&THISYRMN" with correct value.

Anyway If anyone as idea or maybe can give me other idea how to solve this please respond.

Regards,

This message has been edited. Last edited by: <Emily McAllister>,


Release: WebFOCUS 8104, AppStudio: 8105
OS: Windows
Output: HTML,Excel,Active Reports
November 11, 2015, 07:39 AM
MartinY
Does &FILTERS is that variable that the user select ?
From where does &FILTERS is coming from ?
How does &FILTERS is generated ?

It looks for me that it has been generated as of something like this:
-SET &FILTERS = 'WHERE YEARMONTH EQ '''&THISYRMN''';

Try
-SET &FILTERS = 'WHERE YEARMONTH EQ '''&THISYRMN.EVAL''';



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
November 11, 2015, 07:50 AM
SSander
quote:
Originally posted by MartinY:

From where does &FILTERS is coming from ?
How does &FILTERS is generated ?

Im building this in JS:
Listbox with "FIELDS" then listbox with "OPERATORS" (EQ,NE,IN, etc) Inputfield or "Listbox" for values. So I take all these 3 html elements together and put it into another listbox what looks like
WHERE <field> <operator> 'value';


Ill give your idea try. Smiler


Release: WebFOCUS 8104, AppStudio: 8105
OS: Windows
Output: HTML,Excel,Active Reports
November 11, 2015, 08:19 AM
MartinY
If you want to pass/add the 'value' itself to your JS string, adding '.EVAL' will not return the value the WF. '.EVAL' is a WF operator, not a JS.

You will need to read the value first and then add it in your JS string.

Something such as (one solution, may have many more):
-* in HTML JS
inVal = '!IBI.AMP.THISYRMN;';

Then you can use inVal to build you JS string.

But if you're building your JS string to be:
FILTERS = 'WHERE <field> <operator> '&THISYRMN.EVAL';'

and it's the string that WF will receive (without quotes), then the '.EVAL' should work.

Will result in
TABLE FILE abc
PRINT ...
BY ...
&FILTERS
END


Where &FILTERS (as per you example) value will be: WHERE YEARMONTH EQ '&THISYRMN.EVAL';
and '&THISYRMN.EVAL' will then be evaluated on execution.


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
November 12, 2015, 03:16 AM
Dave
How's this:

( untesten, might contain typo's )

  
-PROMPT &TIMEFRAME_UI.(<Current yearmonth,1>,<Previous month end,2>,<Yesterday last year,3>).Timeframe.;

-SET &TIMEFRAME_WHERE = DECODE &TIMEFRAME_UI(
- 1 'WHERE YEARMONTH EQ '&THISYRMN'
- 2 '<whatever where goes with option 2>'
- 3 '<whatever where goes with option 3>');

TABLE FILE <yours>
...
...
&TIMEFRAME_WHERE
END



_____________________
WF: 8.0.0.9 > going 8.2.0.5