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

location of business objects

1 Answer 67 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 10 Feb 2011, 04:07 AM
Hi,

I have not been able to have a report display when the business object is located outside the report's class library project.  I have added a reference to the business object's project, and the report designer allows me to set up a data source and view fields in the data explorer, but when I click on preview it says:

Error has been thrown by the target of an invocation.
------------------- InnerException ------------
Object reference not set to an instance of an object.


When I move the business object into the report library and hardcode its connection string, then it works.  I notice that the sample app supplied by Telerik also has the business object in the report library.  Is this a necessity, or can the business objects be in another project?

Thanks.
Ron

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 10 Feb 2011, 05:13 PM
Hello Ron,

There is no problem to have the DAL in separate project and this is how most users proceed. Most likely there is another thing causing the error and not the fact it is outside the class library. Run your actual application and check the Output window in Visual Studio - it should contain a stack trace so we can identify the problem. Additionally you can enable CLR exceptions in Visual Studio to see the actual error in the InnerException.
On a side note, the best practices for keeping the reports in a separate class library is valid only when your project is web site project. If it is any other kind of application, you can place the reports directly in your project.

Kind regards,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
Tags
General Discussions
Asked by
Ron
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or