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:
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:
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