Unable to Preview Reports

2 posts, 0 answers
  1. erniej
    erniej avatar
    28 posts
    Member since:
    Sep 2006

    Posted 25 Jul 2008 Link to this post

    Good Morning,

    As per the tutorials I have created a ReportsLib class library which is referenced from a web app.  Database access is via a DAL which is also a separate class library compiled into a dll.  Databinding is to business objects returned by the DAL.   This all works fine when the reports are called from the web application.
    However when I try and preview the reports in the designer I get an Exception as follows:

    Exception has been thrown by the target of an invocation. Unable to read connection string from the .config file.

    This is similar in nature to when I referenced the DAL from a separate Unit Testing class library. Obviously the class library projects do not have access to the web config containing the connection string.  In that case creating an app.config containing the connection string in the UnitTest project did the trick.

    Unfortunately the same approach did not work for the ReportsLib project.  Is there something else I need to do to get the preview functionality to work if my datasource is obtained from another class library which obtains its connection string from the config file?

    Any assistance is much appreciated.


    Ernie Josefik

    P.S. running version Q1 2008
  2. Steve
    Steve avatar
    10941 posts

    Posted 25 Jul 2008 Link to this post

    Hi Ernie,

    You can use the application settings file (default name Settings.settings). We're using it in our examples that we ship along with the product - you can install them and review the implementation. More info available here:
    • http://msdn.microsoft.com/en-us/library/a65txexh(VS.80).aspx
    • http://msdn.microsoft.com/en-us/library/aa730869(VS.80).aspx
    Hope this helps.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft R3 2016 release webinar banner
Back to Top