Dynamically change connection string using parameter

4 posts, 0 answers
  1. JD
    JD avatar
    1 posts
    Member since:
    Nov 2018

    Posted 16 Nov 2018 Link to this post

    I want to create 1 report where a user would select a parameter and the report would connect to that parameters database.

    Right now, I've created multiple reports that are pretty much the same except they are connecting to different databases. I would just like 1 report and based on the parameter the user chooses it will connect to that database.

     

     

     

  2. Silviya
    Admin
    Silviya avatar
    399 posts

    Posted 19 Nov 2018 Link to this post

    Hi JD,

    Please check this excellent KB article on the same topic - Change Connection String dynamically through a report parameter.

    Regards,
    Silviya
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Bob
    Bob avatar
    65 posts
    Member since:
    Aug 2010

    Posted 09 Sep Link to this post

    I created the parms as instructed in the article but I am getting an error when trying to preview the report in the designer.

    "Format of the initialization string does not conform to the specification starting at index 0"

    Do I need to escape or enclose the connection string ?

  4. Silviya
    Admin
    Silviya avatar
    399 posts

    Posted 10 Sep Link to this post

    Hello Bob,

    The "Format of the initialization string does not conform to specification starting at index 0" error message is usually shown when the configuration file of the application does not contain the required named connection string. For more information please check the Connection Strings and Configuration Files MSDN page.

    When the reports get rendered in a web application, the configuration file is the corresponding Web.config file. In the Report Designer, the Reporting engine is running in the context of the designer application, hence it is necessary to register the connection string in its configuration file:
       - In the case of Visual Studio designer, this is the App.config file of the corresponding ReportLibrary project.
       - In the case of Standalone designer, this is the Telerik.ReportDesigner.exe.config file that can be found in the folder where the designer executable file is deployed - by default (Telerik Reporting installation folder)\Report Designer.
    For more information, please, refer to Configuration article.

    Please check the configuration file and make sure that the named connection string used in the report definition exists there.

    In case the issue persists, please open a new support ticket and send us a runnable sample project exhibiting the issue, so we can review it locally and advise accordingly.

    Best Regards,
    Silviya
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top