Wednesday, March 21, 2012

how to get text (html) from "Render" method

currently i'm getting a stream back and am using [see code at end] to convert
it
what i get back on the screen is a bunch of crap like this
MIME-Version: 1.0 Content-Type: multipart/related;
boundary="--=_NextPart_01C35DB7.4B204430" X-MSSQLRS-ProducerVersion:
V8.00.878.00 This is a multi-part message in MIME format.
--=_NextPart_01C35DB7.4B204430 Content-ID: Content-Disposition: inline;
filename="DASH0014" Content-Type: text/html; name="DASH0014"; charset="utf-8"
Content-Transfer-Encoding: base64
PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFs
Ly9FTiI+DQo8aHRtbD4NCjxoZWFkPg0KPHRpdGxlPg0KREFTSDAwMTQNCjwvdGl0bGU........................etc
instead of what i was expecting - a nicely formed html doc
is it because i am converting the stream?
is there a better way of handling the stream?
am i using the wrong encoding?
thanks
a.
--CODE START
Dim result As Byte() = Nothing
...
result = rs.Render(Report, Format, HistoryID, DeviceInfo,
Parameters, Credentials, _
ShowHideToggle, Encoding, MIMEType, ParametersUsed, Warnings,
StreamIDs)
Dim star As String
Dim ec As System.Text.Encoding = System.Text.Encoding.UTF8
star = ec.GetString(result)
Message.InnerHtml = star
--CODE ENDok so i set this and it works
Dim Format As String = "HTML4.0"
(it was "MHTML")
but now i have a new problem
"adolf garlic" wrote:
> currently i'm getting a stream back and am using [see code at end] to convert
> it
> what i get back on the screen is a bunch of crap like this
> MIME-Version: 1.0 Content-Type: multipart/related;
> boundary="--=_NextPart_01C35DB7.4B204430" X-MSSQLRS-ProducerVersion:
> V8.00.878.00 This is a multi-part message in MIME format.
> --=_NextPart_01C35DB7.4B204430 Content-ID: Content-Disposition: inline;
> filename="DASH0014" Content-Type: text/html; name="DASH0014"; charset="utf-8"
> Content-Transfer-Encoding: base64
> PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFs
> Ly9FTiI+DQo8aHRtbD4NCjxoZWFkPg0KPHRpdGxlPg0KREFTSDAwMTQNCjwvdGl0bGU........................etc
> instead of what i was expecting - a nicely formed html doc
> is it because i am converting the stream?
> is there a better way of handling the stream?
> am i using the wrong encoding?
> thanks
> a.
>
> --CODE START
> Dim result As Byte() = Nothing
> ...
> result = rs.Render(Report, Format, HistoryID, DeviceInfo,
> Parameters, Credentials, _
> ShowHideToggle, Encoding, MIMEType, ParametersUsed, Warnings,
> StreamIDs)
> Dim star As String
> Dim ec As System.Text.Encoding = System.Text.Encoding.UTF8
> star = ec.GetString(result)
> Message.InnerHtml = star
> --CODE END
>sql

No comments:

Post a Comment