Designer use when code references external dlls

5 posts, 0 answers
  1. Jeff Berry
    Jeff Berry avatar
    13 posts
    Member since:
    Jun 2009

    Posted 04 Jan 2010 Link to this post

    I cannot get the Designer to work anytime I have report logic that references an external DLL.  This includes using the Enterprise Library DLLs for data access and also using user-defined functions that reference external dlls for formatting.

    Here's a sample _NeedDataSource event.  It works fine at run time in the viewer, but the designer does not work at all.  (just like with external format functions I reference). 



    private void rptCaseLoad_NeedDataSource( object sender, EventArgs e )   
        DataSet ds = new DataSet( );   
        Database db = DatabaseFactory.CreateDatabase( );   
        using ( DbCommand cmd = db.GetStoredProcCommand( "spCaseDetail" ) )   
            cmd.CommandType = CommandType.StoredProcedure;   
            db.AddInParameter( cmd, "@caseID", DbType.Int32, iCaseID );   
            ds = db.ExecuteDataSet( cmd );   
        ( sender as Telerik.Reporting.Processing.Report ).DataSource = ds;   


    Any suggestions?
  2. Steve
    Steve avatar
    10941 posts

    Posted 05 Jan 2010 Link to this post

    Hi Jeff,

    Please define what you mean by not working. If you expect that you would have your business objects available in the Data Explorer, then you are wrong, as you should have a datasource set in the designer for that.
    If you simply cannot use the Previews in design time, then have in mind that the Telerik Report Designer operates inside the Visual Studio application. When previewing a report, the project that contains the report is compiled (if needed) and the report class is instantiated through Reflection, and passed to the previewer. This means that the report constructor is executed in the context of the Visual Studio application, so the current application is devenv.exe. Have in mind that the valid config file in this case is the devenv.exe.config file and any connectionStrings or references to your DAL should be added in that config when previewing and external assemblies present in the same folder.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Jeff Berry
    Jeff Berry avatar
    13 posts
    Member since:
    Jun 2009

    Posted 05 Jan 2010 Link to this post

    Hi Steve,

    I'm talking about the Preview tab. 

    Concerning Enterprise Library, specifically, I get:

    An error has occured while processing Report":
    Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.  The system cannot find the file specified.

  4. Jeff Berry
    Jeff Berry avatar
    13 posts
    Member since:
    Jun 2009

    Posted 05 Jan 2010 Link to this post


    Your reply helped me get on the right track.  Thank you.  I had to 
    1. Add the connectionstring settings to devenve.exe.config (for enterprise library, there are a few that need added)
    2. Copy the Enterprise library dll's into the same directory as devenv.exe (this was causing my error)
    3. Copy the other external dll I was referencing to devenv.exe directory also

    I hope this helps someone else because this has been a pain for me for awhile now.


  5. Joanna LaForte
    Joanna LaForte avatar
    4 posts
    Member since:
    Jul 2009

    Posted 06 Aug 2010 Link to this post

    Very helpful.  Thanks so much for posting your solution!  It fixed an issue I'd been struggling with today just when I needed it fixed.  :)
Back to Top