Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewing a PDF file in a browser

Status
Not open for further replies.

redheadpgr

Programmer
Feb 8, 2002
17
0
0
US
I'm using the following VB code to view a pdf file in a browser:

Code:
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"

Response.WriteFile "c:\inetpub\[URL unfurl="true"]wwwroot\reports\myreport.pdf")[/URL]
Response.Flush()
Response.Close()

The problem is that this will show fine when I'm running this on my PC. When I put this on the web server, however, it doesn't show the PDF file. Instead, it shows the Crystal Report (in a Crystal Report Viewer control), from which the PDF file was exported.

I've used the folder to which it is exporting many times. Do I need to make sure that Acrobat Reader is installed on the web server?

Any help would be appreciated. Thanks.
 
you need PDF installed anywhere you want the file to open. You have crystal set as the program associated with PDF extensions. Install Acrobat. I dont install user apps(MS Office/Adobe/Resource Hogs) on my servers, but if you need to...

 
You don't have to install anything on the server, the client should have Adobe installed in order to view the exported pdf in the browser. Could be a permissions issue, try giving ASPNET account access to the c:\inetpub\ directory. Does it throw any errors at all?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top