1

I am trying to pass a parameter value via the URL and it works for most values unless the value contains parenthesis. I have tried the backslash () to escape them but it doesn't appear to work.

Here is the URL

http://<server>/OpenDocument/opendoc/openDocument.aspx?sViewer=html&sDocName=<DocName>&sType=rpt&promptex-<ParamName>=VALUE_CONTAINING_(PARENTHESIS)
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
scott
  • 974
  • 7
  • 10

2 Answers2

2

I discovered that the value can be enclosed in quotes and then URI-escaped.

The URL becomes

http://<server>/OpenDocument/opendoc/openDocument.aspx?sViewer=html&sDocName=<DocName>&sType=rpt&promptex-<ParamName>=URI_ESCAPE("VALUE_CONTAINING_(PARENTHESIS)")
scott
  • 974
  • 7
  • 10
0

What you are looking for is URL encoding. Parenthesis will not be your only issue. So for the full answer, I recommend looking at the table available http://www.w3schools.com/tags/ref_urlencode.asp

For your specific answer:
( = %28
) = %29

&promptex-=VALUE_CONTAINING_(PARENTHESIS) becomes &promptex-=VALUE_CONTAINING_%28PARENTHESIS%29

This will then be un-encoded by the servlet engine.

shrub34
  • 796
  • 6
  • 17
  • I had tried that as well and received the same error. (The syntax of the value for prompt '' is incorrect. Please correct the syntax and try again.). I've also tried doing all combinations of that along with the backslash and backslash url-encoded. – scott Feb 04 '13 at 17:16