Changing the database in the report

  • Hello,

    I am currently creating a report in Visual Studio.

    The specification from my company is that you select a customer number ID via a parameter in the report. Each customer has their own data source with their own username and password. Depending on which customer I have selected in my report, the database should be changed dynamically.

    I tried it with the expression in the data source via a switch statement

    =switch(Parameters!NL_Nr.Value.ToString="CusID011","Data Source=10.68.1.112;Initial Catalog=DB1 ;User ID=c1;Password=pas1", Parameters!NL_Nr.Value.ToString = "CusID022","Data Source=10.58.1.111;Initial Catalog=DB2 ;User ID=c2;Password=pas2")

    With this solution, the IP address of the server and the database name are transmitted, but the password and username are not.

    Does somebody has any idea? Thank you

  • Two thoughts...

    1. If you aren't already, would changing the data source's credential settings to "Prompt for credentials" work?  Then you wouldn't have to specify the password in the connection string.
    2. It's possible that this might not work in VS preview, but will when deployed to the report server.  If you haven't already, try deploying to a test environment and see.  Even if it doesn't work there, sometimes you can get more helpful error messages.

    Not sure if that helps, but its all I got.  🙂

    "When it comes to report design and development, I have a list of pet peeves a mile wide. You might think the list would be a mile long, but I like to turn it on its side, sharpen the end, and poke people with it." - Me

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

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