Quantcast
Channel: SQL Server Reporting Services
Viewing all articles
Browse latest Browse all 1418

How to read PDF from using buffered pdf file from the location in LOCAL Host Path

$
0
0

My problem i want to find the location of pdf. where it is located in local host. when i try to click download its asking to save. 

But my CASE i don't want to save . I Just want to Open to preview. 

Below are my code. 


Dim fileName As String = strReportName.Replace(".rdlc", "") & "." & fileNameExtension
Dim strPath As String = context.Server.MapPath(fileName)
Dim pdfPath As String = strPath
'Using client As New WebClient()
Dim client As WebClient = New WebClient()
Dim buffer As Byte() = client.DownloadData(pdfPath)
If buffer IsNot Nothing Then
context.Response.ContentType = "application/pdf"
context.Response.AddHeader("content-length", buffer.Length.ToString())
context.Response.BinaryWrite(buffer)
End If
'End Using

_____
Please suggest me any idea?

Thanks,
Ponraj


Viewing all articles
Browse latest Browse all 1418

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>