This is a migrated thread and some comments may be shown as answers.

Unable to Preview Reports

1 Answer 111 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
erniej
Top achievements
Rank 1
erniej asked on 25 Jul 2008, 09:26 AM
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.

Cheers

Ernie Josefik

P.S. running version Q1 2008

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 25 Jul 2008, 09:57 AM
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.

Greetings,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
erniej
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or