I have an htm launch page to execute several procedures. I would like to use a drop down list to select a value that will be used in reports in several other procedures. My drop down list is populated by a procedure and has 2 fields: source_code (return value) and source_name (displayed value).
When I select a source_name in the list I would like the other procedures to use the related source_code in the reports.
E.g.: I select source_name1 in the drop down list, my next procedure should return source_code1 in a field named srce_code.
Does anyone know if there is a way to this?This message has been edited. Last edited by: FP Mod Chuck,
WebFOCUS 8.1.0.5 Windows 10 xls, csv, dbf
March 12, 2020, 11:35 AM
FP Mod Chuck
Mathijs
When you look at the settings tab for the drop down list there you are referencing a dynamic / Explicit (Requests panel) which is your procedure and then you reference the source_code for the 'Value From' and source name for the 'Display From'. By default it will display the source_name and pass the source_code to the fex unless you click the checkbox to tell it to send the Display Value. Are you not seeing that behavior?This message has been edited. Last edited by: FP Mod Chuck,
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
March 13, 2020, 05:41 AM
Mathijs
Hi Chuck,
Yes I did configure the drop down that way. What I don't know is how to retreive the source_code and use it in a report as a new field.
A while ago I did something similar and used the drop down to send a value to a report in a where that looked like this:
TABLE FILE DELIVERYHOLD PRINT DELIVERYHOLD.DELIVERY.CROP_YEAR DELIVERYHOLD.DELIVERY.DELIVERY WHERE DELIVERYHOLD.DELIVERY.DELIVERY EQ &DELIVERY.(OR(FIND DELIVERY.SEG01.DELIVERY IN delivery)).Select date(s).; ON TABLE SAVE FILENAME '/Reports/report.xls' FORMAT EXCEL ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = endeflt, $ ENDSTYLE END
Today I would like to do something like this:
TABLE FILE CHECK1 BY YEAR BY COUNTRY BY SOURCE_CODE ON TABLE HOLD END
SOURCE_CODE being the value selected in the drop down list but I don't know the syntax.This message has been edited. Last edited by: Mathijs,
WebFOCUS 8.1.0.5 Windows 10 xls, csv, dbf
March 13, 2020, 11:38 AM
FP Mod Chuck
Mathijs
That drop down has a parameter associated with it, click on the parameters tab in the html composer. You simply add a WHERE statement to your code WHERE SOUCRCE_CODE EQ '&SOURCE_CODE' or whatever that parameter name is called. Remember they are case sensistive.
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
March 13, 2020, 01:41 PM
Hallway
quote:
Today I would like to do something like this:
TABLE FILE CHECK1
BY YEAR
BY COUNTRY
BY SOURCE_CODE
ON TABLE HOLD
END
SOURCE_CODE being the value selected in the drop down list but I don't know the syntax.
Just put the variable after the BY, and link that variable to the control
-DEFAULT &RETURN_VALUE = 'FOC_NONE';
TABLE FILE CHECK1
BY YEAR
BY COUNTRY
BY &RETURN_VALUE
ON TABLE HOLD
END
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
March 19, 2020, 11:12 AM
Mathijs
Chuck,
I have added WHERE SRCE_CODE EQ '&Source'; to my script but is asks to 'specify values for all parameters'.
Hallway,
I did this but it only displays year, not &Source:
-DEFAULT &Source = 'FOC_NONE';
TABLE FILE CHECK1 BY CHECK1.SEG01.YEAR BY &Source ON TABLE PCHOLD FORMAT HTML END
WebFOCUS 8.1.0.5 Windows 10 xls, csv, dbf
March 19, 2020, 12:03 PM
FP Mod Chuck
Mathijs
Please post your entire fex code with the WHERE I asked you to put in.
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
March 20, 2020, 06:58 AM
Mathijs
Chuck,
Here is my code:
TABLE FILE CHECK1 BY CHECK1.SEG01.YEAR WHERE SRCE_CODE EQ &Source; ON TABLE PCHOLD FORMAT HTML END
WebFOCUS 8.1.0.5 Windows 10 xls, csv, dbf
March 20, 2020, 10:59 AM
FP Mod Chuck
Mathijs
Well it can't get simpler than that.. Add this code to the top
-SET &ECHO=ALL;
Also try
WHERE SRC_CODE EQ '&Source';
And lastly put this before the TABLE FILE -DEFAULTH &Source='_FOC_NULL';
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
March 23, 2020, 08:51 AM
Mathijs
Hi Chuck,
It is still not showing the right field. Does it have to be in a form ?
-SET &ECHO=ALL;
-DEFAULTH &Source='_FOC_NULL';
TABLE FILE CHECK1 BY CHECK1.SEG01.YEAR WHERE SRCE_CODE EQ &Source; ON TABLE PCHOLD FORMAT HTML END
WebFOCUS 8.1.0.5 Windows 10 xls, csv, dbf
March 23, 2020, 11:01 AM
FP Mod Chuck
Mathijs
Yes that code looks correct. Is it displaying a report? If so right mouse click on the output and choose view source option. At the bottom you should see the code that was executed with the &Source parameter value displayed. If the code is not what you expected in the html composer for that page is the run button tied to the correct report fex? Just to be sure in the Requests and Data Sources tab remove the fex and re-add it as a External Request to make sure it is using the most current copy. You will then have to go under the tasks and animation tab and select the run button and make the task option run the request
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats