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

unable to preview report when using ObjectDataSource

1 Answer 222 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Louise
Top achievements
Rank 1
Louise asked on 03 Mar 2014, 03:12 PM
When using an ObjectDataSource in the standalone report designer I am unable to preview the report. When I click the preview button I get an error that reads:

"An error occurred while invoking data retrieval method.
Exception has been thrown by the target of an invocation.
Object reference not set to an instance of an object."

The report works correctly and renders fine when running it through our application, but refuses to preview from the designer even though all design work, data source creation etc has been done through the designer.

We were intending to allow users to edit the reports themselves, certainly to change style and/or formatting, but this will not be possible without the ability to preview the reports. We don't want to have to force the end user to have to run the report through our application every time they want to see a change to the styling etc, but this seems to be the only thing that works.

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 05 Mar 2014, 05:08 PM
Hi Louise,

When previewing a report the report is executed in the context of the standalone Report Designer and as described in MSDN,  the ConfigurationManager.ConnectionStrings property "gets the  ConnectionStringsSection data for the current application's default configuration". Generally in case of standalone Report Designer this is Telerik.ReportDesigner.exe.config

It seems that because you have used a custom data access layer (DAL) to access your database data and your DAL is not able to read the ConfigurationManager.ConnectionStrings. In order to avoid the error our suggestion is to add the configuration in Telerik.ReportDesigner.exe.config

Generally to debug your data access layer while you are using the designer you have to open a Visual Studio instance, select Debug->Attach to process to debug the Telerik.ReportDesigner.exe and select Debug->Exception... to enable  the First Chance Exceptions

Regards,
Peter
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

Tags
Report Designer (standalone)
Asked by
Louise
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or