Web Connection 5.0
pdf printing
03/17/2010
10:12:58 AM
2W20LWARU Show this entire thread in new window
Gratar Image based on email address
From:
Charles Steinhauer
To:
Rick Strahl 
Attachments:
None

Thanks Rick,

After some thought I decided to open the PDF after creation in lieu of having the user select a link. If there is no report data passed to this the display will be a new page with a blank report.

All I need now is a cleanup routine to delete 'lcfile' from the temp directory
I will probably replace the path with a variable reference or data from my control file.

LPARAMETERS preport
xit="cti\reports\"+preport
oPDF = CREATEOBJECT("wwXFRX")
lcFile = SYS(2015) + ".pdf" &&temp file name
oPDF.PrintReport(xit,"C:\Inetpub\wwwroot\cti\temp\"+lcFile)

GoUrl("C:\Inetpub\wwwroot\cti\temp\"+lcFile)
RETURN

Charles


You can make the report processing go to a new window, so when you click on 'Generate Report' or whatever you do you send that link to a new window rather than just the generated output link.

Personally I prefer doing it the way you do it in the code below because only the actual PDF file is viewed in an external window and all 'application related' logic stays inside of the browser where it should be.

+++ Rick ---

I am having trouble getting print output to open a new window. Actually with getting the link to the report in a new window.
The code below adds the Register Report link on my main page of the application. when clicked it opens a new window for the output which is correct...problem is I need the new window to open first and render the link to the report.
I have tried adding <form> tags to the function to force a new window without success.

<vfp>
THIS.StandardPage("Report Complete",[<a href="/cti/temp/] + lcFile +["]+ [TARGET="_blank"]+[>] +;
[Register Report</a>],,1,"/cti/temp/"+lcFile)


function standardpage()
lcOutput = +;
[<div style="background: navy; color: cornsilk; font-size: 16pt; font-weight: bold;padding: 4px; padding-top:5px; text-align:center;">] +;
lcHeader + [</div>] + CRLF +;
[<div style="padding: 20px;font-size: 10pt;">] + lcBody + [</div>]

*** Default Content Type Header
Response.ContentTypeHeader(lvHeader)

lcOutput = ;
[<html>] +CRLF +;
[<head>] + CRLF +;
[<title>] + lcHeader + [</title>] + CRLF +;
IIF(!EMPTY(Response.cStyleSheet),[<LINK rel="stylesheet" type="text/css" href="] + Response.cStyleSheet +[">],"") +CRLF + ;
[</head>] + CRLF +;
[<body color="#FFFFFF" style="font:normal normal x-small Verdana">] + CRLF + ;
lcOutput

Response.Write(lcOutput)

endfunc

</vfp>