I did not see anyone actually answering this question.
I thought if I provide my current solution, I might get some constructive feedback and perhaps some assistance.
While the following ASP.NET 2.0 (2005 SP1) w/ VB.NET 2005 SP1 solution does provide a PDF rendering of the oracle stored blob PDF file, I'd like to display the PDF reader within my current page template - In Classic ASP I would do this by utilizing a report reader object.
How do I do this in ASP.NET 2.0?
If you have a sample from that language would work for me too as I can and do read, understand and develop in C#. (I do not currently have any paying customers who develop in C#, but I do use it.)
[HTML]
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="PFDViewer.aspx.vb" Inherits="Project.PFDViewer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="HTMLHead" runat="server"><title></title></head><body></body>
</html>
[/HTML]
-
Imports System.Data.OracleClient
-
-
Partial Public Class PFDViewer
-
Inherits System.Web.UI.Page
-
-
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
If IsNothing(Session("seUSERGUID")) Then
-
Me.Response.Redirect("~\Login.aspx", True)
-
Else
-
If Not IsPostBack Then
-
Dim Tracker As New clsWebUserTracker(New OracleClient.OracleConnection(ConfigurationManager.ConnectionStrings("AppSecASPNETConnectionString").ConnectionString))
-
Tracker.LogEvent(Request.ServerVariables("Remote_addr").ToString, Me.Page.Request.Url.AbsoluteUri.ToString, Session("seUserName"), Session("seUSERGUID"), Session("seEntityGUID"))
-
End If
-
End If
-
Dim orConn As New OracleConnection(Me.Session("seEntityConnectionString"))
-
Dim DM As New clsDocuments(orConn, Nothing)
-
If Me.Request("ByType") Then
-
DM.getDocumentFileByType(Me.Request("DocCallVal"))
-
Else
-
DM.getDocumentFileByGUID(Me.Request("DocCallVal"))
-
End If
-
Me.Title = DM.DocumentTitle & " - " & DM.DocumentType
-
If String.IsNullOrEmpty(DM.Filetype) Then
-
Response.Write("File Not Available")
-
ElseIf Not DM.Filetype.ToUpper = "PDF" Then
-
Response.Write("File Not Available")
-
Else
-
'Write the file directly to the HTTP output stream.
-
Dim SR As IO.Stream
-
SR = DM.FileBlob
-
Dim bw As IO.BinaryReader
-
Response.Clear()
-
bw = New IO.BinaryReader(SR)
-
Dim SendByteArray As Byte()
-
SendByteArray = bw.ReadBytes(bw.BaseStream.Length)
-
Response.ContentType = "application/pdf"
-
Response.AddHeader("Content-Type", "application/pdf")
-
Response.AddHeader("Content-Disposition", "inline")
-
Response.BinaryWrite(SendByteArray)
-
Response.End()
-
End If
-
End Sub
-
End Class
-