Display report from cascading params

  • Hello All

    Ive created two datasets from cascading parameters,

    the first displays a list of DB tables as per this query,

    SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES

    The second displays the corresponding columns from this table selection as per this query,

    SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME IN (@TableSelection)

    Im trying to display the results of the parameter selections in a report with this but no go.

    DECLARE @sql nvarchar (1000)

    SET @sql = N' SELECT ' + QUOTENAME(@ColumnSelection) + N' FROM ' QUOTENAME(@TableSelection)

    EXEC sp_executesql @sql

    Im very much a beginner with SSRS.

    Any help much appreciated.

    Thanks in advance.

  • Where are you putting the code in the 3rd part?

    So, if I understand correctly, you have two lists, one should be dependent on the other, so if you click on a row in the top grid, the details should be in the bottom grid?

  • Hi Matthew

    Thanks for your reply

    The first param list gives tables in the DB, as per the first query.

    The second param list is dependent upon the selection from the first param list and gives the list of corresponding columns in the DB, as per the second query.

    I wish to display this selection as a report which will show all the records for the selected columns but I dont know how to use the selected param values to create this report.

    Ideally there would also be a filter but ill get to that later.

    The third piece of code is an attempt at a dynamic sql statement to generate a dataset using the param selections, with which to display the report. Ive attempted to put this code in a third dataset, and, clearly dont know what im doing.

    Cheers

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply