Focal Point
[SOLVED] How to run the reports listed in the dropdown list

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

August 04, 2009, 03:52 PM
Puja Shetty
[SOLVED] How to run the reports listed in the dropdown list
Hi,

We have this new requirement where the user wants to be provided a list of
reports in the HTML dropdown list and when the user selects a particular report
in the dropdown and clicks ok,that report is run and displayed.

For eg,the user is provided with a list of report names in the dropdown like
ReportA,ReportB,ReportC and when the user selects ReportB and clicks Ok,The
ReportB runs and is displayed.Do you have any examples/code for this?

To start with ,I created a HTML page and tried to insert a dropdown list and
clicked on properties.I was populate this dropdown with static values like
ReportA,ReportB etc and click on Parameters tab in the properties and click on
static control values,I only see add ignore value or add values from external
file.How do I add values statically like ReportA,ReprtB

All your help and efforts towards this is highly appreciated.

Regards,
Puja

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


WebFOCUS 7.6.8
Linux
AHTML
August 04, 2009, 04:16 PM
Darin Lee
You will not be able to do this with the HTML painter. It is used for launching a specified procedure, passing the parameters that have been populated from that form.

However, there are several different ways you could accomplish this. You could create your own HTML page a couple of different ways to do what you need like just having a list of procedures that contains links that are the URL string to run a fex or you could use javascript to set the variables (like IBIMR_ex or IBIF_ex) needed to launch the procedure.

Probably the easiest way would be to have a shell fex that dynamically -INCLUDEs the appropriate fex based on the value of an &var that references the selected procedure. For example if you select reportA then you could-INCLUDE reportA. It always runs the same shell fex, but that fex includes different code based on what is selected. Now if you have to populate additional parameters for the individual procedures, it sounds like you need to come up with your own menuing application.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
August 04, 2009, 09:01 PM
Doug
As long as you have a funtioning fex that successfully does a -INCLUDE of an amperVARIABLE (wher "amperVARIABLE" is the legitimate name of a functioning fex), then you should be able to create a static dropdown list of fex names that gets passed to the calling procedure (the one with the "-INCLUDE amperVARIABLE" in it) which is executed via the "run button"... I've done it... And, oddly enough, I need to do it again for my current client in the next week or so.
August 05, 2009, 10:23 AM
Puja Shetty
Doug,Darin,

Thanks for your response.Could you provide me a sample code using INCLUDE amperVariable so that I get an idea of how to use it.I'm a newbie to webfocus and all your help with this is highly appreciated.

Regards,
Puja


WebFOCUS 7.6.8
Linux
AHTML
August 05, 2009, 11:35 AM
Tony A
One of the easiest methods (imho) is to create your combobox and set the values for the options to be the focexec names (e.g. report1.fex, report2.fex etc.). Then on form submission just change the value of IBIF_ex to be the value of the current combobox selection -

document.getElementById("IBIF_ex").value = document.getElementById("combobox1").value;

Simple and effective ... and ... (sorry Darin Wink) can be achieved quite easily from HTML painter (or what ever the name is this month Razzer).

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 
August 05, 2009, 11:39 AM
Darin Lee
Looks like you need to check out the documentation on -INCLUDE and Using Variables. The sample code would be a fex that has

-INCLUDE &fexname

where &fexname is populated from your launch page, It's evident that you need a little better understanding of how both of those concepts work. The information that Doug and I have given pretty much covers all that is necessary to get this to work, except for an understanding of those two basic concepts, which you need to get for yourself.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
August 05, 2009, 11:53 AM
Darin Lee
quote:
Simple and effective ... and ... can be achieved quite easily from HTML painter


As long as you know the necessary Javascript and how/where to use it. There isn't anything in the painter that would build this for you. The painter is just going to build you a static line that says

input type='hidden' name='IBIMR_fex' value="app/report1.fex"

Sounds like a good option, though. We also use a Javascript technique where the control has an onClick event which calls a function:
function RptSelect() {
if (document.form.RPTFEX[0].checked)
 {
document.form.IBIMR_fex.value="app/report1.fex";
    document.form.IBIF_ex.value="app/report1.fex";
 }
else
if (document.form.RPTFEX[1].checked)
 { document.form.IBIMR_fex.value="app/report2.fex";
    document.form.IBIF_ex.value="app/report2.fex";
 }
 }



Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
August 05, 2009, 12:02 PM
Puja Shetty
Thanks everyone.I shall try applying all your tips and advise.

Appreciate all your feedback.

Have a great week!
Puja


WebFOCUS 7.6.8
Linux
AHTML
August 05, 2009, 02:19 PM
Tony A
quote:
As long as you know the necessary Javascript and how/where to use it.
Darin,

That's where the forum comes into play - you just get someone to write the solution for you Wink Razzer

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 
August 05, 2009, 10:20 PM
Doug
Good One Tony... that's why I stopped where I did... As Darin said "The information that Doug and I have given pretty much covers all that is necessary to get this to work"... It covers it, right? I need to do something like this myself, and it'll all be done via HTML Layout Painter (I'm still in 713)... Does RTFM fit here?