Hello, I have this code, and it just doesnt work,I am using rs 2005.
privatevoid cargarReporteFromWS()
{
cargarFormatos();
//Format format = (Format)ddlFormats.SelectedValue;
string encoding;string mimeType;ParameterValue[] parametersUsed;Warning[] warnings;string[] streamIds;rs =
newReportingService();rs.Credentials = System.Net.
CredentialCache.DefaultCredentials;rs.Url =
"http://agamenon:90/reportserver/ReportingServices.asmx";byte[] data;string path ="/GescomRpts/RPT_MediosDesarrollo";data = rs.Render(path, ddlFormats.SelectedValue,
null,null,null,null,null,out encoding,out mimeType,out parametersUsed,out warnings,out streamIds);FuncionesRS fs =newFuncionesRS() ;string extension = fs.GetExtension(mimeType);string filename = path +"." + extension;Response.Clear();
Response.ContentType=mimeType;
if(mimeType!="text/html")Response.AddHeader(
"Content-disposition","attachment; filename="+filename);Response.BinaryWrite(data);
}
Server Error in '/GescomDllo' Application.
Client found response content type of '', but expected 'text/xml'.
The request failed with an empty response.
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details:System.InvalidOperationException: Client found response content type of '', but expected 'text/xml'.
The request failed with an empty response.
Source Error:
Line 1704: [return: System.Xml.Serialization.XmlElementAttribute("Result", DataType="base64Binary")]Line 1705: public byte[] Render(string Report, string Format, string HistoryID, string DeviceInfo, ParameterValue[] Parameters, DataSourceCredentials[] Credentials, string ShowHideToggle, out string Encoding, out string MimeType, out ParameterValue[] ParametersUsed, out Warning[] Warnings, out string[] StreamIds) {Line 1706: object[] results = this.Invoke("Render", new object[] {Line 1707: Report,Line 1708: Format,
Source File:c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\gescomdllo\27bee1ac\cdebe31b\App_WebReferences.4i0hyhkt.0.cs Line:1706
Stack Trace:
[InvalidOperationException: Client found response content type of '', but expected 'text/xml'.The request failed with an empty response.] System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +533395 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204 RSWebService.ReportingService.Render(String Report, String Format, String HistoryID, String DeviceInfo, ParameterValue[] Parameters, DataSourceCredentials[] Credentials, String ShowHideToggle, String& Encoding, String& MimeType, ParameterValue[]& ParametersUsed, Warning[]& Warnings, String[]& StreamIds) in c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\gescomdllo\27bee1ac\cdebe31b\App_WebReferences.4i0hyhkt.0.cs:1706 Protected_01_Administradores_rptmediosdesarrollo.cargarReporteFromWS() in c:\Inetpub\wwwroot\GescomDllo\Protected\01_Administradores\rptmediosdesarrollo.aspx.cs:44 Protected_01_Administradores_rptmediosdesarrollo.Page_Load(Object sender, EventArgs e) in c:\Inetpub\wwwroot\GescomDllo\Protected\01_Administradores\rptmediosdesarrollo.aspx.cs:23 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
http://spaces.msn.com/levalenciam
What exactly are you trying to do with this code?
No comments:
Post a Comment