Monday, March 12, 2012

Open file from report?

Hello,

I am trying to open a file on a network drive from a report. The file's location that I need to open is stored in the db for each record. I have tried using javascript to open a new window using the File:/// prefix. I have been able to open a new windows and navigate to a URL in this fashion by using a javascript window.open call and placing it in the navigation tab of the textbox. When I try this with a file, however, I get an access denied message. I was thinking to try opening the file by using the System.Diagnostic.Process.Start() method from code, but I'm not sure how to wire that up to the OnClick event of the textbox on the report. Does anyone have any ideas?

Could you point to a web page and then use a query string parameter to redirect to the file?

cheers,

Andrew

|||Hi, Andrew. Thanks for the reply. I solved this one yesterday. It was really simple, and I can't believe I didn't try it before. I was trying to open the .doc file in a new window using javascript (window.open) with the file:\\\ handle. I finally tried just putting the UNC path into the Navigate to URL field under the textbox's properties/navigation tab. This worked perfectly. It immediately opened Word and then loaded the file. For reference, this also works with a drive letter, such as C:\test.doc.

No comments:

Post a Comment