ReportViewer usese these two fuctions to build URL for the report. If the
 parameter value contains â'&â' then ReportViewer returns error. Any idea how I
 can resolve this issue?
 private string EmumProperties(Hashtable properties)
 {
 string paramsString = String.Empty;
 // Enumerate properties and create report server specific string.
 IDictionaryEnumerator customPropEnumerator = properties.GetEnumerator();
 while ( customPropEnumerator.MoveNext() )
 {
 paramsString += "&"
 + customPropEnumerator.Key
 + "=" + customPropEnumerator.Value;
 }
 return paramsString;
 }
 /// <summary>
 /// Add URL access command for rendering a report and any
 /// additional parameters.
 /// </summary>
 public string BuildUrlString()
 {
 this._url = this._serverUrl + "?" + this._reportPath +
 "&rs:Command=Render" + this.EmumProperties(this._properties);
 return this._url;
 }I resolved the issue by using urlencode.
"JIM.H." wrote:
> ReportViewer usese these two fuctions to build URL for the report. If the
> parameter value contains â'&â' then ReportViewer returns error. Any idea how I
> can resolve this issue?
> private string EmumProperties(Hashtable properties)
> {
> string paramsString = String.Empty;
> // Enumerate properties and create report server specific string.
> IDictionaryEnumerator customPropEnumerator => properties.GetEnumerator();
> while ( customPropEnumerator.MoveNext() )
> {
> paramsString += "&"
> + customPropEnumerator.Key
> + "=" + customPropEnumerator.Value;
> }
> return paramsString;
> }
> /// <summary>
> /// Add URL access command for rendering a report and any
> /// additional parameters.
> /// </summary>
> public string BuildUrlString()
> {
> this._url = this._serverUrl + "?" + this._reportPath +
> "&rs:Command=Render" + this.EmumProperties(this._properties);
> return this._url;
> }
>
 
No comments:
Post a Comment