Render Xml from image DataType

T

Troy Jerkins

Sorry for the cross post, but I'm stumped.

I'm trying to render the XML content that is stored as an image datatype in
the SQL Server Reporting Services database.Table Catalog, Content Colmn,
using ASP.NET (VB.NET).

These look to tbe the RDL files that get uploaded where the TYPE column = 2
in the Catalog Table.
What happens is, the xml gets rendered in IE (6.0) but is truncated at the
end because it is not well-formed. It seems most of the XML is rendered
except for a the last few lines.

Here is the error in the browser:

?//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Cannot view XML input using XSL style sheet. Please correct the error and
then click the Refresh button, or try again later.
------------------------------------------------------------------------------

Cannot have a DOCTYPE declaration outside of a prolog. Error processing
resource 'http://sauronan.gefa.ad.ga.gov/FSTProject...



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
----------^/DIV>
<PaddingTop>2pt</PaddingTop>

?/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Here's my code-behind:


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim ImgStream As MemoryStream = New MemoryStream

Dim cn As SqlConnection = New
SqlConnection("server=SAURONAN;database=ReportServer;user
id=FSTApp;password='pass")

Dim rdr As SqlDataReader

Dim xName As String = ddlNme.SelectedValue

Dim cmd As New SqlCommand("GetBinaryData", cn)

cmd.CommandType = CommandType.StoredProcedure

Dim param As SqlParameter

param = cmd.Parameters.Add(New SqlParameter("@sName", xName))

param.Direction = ParameterDirection.Input

cn.Open()

Dim blob() As Byte = CType(cmd.ExecuteScalar(), Byte())

context.Response.ContentType = "text/xml"

context.Response.OutputStream.Write(blob, 0, blob.Length)

cn.Close()

Response.Flush()

End Sub

Any ideas on how to get this data. I really don't care how, as long as I
have access to it.

-Troy
 
R

recoil

Your problem is that somewhere there is a Doctype. If you need a
doctype to be spit out then the proper way to do this with XSL is to
use
<xsl:eek:utput doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="http://www.w3.org/TR/html4/strict.dtd" method="html"
version="4.01" encoding="UTF-8" indent="yes"/>


If you have no control then you are going to have to manually search
and replace the Doctype yourself. This could be as simple as fast
forwarindg your stream by x azmount of bytes so it skips over the
Doctype.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top