Using an in-between class between Telerik.Reporting.Report and a report.

13 posts, 1 answers
  1. Patrick
    Patrick avatar
    286 posts
    Member since:
    Aug 2012

    Posted 16 Feb 2012 Link to this post

    Hello,
    the enclosed code was working with the 2011 Q3 version of Telerik Reporting but not with the 2012 Q1 version.
    The idea is to define a class that inherits from Telerik.Reporting.Report and to base the reports on this class instead of the Telerik one. The goal is to put in this class code that is common to more than one report to avoid duplicating code.
    So I define a class like this:

    using System;
    using Telerik.Reporting;
     
    namespace TestInheritedReport
    {
      public class MyReport : Telerik.Reporting.Report
      {
      }
    }
    And now my report inherits from MyReport instead of Telerik.Reporting.Report.
    The problem is now that every time I change something in the designer and click on the preview tab, I have an error message that says:
    The service Telerik.Reporting.Design.Interfaces.IRootDesignerPresenter already
    exists in the service container. Parameter name: serviceType


    And the call stack is:
    at System.ComponentModel.Design.ServiceContainer.AddService(Type serviceType,
    ServiceCreatorCallback callback, Boolean promote)
    at
    System.ComponentModel.Design.ServiceContainer.AddService(Type serviceType,
    ServiceCreatorCallback callback)
    at
    Telerik.Reporting.Design.VisualStudio.DependencyLoader.Initialize(IDesignerHost
    host)
    at Telerik.Reporting.Design.ReportRootDesigner.LoadDependencies()
    at
    Telerik.Reporting.Design.ReportRootDesigner.Initialize(IComponent
    component)
    at
    System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent
    component, String name, IContainer containerToAddTo)
    at
    System.ComponentModel.Design.DesignerHost.PerformAdd(IComponent component,
    String name)
    at
    System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type
    componentType, String name)
    at
    System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type
    type, ICollection arguments, String name, Boolean addToContainer)
    at
    System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type
    type, ICollection arguments, String name, Boolean addToContainer)
    at
    System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager
    manager, CodeTypeDeclaration declaration)
    at
    System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
    manager)
    at
    Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
    serializationManager)
    at
    System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost
    host)


    In C#, I had to close the designer and open it again to make it work. In Oxygene (Delphi Prism), I had to close Visual Studio and open it again to make the designer work again; otherwise, it displays a black page with just a rectangle!
    It's really a waste of time to work this way

    Patrick

  2. Elian
    Admin
    Elian avatar
    435 posts
    Member since:
    Sep 2012

    Posted 17 Feb 2012 Link to this post

    Hi Patrick,

    Thank you for pointing out this problem to us, we will investigate the issue further on and fix it.

    Side note: We have observed some dependency between this problem and the usage of events. Try to detach all the events from the code-behind and see if the issue still appears, if that may be of help.

    We have updated your Telerik points as a token of gratitude for bringing this to our attention.

    Greetings,
    Elian
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

  3. Patrick
    Patrick avatar
    286 posts
    Member since:
    Aug 2012

    Posted 17 Feb 2012 Link to this post

    Hi Elian,
    in my case this is not an issue with events because I don't attach any event, as you can see in the test case.
    Patrick

  4. Steve
    Admin
    Steve avatar
    10942 posts
    Member since:
    May 2014

    Posted 17 Feb 2012 Link to this post

    Hello Patrick,

    This was just an observation i.e. another case in which the problem surfaces. We are looking into the problem and would address it for subsequent internal build/service pack.

    Kind regards,
    Steve
    the Telerik team

    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

  5. Lucania
    Lucania  avatar
    65 posts
    Member since:
    May 2011

    Posted 07 Mar 2012 Link to this post

    I just encountered this, on a report with events. Detaching the events did seem to remove the problem, although it only happened occasionally anyway, so I can't be 100% sure.

  6. Abhi
    Abhi avatar
    3 posts
    Member since:
    Oct 2010

    Posted 15 Mar 2012 Link to this post

    I'm using 2012 Q1 version of Telerik Reporting.

    And I too had the same issue which Patrick has.
    Please tell me when this issue is gonna fixed or any work around for it.

    Thanks,
    Abhi

  7. Steve
    Admin
    Steve avatar
    10942 posts
    Member since:
    May 2014

    Posted 15 Mar 2012 Link to this post

    Hi Abhi,

    Closing the report designer and re-opening it is something we have found works. As stated previously, we would address the issue for the upcoming service pack (no date yet).

    Regards,
    Steve
    the Telerik team

    NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.

  8. Richard
    Richard avatar
    9 posts
    Member since:
    Jun 2009

    Posted 20 Mar 2012 Link to this post

    Unfortunately, I also have this problem and it occurs on every build of the project. Closing the designer and reopening does fix it albeit annoying...until the next build. 

  9. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 14 Apr 2012 Link to this post

    I having the same issue too
    Guess I have to revert back to the old version

  10. Answer
    Steve
    Admin
    Steve avatar
    10942 posts
    Member since:
    May 2014

    Posted 17 Apr 2012 Link to this post

    Hi guys,

    This problem has been addressed in the latest internal build which is available for download in your accounts.

    All the best,
    Steve
    the Telerik team

    NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.

  11. Patrick
    Patrick avatar
    286 posts
    Member since:
    Aug 2012

    Posted 28 Jun 2012 Link to this post

    Hello,
    this bug is corrected is Q2 2012
    Patrick

  12. Emiliya
    Emiliya avatar
    1 posts
    Member since:
    Dec 2012

    Posted 24 Apr 2013 Link to this post

    Hi, I am still using Telerik Reporting Q1 2012 and I experience the same issue. I  also inherit an in-between class between Telerik.Reporting.Report and a report.
    Unfortunately I am not allowed to use another Telerik Reporting version yet.
    Do you have any suggestions how I can fix the problem without upgrading the Telerik Reporting Version?

    Thank you!

  13. IvanY
    Admin
    IvanY avatar
    416 posts
    Member since:
    Sep 2012

    Posted 26 Apr 2013 Link to this post

    Hi Emiliya,

    Up to your question: unfortunately you will have to either upgrade or downgrade to a version that does not have this issue since no workaround is available for the current version and problem.

    Greetings,
    IvanY
    the Telerik team

    Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Back to Top