Parameters in SSRS URL

I have a ssrl url http://reports-dev/ReportServer/Pages/ReportViewer.aspx?%2fReports%2fSoftwareDevelopment%2frs_test&rs:Command=Render&rs:Format=EXCEL&pr_active_trader_id=Temp UndOpt and I pass value as Temp UndOpt and since it has space I am getting Internal Server error. How to endcode any parameter which has space in it.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris LuttrellSenior Database ArchitectCommented:
Well %20 is normally what a space is encoded into.  As to how to do that, it depends on what is generating the url string.  There is usually an URLENCODE type comand in most tools/languages, you will have to look for it in yours.
CGLuttrell is correct - spaces are encoded into %20. I have a report which refers to parameters which may have spaces in them. The URL looks like this -


The report is accessed by clicking a button on an aspx page with the following code -

    protected void btn_GetManifest_Click(object sender, EventArgs e)
        string DelDate = dd_DelMonth.SelectedValue;
        string DelShip = dd_ShipNames.SelectedValue;
        string reportURL = "http:/" + "/serverX/reportserver?" + "/POsByShipment/ShipmentManifest&rs:Command=Render&DELIVERY_MONTH=" + DelDate + "&CONTAINER=" + DelShip;

Note that I am not specifically encoding the url - the %20 replaces the space automatically.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.