locked
having two datasets but not having to load both. RRS feed

  • Question

  • Hi experts,

     

    I am using report builder 2017…

     

    I have a parameter which is a drop down… and depending on which one they select show a different dataset…

     

    I know I can achieve it by putting a visibility IF… but the problem is that, it will load both, regardless if I show it or not… and they are quite consuming…

     

    Isnt there a way of showing and loading only the one selected.

    Thursday, March 8, 2018 4:44 PM

All replies

  • Hi maca128, 

    According to your description, it seems that you want to use parameter to choose which dataset to use in report(dynamic dataset), right?

    If the datasets have the same columns, you could use the stored produce like below to create dataset

    create procedure DifferentResultSet
    ( 
         @SelectResultSet int
    )
    as
    if @SelectResultSet=1 
    BEGIN 
        select * from cat1
    END 
    ELSE if @SelectResultSet=2
    BEGIN 
        select * from cat2
    END

    Use this to create dataset in report, then you choose use parameter to choose which dataset to use.

     You could refer to this post for details.

    But if you have added two datasets in report and want to use parameter to choose which one to execute. I think this can't be achieved, if the dataset existed in report, they will be executed when preview the report

    Best Regards,
    Zoe Zhi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, March 9, 2018 1:50 AM