#1 2019-03-27 14:27:58

Patryx
Member
Registered: 2019-03-25
Posts: 42

Passing parameter values in URL

Hi,
According to https://forum.reportserver.net/viewtopi … 534#p5534/ I created new thread.

I want to pass parameter values via URL which I use for condition $X{} while generating report. I want to use "6.11.4. Embedding the Report Execution View", so I need to change '=' to ':' when it comes to parameters in url.
I tried put in url &p_parameter:123|213 but it doesn't work. I mean I get the right Report Execution View but without these values set.

First of all I will describe what I try to do. I want to embedded the Report Execution View in my application. I don't want to let user to select values for this parameter. I just want to pass array of values to get expected data (I could hide parameter and unchecked Editable while defining parameter).
I couldn't find such an answer in manuals or forum.
Maybe I should declare different kind of parametr to achieve the goal?

For example I want to have parameter named: "PARAM_USERID" which I use in WHERE like "WHERE $X{IN, user.id, PARAM_USERIDS}". Column user.id is BIGINT (postgresql)
When I change report query and create text parameter as "PARAM_USERID" and I use it in "WHERE user.id::VARCHAR = $P{PARAM_USERID}" I am able to put in the URL "&P_PARAM_USERID:12" and it works as I expect - return only data for user with id = 12
Working URL in this case: "http://.../ReportServer.html#inlinereport/key:my_user_report&P_PARAM_USERID:12"


One question more. Is there any mechanism or possibility to disallow user to unselect some columns? I created variants with columns selected and I want to let user to add or remove some columns BUT I don;t want to let user to remove column, for example id which is even hidden?

My reportserver version: #
#Fri Mar 08 13:21:48 CET 2019
version=RS3.0.6-6006
schemaversion=RS3.0-12
buildDate=1552047708665-2019-03-08-13-21-38

Offline

#2 2019-03-27 15:37:09

eduardo
Administrator
Registered: 2016-11-01
Posts: 1,079
Website

Re: Passing parameter values in URL

Hi Patryx,

the correct query should be:
... WHERE $X{IN, user.id, PARAM_USERIDS}

and the url should work:
http://.../ReportServer.html#inlinereport/key:my_user_report&P_PARAM_USERIDS:12|16

(PARAM_USERID VS PARAM_USERIDS -> check this: "PARAM_USERID" vs WHERE $X{IN, user.id, PARAM_USERIDS}

For disabling configuration, you may make the variant configuration protected. But this would disable all columns..

Regards,
Eduardo

Offline

#3 2019-03-28 07:02:35

Patryx
Member
Registered: 2019-03-25
Posts: 42

Re: Passing parameter values in URL

Exactly, I did as your wrote (the example I showed it was a working one for me where there is a text parameter with one value).
And what should happen after:
http://.../ReportServer.html#inlinereport/key:my_user_report&P_PARAM_USERIDS:12|16?

In my case it just open the report but without ant filters on ids (show all, parameter is empty).

Does the parameter have to be datasource parameter when I have to defined datasource and query? In my case I don't need datasource, I just want to put values array via URL and hide values from changing.

What about mechanism or possibility to disallow user to unselect some columns?
As I wrote I created variants with columns selected and I want to let user to add or remove some columns BUT I don't want to let user to remove some of them, for example column "id" which is even hidden?

Last edited by Patryx (2019-03-28 08:46:20)

Offline

#4 2019-03-28 12:48:20

Patryx
Member
Registered: 2019-03-25
Posts: 42

Re: Passing parameter values in URL

It started to work but there is another problem:
I used this URL:
http://127.0.0.1:81/reportserver/Report … DS:151|306

PARAM_USER_IDS is a datasource parameter with java.LONG.

It gives me right result:
Param-1.png
but if I open Parameters tab I can see three entries:
151|306
151|306
as chosen parameter:
Param-2.png

It looks like there is a mistake in ReportServer in parsing parameters - it recognises amount of items in list (when there are 3 values like 151|206|121 I see three times "151|206|121" etc).

Offline

#5 2019-04-02 14:22:45

eduardo
Administrator
Registered: 2016-11-01
Posts: 1,079
Website

Re: Passing parameter values in URL

Hi Patryx,

this seems to be a bug. I raised ticket RS-3378 and will update here when I have more information.

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB