Focal Point
OUTPUT OPTION

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

March 01, 2006, 03:21 PM
chelsea
OUTPUT OPTION
HI,
i have a report and its output is html. i need to add a button to this output and when the user clicks the button the same report must appear in pdf.is there a way to achieve this .
thanks
March 01, 2006, 03:42 PM
reFOCUSing
Yes,
You will need to pass a variable from the GUI.
In the following example the value of &OUTPUT will need to be HTML or PDF.

TABLE FILE CAR
SUM
     RETAIL_COST
BY
     COUNTRY
ON TABLE PCHOLD FORMAT &OUPUT
END


Also do a search there should be other example of this on here.
March 01, 2006, 04:21 PM
chelsea
Hi reFocusing,
thanks for your reply but thats not the way i want.
user selects options and based on those options report is generated and the output of this report is html.now after viewing the report output to enable the user to take the print out of the output i need to create a button/link in the report which on clecking should display the same data in pdf format(printer version).
thanks
March 01, 2006, 05:14 PM
jimster06
To elaborate on reFOCUSing's suggestion, I have seen HTML reports that have included buttons for EXCEL and/or PDF output formats somewhere on the report such that the report (fex) is re-executed with the chosen format.


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
March 02, 2006, 12:04 PM
k.lane
If you're not too concerned with using button to press, I have used icons for both Excel and PDF that I add to the footing of a report. They have drilldowns associated with them in the stylesheet. When the user clicks on the icon, the report is produced in either Excel or PDF accordingly.

However, I have experiemented with buttons and there's no problem adding them. I just haven't had the opportunity to try to get them to execute a report.

Ken


Prod - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE
Dev - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE
Databases: Oracle 10g, SQL Server 2000, DB2.
March 02, 2006, 12:18 PM
chelsea
Hi k.lane
can you please send me the sample code of what you have done in your report so that i can try to use it and see if it works.
Thanks
kiran
March 02, 2006, 12:32 PM
k.lane
This works:

-DEFAULT &OUTPUT = 'HTML' ;

TABLE FILE CAR
SUM SALES
COMPUTE PDFIMAGE /A160 = '~img border=0 src=' || '''' ||
'http://SERVERNAME/approot/APPNAME/images/s_pdf.gif' ||
'''' || '>~/img>'; NOPRINT
BY CAR
-IF &OUTPUT EQ 'PDF' THEN GOTO NOFOOT ;
FOOTING
"-NOFOOT
ON TABLE SET STYLE *
TYPE=FOOTING, FOCEXEC=a1(OUTPUT='PDF'),$
ENDSTYLE
ON TABLE PCHOLD FORMAT &OUTPUT
END


where,

~ - The left caret.

a1 - the name of this focexec. It will drill into itself.

SERVERNAME - server
APPNAME - DS appname

Of course, it's dependent upon how things are organized in your installation.

But, this should give you the jist of what I was referring to.

I'd really be interested in the button method, but I just don't have the time to look into it.

Ken


Prod - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE
Dev - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE
Databases: Oracle 10g, SQL Server 2000, DB2.
March 13, 2006, 04:01 PM
chelsea
thanks ken, i am now able to create the link and this should be enough for now and i am trying the button option and if it works i will post that too.once again thanks for your suggestion
March 14, 2006, 09:59 AM
Tony A
Kiran,

The method I use involves calling JavaScript but could easily be set up to point at an HRef instead.

BUTTONS/A320 = ' || ' title="Report in Excel Format" onClick=openReport("application","report","EXL2K")>'
|| ' || ' title="Report in PDF Format" onClick=openReport("application","report","PDF")>';


The JavaScript function just creates a new window without certain toolbars etc. and would need to be included into your fex using SET JSURL. It could be extended to expect any number of parameters.

function openReport(app,fexname,format) {
URL = "/cgi-bin/ibi_cgi/ibiweb.exe?IBIAPP_app="+app+"&IBIF_ex="+fexname+"&Format="+format;
OpenWin = this.open(URL, "_blank", "toolbar=no,menubar=no,location=no,scrollbars=yes,status=no,resizable=yes");

}

T

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



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