Focal Point
Return a PDF that already exists

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

August 06, 2007, 11:24 AM
mgrackin
Return a PDF that already exists
I would like to be able to run a focexec and instead of create a report and then return it to the user, I would like to simply pull a PDF document that already exists and return that to the user instead. Does anyone know of a simple way to do this via a focexec? The PDF document is already in the APP PATH so all I need to know is how to grab it and return it to the user.

This is a self-serv application. No MRE or BID.

Something like:

-HTMLFORM pdfdocument


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
August 06, 2007, 02:11 PM
Tony A
Hey Mickey,

How about using a javascript onload trigger within the HTMLFORM to change the source to the PDF document? This would require that the document was available via a complete URL and therefore reside on the Client server rather than the Reporting server. You might be able to reference it OK if was on a network share.

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 06, 2007, 02:30 PM
mgrackin
Tony,

Thanks for the tip. I could do it this way but the reason why I want to pull it via a focexec and send it to the browser is because I am trying to, ahem, bypass security. Smiler

This is a self-serv(ing) application which I require a login. I use the WF COOKIE for the logon/credentials. The problem is that IIS does not recognize the WF COOKIE and prompts for a login when I try to get the PDF via a URL passed back to the browser. If the PDF is passed back via the execution of a focexec, it will avoid the IIS prompt but still be secure since the focexec won't run unless a WF COOKIE exists with valid credentials.

I was looking at the HTMLFORMTYPE setting but there is no PDF setting for this environment setting.

Any other ideas?


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
August 08, 2007, 10:29 AM
cburtt
An old, and now little known or discussed, 'feature' of *.fex is that they can contain and execute DOS commands (as found in the "ancient" *.bat file technology).

I suggest using DM to construct the fully qualified path to your *.PDF. Then use DOS launch Adobe's PDF Reader program (*.exe) with a parameter (the DM &var) pointing to the *.PDF.

The code would look something like this:
-SET &DOCPATH = ..... ;
DOS EXEC AcroRd32.exe &DOCPATH

We use a process like this to DOS COPY reports from the reports held in an agent's temp space to our own version of the WebFOCUS Reports Library.


WIN/2K running WF 7.6.4
Development via DevStudio 7.6.4, MRE, TextEditor.
Data is Oracle, MS-SQL.