c# - SSRS report won't launch if multiple parameters in URL -


i trying pass parameters ssrs report .net application.

i have 3 parameters pass: instanceid, el , ol.

in code-behind, have codes below:

        string params = session["instanceid"].tostring() + "&el=unhide&ol=unhide";         string script = "<script language='javascript'> ";         script += "openlink1(" + params + ");";         script += "</script>";         page.registerstartupscript("clientscript", script); 

my javascript code below:

function openlink1(params ) {     var str = "http://server/reportserver/pages/reportviewer.aspx?%2f<path>%2f<report name>%2<report name>&rs:command=render&instanceid=" + params;      window.open(str, "list", "scrollbars=yes,resizable=yes,width=800,height=600");     return false; } 

no matter do, report won't launch (pop up).

the el , ol parameters supposed hide tables in ssrs report.

e.g. =iif(parameters!el.value = "hide", false, true)

if remove these 2 parameters report , take away parameter in url in code behind, ssrs report launches without problems.

what confuses me if directly enter url in browser, report works fine - lead me believe coding , passing parameters wrong?

any ideas?!

the issue in javascript you're generating in code behind. need put single quotes around params variable when you're creating function call in generated javascript.

    script += "openlink1('" + params + "');"; 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -