unable to preview report when using ObjectDataSource

2 posts, 0 answers
  1. Louise
    Louise avatar
    1 posts
    Member since:
    Jun 2013

    Posted 03 Mar 2014 Link to this post

    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.
  2. Peter
    Peter avatar
    1629 posts

    Posted 05 Mar 2014 Link to this post

    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


    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!

Back to Top