I have a copy of a report with a hardcoded Database name and everything works correctly, but the version of the report where I pass in database name as a parameter has some issue with the other parameters on the screen.
First issue - I have a default value for one of the fields on the report (the last field). When I first open the report it works correctly. If I then change one of the parent values in a hierarchy field it will clear out that default value.
Second Issue - I have 2 sets of hierarchy fields in order (Account/Portfolio), (Group/Class) that both select all items by default. If I choose a valid group/class combination and then choose an Account (the parent value from the hierarchy list) it will reset the Group/Class lists to all.
I did a bit of testing around this and noticed the behavior below.
The issue where changing the parent value in the first hierarchy list causing the second hierarchy list to reset to all - always happens in row by row order. So by default the (Account/Portfolio) hierarchy item is above the (Group/Class) item. With that layout, updating the Group will NOT cause any Account/Portfolio issues. HOWEVER if I move the Group/Class item ABOVE the Account/Portfolio in the parameter list then changing Product Group WILL cause the Account/Portfolio to reset to All.
If I select a single portfolio (or group of portfolios) that are all VALID for the single Account I'm going to choose BEFORE I choose the account, then, when I pick the account, the issues do NOT occur.
If I move the default parameter above the hierarchy parameters then it does not clear out the value when I choose a parent hierarchy value.
So from what it seems like to me, somehow it's building out a behind the scenes query to rebuild all the lists of values for the screen. Since I just choose a single "Account" that "Portfolio" dropdown technically has invalid values (all the portfolios from other accounts) so it errors the SQL query at that point, and anything that would happen afterwards fails and resets. The strange part is that for a hardcoded DB name, it all works perfectly.
So hoping to find an answer on how to resolve this?
Did a little more testing (Still haven't gotten a resolution), it's not so much the parameterized Database name, it's putting the database name into an expression at all. Even if it's hardcoded.
So if the data source is setup directly in the Data Source Properties window it works. Using the exact same data source by clicking the function key and putting it in as ="Data Source= Catalog=" The behavior changes and it starts to fail, and yes you can see the different behavior right in Visual Studio by changing from expression data source to direct data source.