#1 2019-06-10 08:49:28

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

Report Metadata - Using Metadata as Parameters

Hi,
Could you tell me how I should use report metadata as parameters?
I tried all possible combinations and it didn't work - metadata entries were unknown for query.
The documentation it is not clear in point https://reportserver.net/en/guides/admi … -Metadata/ (6.3.11)

What should I write in Report Metadata?
_RS_METADATA_MYPARAM - where MYPARAM is name, so I understand I have to save in Report Metadata tab: _RS_METADATA_guid with my value. Or maybe just _guid or guid?
Then how to use it in a query? ${_RS_METADATA_guid} or ${guid} or &{_guid} ?

Could you give me a simple example which should work?

P.S. I want to have a parameter to use in query which value I can set in each report variant so I wanted to use Report Metadata for that...Any other idea?

Last edited by Patryx (2019-06-12 10:09:24)

Offline

#2 2019-06-12 14:07:55

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

Re: Report Metadata - Using Metadata as Parameters

Hi Patryx,

this should work:
select ${_RS_METADATA_myMetadataKey} as abc, *  from mytable

You should see the myMetadataKey values if you previously define a metadata with name: "myMetadataKey".
The "execute" button in the query is not working in this case, I raised ticket RS-3505 for this. But other than this, this seems to work.

What exactly doesn't work in your case? Please post some screenshots.

Regards,
Eduardo

Offline

#3 2019-06-12 14:29:39

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

Re: Report Metadata - Using Metadata as Parameters

Hi Eduardo,
I tested your example and you are right, button Execute of query doesn't work, but when I execute report in Report Execution View it works and read the variable.

BUT the problem is with Metadata Datsource when I test it in Metadata Datasource Query and there unfortunately it doesn't work at all.
I mean even in Report Execution View nor by button Execute for query.

When I try to execute a report I get "Cannot find property _RS_METADATA_test" in window.
Could you check it if you have the same error?

Offline

#4 2019-06-13 08:50:30

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

Re: Report Metadata - Using Metadata as Parameters

Hi Patryx,

you are right, I see the error too. I raised RS-3506 for this.

Regards,
Eduardo

Offline

#5 2019-06-13 09:03:53

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

Re: Report Metadata - Using Metadata as Parameters

Hi Eduardo,
Thanks, I look forward to new version 3.0.8 of ReportServer smile

Offline

#6 2019-06-13 10:34:21

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

Re: Report Metadata - Using Metadata as Parameters

Hi Patryx,

RS-3506 is fixed smile

Regards,
Eduardo

Offline

#7 2019-06-13 12:20:59

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

Re: Report Metadata - Using Metadata as Parameters

Hi Patryx,

the "execute" buttons are working now when you include report metadata in their query.

Regards,
Eduardo

Offline

#8 2019-07-17 07:41:29

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

Re: Report Metadata - Using Metadata as Parameters

Hi,
To continue this topic, we noticed that ${_RS_METADATA_SUPER_myMetadataKey} didn't work at all.
I created report and added metadata 'myMetadataKey' with value 'test report'). Then I created variant of this report and added there metadata 'myMetadataKey' with value 'test variant'.

Unfortunately I see only 'test report' in both case: when I execute report and variant...Could you check it? It seems that it can't see the overwritten metadata in variant.

What's interesting if I delete from report metadata key 'myMetadataKey' and I have in variant metadata 'myMetadataKey' with value 'test report' and use parameter as ${_RS_METADATA_myMetadataKey}, it works for executing variant report (error for execute base report).

Please tell me how to resolve it

Last edited by Patryx (2019-07-17 07:45:57)

Offline

#9 2019-07-29 13:04:37

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

Re: Report Metadata - Using Metadata as Parameters

Hi Patryx,

if you use ${_RS_METADATA_SUPER_myMetadataKey}, you will see in both cases the "SUPER"-value. In the variant case, you will see the report value. In the report case, the same (there is no parent of a report). So this is the correct behavior. If you want to see different values use the normal ${_RS_METADATA_myMetadataKey}. In the variant case you will see the variant value, in the report case you will see the report value.

Regards,
Eduardo

Offline

#10 2019-07-29 16:20:59

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

Re: Report Metadata - Using Metadata as Parameters

Hi Patryx,

ReportServer 3.0.8 is now available for download. RS-3506 is fixed in this version.

Regards,
Eduardo

Offline

#11 2019-08-01 06:30:12

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

Re: Report Metadata - Using Metadata as Parameters

Hi Eduardo,
This still doesn't work ${_RS_METADATA_SUPER_myMetadataKey} if I name a key in variant as "myMetadataKey" and try to execute query from administration.

Last edited by Patryx (2019-08-01 06:42:24)

Offline

#12 2019-08-01 06:47:31

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

Re: Report Metadata - Using Metadata as Parameters

Hi Patryx,

did you read this? https://forum.reportserver.net/viewtopi … 6107#p6107

If this does not apply, please elaborate with screenshots, etc.

Regards,
Eduardo

Offline

#13 2019-08-01 08:31:26

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

Re: Report Metadata - Using Metadata as Parameters

Sorry, you're right. It seems to be OK.

Offline

Board footer

Powered by FluxBB