Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to fix this problem?

Error 2 'School_Software.RptStudents.NewGenerator': no suitable method found to override C:\Users\user\Downloads\Compressed\school_software_0\School Software\School Software\RptStudents.cs 33 31 School Software

Below is Code

C#
namespace School_Software {
   
    
    
    public class RptFinalMarksLedger : ReportClass {
        
        public RptFinalMarksLedger() {
        }
        
        public override string ResourceName {
            get {
                return "RptFinalMarksLedger.rpt";
            }
            set {
                // Do nothing
            }
        }
        
        public override bool NewGenerator {
            get {
                return true;
            }
            set {
                // Do nothing
            }
        }
        
        public override string FullResourceName {
            get {
                return "School_Software.RptFinalMarksLedger.rpt";
            }
            set {
                // Do nothing
            }
        }
        
        [Browsable(false)]
        [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public CrystalDecisions.CrystalReports.Engine.Section Section1 {
            get {
                return this.ReportDefinition.Sections[0];
            }
        }
        
        [Browsable(false)]
        [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public CrystalDecisions.CrystalReports.Engine.Section Section2 {
            get {
                return this.ReportDefinition.Sections[1];
            }
        }
        
        [Browsable(false)]
        [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public CrystalDecisions.CrystalReports.Engine.Section Section3 {
            get {
                return this.ReportDefinition.Sections[2];
            }
        }
        
        [Browsable(false)]
        [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public CrystalDecisions.CrystalReports.Engine.Section Section4 {
            get {
                return this.ReportDefinition.Sections[3];
            }
        }
        
        [Browsable(false)]
        [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public CrystalDecisions.CrystalReports.Engine.Section Section5 {
            get {
                return this.ReportDefinition.Sections[4];
            }
        }
    }
    
    [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")]
    public class CachedRptFinalMarksLedger : Component, ICachedReport {
        
        public CachedRptFinalMarksLedger() {
        }
        
        [Browsable(false)]
        [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public virtual bool IsCacheable {
            get {
                return true;
            }
            set {
                // 
            }
        }
        
        [Browsable(false)]
        [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public virtual bool ShareDBLogonInfo {
            get {
                return false;
            }
            set {
                // 
            }
        }
        
        [Browsable(false)]
        [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public virtual System.TimeSpan CacheTimeOut {
            get {
                return CachedReportConstants.DEFAULT_TIMEOUT;
            }
            set {
                // 
            }
        }
        
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
            RptFinalMarksLedger rpt = new RptFinalMarksLedger();
            rpt.Site = this.Site;
            return rpt;
        }
        
        public virtual string GetCustomizedCacheKey(RequestContext request) {
            String key = null;
            
            return key;
        }
    }
}


What I have tried:

public class RptFinalMarksLedger : ReportClass 

Tried to put partial like this below
public partial class RptFinalMarksLedger : ReportClass 

not working
Posted
Updated 1-Sep-17 6:44am
v2
Comments
Karthik_Mahalingam 9-Feb-17 6:15am    
post only the relevant code, dont dump entire code.
F-ES Sitecore 9-Feb-17 6:18am    
When posting code always say what line the error occurs on. Also if you don't need the "set" part of a variable then omit it entirely so the calling code knows the property is read-only.

Your base class ResourceClass needs to contains a virtual property called ResourceName in order to override it in your derived class:
C#
public class ReportClass
    {
    public virtual string ResourceName
        {
        get { return "I dunno"; }
        set { }
        }
    ...
    }
 
Share this answer
 
hello

how to solve this problem when i open my form it's not opening and show the error

"there is no editor available for 'c:\user\sajjad\\Documents\visual studio "
 
Share this answer
 
Comments
Richard Deeming 1-Sep-17 15:18pm    
If you want to ask a question, then ASK A QUESTION[^].

DO NOT post your question as a "solution" to someone else's question!

(And when you do ask a question properly, you're going to need to provide a lot more detail that you have here if you want to get an answer.)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900