467,877 Members | 1,130 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,877 developers. It's quick & easy.

[reporting services] Parameters via a web service


I have to build a report. this report has to be call by a web service. My method to call this report is :

Expand|Select|Wrap|Line Numbers
  1.     [WebMethod]
  2.     public void Amende( string dossierId )
  3.     {
  4.         ReportingService rs = new localhost.ReportingService();
  5.         rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
  7.         byte[] resultStream;                    // bytearray for result stream
  8.         string[] streamIdentifiers;                // string array for stream idenfiers
  9.         string optionalParam = null;            // string out param for optional parameters
  10.         ParameterValue[] optionalParams = null; // parametervalue array for optional parameters
  12.         // Préparation de la valeur passée en paramètre
  13.         ParameterValue[] parameters = new ParameterValue[1];
  14.         parameters[0] = new ParameterValue();
  15.         parameters[0].Name = "DossiersId";
  16.         parameters[0].Value = dossierId;
  18.         DataSourceCredentials[] credentials = null;
  19.         string showHideToggle = null;
  20.         string historyID = null;
  21.         Warning[] optionalWarnings = null;      // warning array for optional warnings
  23.         resultStream = rs.Render("/SwatFillingDocuments/AMAD AYDIN 1198 2005 MD", "PDF", 
  24.             historyID, @"False", parameters,credentials,showHideToggle,out optionalParam,
  25.             out optionalParam,out optionalParams, out optionalWarnings,out streamIdentifiers);
  26.         HttpContext.Current.Response.BinaryWrite(resultStream);
  27.     }
But when I put a parameter in my web service I have an error :

Expand|Select|Wrap|Line Numbers
  1. System.Net.WebException: The request failed with HTTP status 400: Bad Request.
  2.    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
  3.    at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
  4.    at localhost.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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\listreports\5d760f1a\6c0731c0\App_WebReferences.n1-mytpw.0.cs:line 1706
  5.    at Service.Amende(String dossierId) in c:\projects\ListReports\App_Code\Service.cs:line 36
Can you help me please? If I use this mothed without parameter it works but when i try to give a parameter it fails.
Thank you
Oct 27 '06 #1
  • viewed: 3664

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Paul Say | last post: by
8 posts views Thread by Woody Splawn | last post: by
reply views Thread by Phils | last post: by
3 posts views Thread by =?Utf-8?B?QS4gUm9iaW5zb24=?= | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.