You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Open PDF file in new window from PIA page, field change event-not working

1 reply [Last post]
Guest's picture
Guest

My problem is: I am running one SQR program which generates PDF files on a configurable file path, That is in server (windows) Ddrive : "D:\PSOFT\PT847\HR89\DEV\webserv\HR89DEV\PDFfile". all files are generating in "PDFfile" folder.
I have ESS page to display this PDFs. when User logon his ESS page, there is grid to display a column of multiple

hyperlinks. if user click on hyperlink it has to find the PDF and should open in a newwindow.
ViewContentURL OR ViewAttachment OR viewUrl are not working. suggest me the best solution

Local array of string &FNames;

/*Path will come from database table.*/

&PDFpath = "D:\PSOFT\PT847\HR89\DEV\webserv\HR89DEV\PDFfile";

&FNames = FindFiles(&PDFpath | "*.pdf", %FilePath_Absolute);

&Userfile = "2014-01-31_4200114.pdf";

&i = 1;

While &FNames.Len > 0

&filename = &FNames.Shift();
MessageBox(0, "", 0, 0, "***found***" | &filename);
&rtcode = ViewAttachment(&PDFpath, &filename, &Userfile);
MessageBox(0, "", 0, 0, "***after found***" | &rtcode);

rem ViewContentURL(&PDFpath | '\' | &Userfile);

&i = &i + 1;

If &i = 5 Then

Break;

End-If;

End-While;

Lepa's picture
User offline. Last seen 2 weeks 2 days ago. Offline
Joined: 06/23/2008
Posts: 591
Re: Open PDF file in new window from PIA page, field change ...

I have used the below code and it works. Open in a new tab just fine. The view attachment i'm using is a function and has an underscore view_attachment. The one in your code does not.

Declare Function view_attachment PeopleCode FILE_ATTACH_WRK.ATTACHVIEW FieldChange;

view_attachment(URL.UHC_IM_VIEW_FILE, UHC_IM_TRANS_VW.UHC_IM_FILE_NAME, UHC_IM_TRANS_VW.FILE_NAME, 2, &Return_Code);

n/a

Post new comment

CAPTCHA
The question below is to prevent automated spam submissions.
7 + 13 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.