Page 1 of 1

Link in Grid to open .PDF in separate window

Posted: Fri Aug 06, 2010 1:51 pm
by RichDotson
I have an application that creates a .PDF of a report and saves it to a folder in the IFS. I am creating grid on the customer web page that will list all of the reports that were created by that specific user. I would like to have it where the customer can click on the desired report in the grid and the .PDF would open up in a separate window.

The names of the reports and their location in the IFS are stored in a database and this is the info that I am loading into the grid.

Is there a way to do this?

Re: Link in Grid to open .PDF in separate window

Posted: Fri Aug 06, 2010 3:19 pm
by Alex
Assuming the PDF folder is within the document root (/www/profoundui/htdocs/), you can use the grid's onrowclick event to pop the report open in a new window. The script would look like this:

window.open(get("PATH." + row));

Where PATH is the id of a field containing the url path to the PDF. Be sure to specify the id on the output field widget within the subfile (it is not the same as the bound field name). If you don’t have the path in a field that is displayed to the user, you can add it as a hidden field. Right-click the field and select hide to hide it.

I hope this helps.

Re: Link in Grid to open .PDF in separate window

Posted: Fri Aug 06, 2010 4:29 pm
by RichDotson
This worked great. Thanks!