Focal Point
Select Output Type in Dashboard/MRE Standard Report

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

October 18, 2006, 10:39 AM
Jeff Elam
Select Output Type in Dashboard/MRE Standard Report
I'd like to allow users (from an HTML launch page as a parameter) to be able to select whether a standard report will be output in Excel, HTML or PDF. There are examples for how to do this in a self-service application (ibinccen Web Application), but I can't find one for how to do it in Dashboard/MRE. Can anyone provide sample HTML to do this?


Jeff Elam
WF 8 in Windows
October 19, 2006, 07:20 AM
Tom Flynn
Here is a RADIO button example:

= BR>

= P>= B>= U> Select Type of Report Output:= /B>= /P>= /U>



= TD> = INPUT NAME=TYPEBUS TYPE="RADIO" VALUE="PDF" CHECKED> PDF = /TD>

= TD> = INPUT NAME=TYPEBUS TYPE="RADIO" VALUE="HTML"> HTML = /TD>

= TD> = INPUT NAME=TYPEBUS TYPE="RADIO" VALUE="EXl2K"> EXCEL = /TD>

= TD> = INPUT NAME=TYPEBUS TYPE="RADIO" VALUE="EXL2K PIVOT"> EXCEL PIVOT = /TD>

= /BR>


Change the = space to < no space

Tom

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
October 19, 2006, 07:49 AM
Tony A
Jeff,

It is basically the same as for self service if you code manually.

Tom's suggestion is great if you only want to have a few formats available but using a combo will allow you to add more over time if necessary without having to think about repositioning your form objects.

Forgive me if this is too simplistic for you but I want to be able to provide something that will suit all Forum readers.

The first thing to decide is what variable name you are going to use within your WF proc - Don't forget that it will be case sensitive. Let's use an example of &Format. The part of the variable name without the ampersand is what the combos "name" attribute needs to be set to.

Next decide what values you will allow your end users to choose. Let's keep it simple and allow then HTML, PDF or basic Excel (EXL2K). These will be the values for the OPTION components of the combo but for clarity I would suggest giving the users something a little more meaningful. Suppose we tell them how they should use the output? HTML for displayed, PDF for printed and EXL2K for Data Sheet output.

OK, so that's the main pieces of our puzzle but if we add CSS to the package we can control Font (color, size, emphasis etc.) as well as positioning on screen. We also want to let them know what the combo box is for so surroundng the SELECT object with a SPAN we can keep both displayed text for the combo and the combo together.

Add all of this together and we have the HTML as follows -
<SPAN style="POSITION: absolute; TOP: 300px; LEFT: 30px; WIDTH: 100px; HEIGHT: 20px; FONT-WEIGHT: 400;
 FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: MS Sans Serif; BORDER-RIGHT-WIDTH: 0px">
  Output Format:
  <SELECT style="Z-INDEX: 19; POSITION: absolute; LEFT: 130px; WIDTH: 180px; HEIGHT: 22px; FONT-WEIGHT: 400;
 FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: MS Sans Serif;" name="Format">
    <OPTION value=HTML selected>Displayed</OPTION>
    <OPTION value=PDF>Printable</OPTION>
    <OPTION value=EXL2K>Data Sheet</OPTION>
  </SELECT>
</SPAN>


To position is on your screen anywhere just change the value of TOP and LEFT in the SPAN object to your requirements.

This should give you something like the combo below and when you submit your form the value of &Format should change accordingly.

Forgot to mention that you would code -

ON TABLE SET ONLINE-FMT &Format

to achieve the output in the format selected.

T

This message has been edited. Last edited by: Tony A,



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 
October 19, 2006, 07:54 AM
Tony A
Output Format:



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 
October 19, 2006, 05:09 PM
Jeff Elam
Thanks for the suggestions, guys. Would it be possible for you to post an example with the complete HTML page and a complete FEX? I'm using the publish method to create the HTML launch page, and I'm not sure how this fits in. Thanks, again.


Jeff Elam
WF 8 in Windows
October 25, 2006, 03:53 PM
Jeff Elam
In MRE, the only way I was able to get it to work was by building a launch HTML page after adding the parameter described above. It created an object for format. I was able to modify that object to suit my needs. This is what it looked like when I first create the launch page using the Publish feature in Dev Studio:

//===========================================================
jsData.ampers[i] = new Object( );
jsData.ampers[i].inForm = 0;
jsData.ampers[i].name = "Format";
jsData.ampers[i].fieldName = jsData.ampers[i].name;// "Field" + i;
jsData.ampers[i].type = "unresolved";
jsData.ampers[i].format = "";
jsData.ampers[i].min = "";
jsData.ampers[i].max = "";
jsData.ampers[i].strDef = "";

jsData.ampers[i].desc = "";

jsData.ampers[i].disType = "prompt";

i++;

//===========================================================

I modified it to look like the following:

//===========================================================

jsData.ampers[i] = new Object( );
jsData.ampers[i].inForm = 0;
jsData.ampers[i].name = "Format";
jsData.ampers[i].fieldName = jsData.ampers[i].name;// "Field" + i;
jsData.ampers[i].type = "unresolved";
jsData.ampers[i].format = "";
jsData.ampers[i].min = "";
jsData.ampers[i].max = "";
jsData.ampers[i].strDef = "";

jsData.ampers[i].desc = "Select report format:";

jsData.ampers[i].disType = "static";

j = 0;
jsData.ampers[i].values = new Array( );
jsData.ampers[i].display = new Array( );
if(jsData.ampers[i].operation != null){
jsData.ampers[i].values[j] = "FOC_ALL";
jsData.ampers[i].display[j] = "Select All";
j++;
}

jsData.ampers[i].values[j] = "HTML";
jsData.ampers[i].display[j] = "Screen";
j++;

jsData.ampers[i].values[j] = "PDF";
jsData.ampers[i].display[j] = "Acrobat";
j++;

jsData.ampers[i].values[j] = "EXL2K";
jsData.ampers[i].display[j] = "Excel";
j++;

i++;

//===========================================================


Jeff Elam
WF 8 in Windows