Showing posts with label method. Show all posts
Showing posts with label method. Show all posts

Wednesday, March 21, 2012

displaying xml using reporting service web service

I'm using VS2005 web developer. I can't display XML results when using the
render method, although it renders fine.
I'm using the SQL Server 2000 reporting services web service render method
to get a byte array like this:
result = rs.Render(reportPath, format, historyID, devInfo,
parameters, _
credentials, showHideToggle, encoding, mimeType,
reportHistoryParameters, warnings, streamIDs)
This is from the sample at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_soapapi_service_lz_6x0z.asp
It works great if I assign HTML4.0 and EXCEL to the "format" variable.
Then I put
response.binarywrite(result)
and it is just fine.
When I try this with the XML format, it creates a file perfectly if I put
Dim stream As FileStream = File.Create("report.xml", result.Length)
but I don't know how to display the xml in a browser.
Response.binarywrite(result) and Response.writefile("report.xml") gives me
an error
The XML page cannot be displayed.
...
Cannot have a DOCTYPE declaration outside of a prolog
I guess because the XML is written inside the html.
I would appreciate any suggestions.
Thanks
BillCorrection - response.writefile(filename) works, but I don't want to have to
create files on the server and clean them up all the time.
Thanks
Bill
"bill" <belgie@.datamti.com> wrote in message
news:ubuEOCnMGHA.2124@.TK2MSFTNGP14.phx.gbl...
> I'm using VS2005 web developer. I can't display XML results when using
> the render method, although it renders fine.
> I'm using the SQL Server 2000 reporting services web service render method
> to get a byte array like this:
> result = rs.Render(reportPath, format, historyID, devInfo,
> parameters, _
> credentials, showHideToggle, encoding, mimeType,
> reportHistoryParameters, warnings, streamIDs)
> This is from the sample at
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_soapapi_service_lz_6x0z.asp
> It works great if I assign HTML4.0 and EXCEL to the "format" variable.
> Then I put
> response.binarywrite(result)
> and it is just fine.
> When I try this with the XML format, it creates a file perfectly if I put
> Dim stream As FileStream = File.Create("report.xml", result.Length)
> but I don't know how to display the xml in a browser.
> Response.binarywrite(result) and Response.writefile("report.xml") gives
> me an error
> The XML page cannot be displayed.
> ...
> Cannot have a DOCTYPE declaration outside of a prolog
> I guess because the XML is written inside the html.
> I would appreciate any suggestions.
> Thanks
> Bill
>