Share via

SSRS Rest API, embeded dataset

Yong Jian Yap 6 Reputation points
2022-03-15T06:47:12.837+00:00

Is there any way to get available/valid value of parameters by consuming the SSRS Rest API by using Reports(id)/ParameterDefinitions ?
I can't retrieve value from it if the parameters got dependencies..

SQL Server Reporting Services
SQL Server Reporting Services

A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Yong Jian Yap 6 Reputation points
    2022-03-16T03:14:18.263+00:00

    I resolved this by using the route "/reports/api/v2.0/DataSets({Id})/Model.GetData".

    For those who had this requirement too,
    First you need to change your embedded dataset to shared dataset, and this is a post method and you need to specify the parameters' value then can get the cascading parameter value.

    https://app.swaggerhub.com/apis/microsoft-rs/SSRS/2.0#/DataSets/GetDataSetData

    Feel free to correct me if got others alternative approach.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Joyzhao-MSFT 15,651 Reputation points
    2022-03-15T09:03:14.233+00:00

    Hi @Yong Jian Yap ,
    I'm not familiar with Rest API, please refer to the following example:

    # Dump Report Parameters  
    $rptParams = Invoke-RestMethod "$URI/Reports(Path='/Operations/Rest Demo')/ParameterDefinitions" -Method get -UseDefaultCredentials  
      
    foreach($rptParam in $rptParams.value)  
    {  
        Write-output("Parameter:{0}" -f $rptParam.Name)  
      
        foreach($validValue in $rptParam.ValidValues)  
        {  
            Write-Output("Label:{0}, Value:{1}" -f $validValue.Label, $validValue.value)  
        }  
    }  
      
    # Show all Parameter Items  
    $rptParams.value | ConvertTo-Json -Depth 4  
    

    For more information, please see : SSRS_Rest_API/10_SSRS_REST_API_Examples.ps1
    SwaggerHub: SQL Server 2017 Reporting Services REST API
    Best Regards,
    Joy


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.