Date:  10/08/2008 01:26:31 PM Msg ID:  003817
From:  FoxWeb Support Thread:  003813
Subject:  Re: How to fwPDF.SendPDF into a new window ?
I was not referring to a redirect, but rather the inclusion of a TARGET attribute in the <a href>, or <form> element that calls the page that creates the PDF document.
 
If you want to return an HTML page and also open a PDF file in a different window, then you have no option other than using JavaScript to open a new window, or return a link to the PDF file in the HTML page. With both options, the PDF file can either be generated by the second JavaScript/link request (in which case you will have to re-open your data tables), or by the original request, in which case you will have to save the PDF file to disk and run a scheduled program that cleans up your PDF folder at scheduled intervals.
FoxWeb Support Team
support@foxweb.com email
Sent by jc clerc on 10/07/2008 12:25:22 AM:
If I understand well I can't do that (simply) since the created report requires many open tables, variables and access rights, I can't simply forward to a new web page that will create the PDF.
Is there a way to add in the foxweb engine to simply add a tag .T.or .F. that will allow to choose if you want to open the report in a new page (knowing popup needs to be allowed) ?
 
My main issue is to delete the PDF once it has been dowloaded in order to cancel all access to that file,  maybe you may have another idea to get that done. Today I save the file into a specific directory wish is not open thru the web so I have to delete the files every day and sometime I erase while the user just created the file !
 
Kind regards
JC
 
 
 
 
 
Sent by FoxWeb Support on 10/06/2008 10:54:09 AM:
Your code will not work, because the JavaScript window.open method expects a URL as its first argument, but instead, you are feeding it the return value from the SendPDF method. Why don't you target the link that calls the PDF-generating script to a new window? This is a lot simpler than using JavaScript:
 
<a href="MyCreatePdf.fwx?RepForm=xxx" target="PdfWindow">
 
You can then create a script MyCreatePdf.fwx, which will create and return the actual PDF file.
FoxWeb Support Team
support@foxweb.com email
Sent by jc clerc on 10/06/2008 02:49:14 AM:
Hello,
I would like to use the FwPDF request since it does delete the file after upload wish is a very good solution but I need to open in a new window since the users are always making the choice to close the window in order to go back to the application !
 
I have tried that but it doesn't work
 
 ....
M.TempFile = fwPDF.GetTempFile()
REPORT FORM xxx NOWAIT NOCONSOLE TO FILE (M.TempFile)
%>

<SCRIPT LANGUAGE="javascript">
window.open('<%fwPDF.SendPDF(M.TempFile, , .T., fwPDF.PS2PDFMethod <> 0, .T.)%>','print','toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=1, copyhistory=0, menuBar=1, width=600, height=500, left=0, top=0');
</script>
 
 
Kind regards
JC