Deriving from Stimulsoft.Report.StiReport

Stimulsoft Reports.NET discussion
Post Reply
Bert Bell
Posts: 3
Joined: Tue Jun 13, 2006 1:23 pm
Location: Bay Area, CA, USA

Deriving from Stimulsoft.Report.StiReport

Post by Bert Bell »

I created a C# class derived from Stimulsoft.Report.StiReport

class MyDerivedReport : Stimulsoft.Report.StiReport.

I have the assembly registered in the GAC and added assembly reference in the report Designer. I used the code editor to change the base class from StiReport to MyDerivedReport. The Preview fails with a message:

Method: [Create Instance]
Object reference not sset to an instance of an object.

Looking at the StiReport.cs source code I found that the GetReportsFromAssembly method expects
type.BaseType == typeof(StiReport)

Any suggestions to work around this??

I could change the source line to type.IsSubclassOf(typeof(StiReport)) but I don't know the reason for the restriction of direct derivation.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Deriving from Stimulsoft.Report.StiReport

Post by Vital »

bert123 wrote:I created a C# class derived from Stimulsoft.Report.StiReport

class MyDerivedReport : Stimulsoft.Report.StiReport.

I have the assembly registered in the GAC and added assembly reference in the report Designer. I used the code editor to change the base class from StiReport to MyDerivedReport. The Preview fails with a message:

Method: [Create Instance]
Object reference not sset to an instance of an object.

Looking at the StiReport.cs source code I found that the GetReportsFromAssembly method expects
type.BaseType == typeof(StiReport)

Any suggestions to work around this??

I could change the source line to type.IsSubclassOf(typeof(StiReport)) but I don't know the reason for the restriction of direct derivation.
As i understand you create class inherited from StiReport and want use this class for create, design and preview report? if yes, then you can use static property
StiReport.ReportType. By default this property equal typeof(StiReport). For also please contact to support[at]stimulsoft[dot]com. We send you link to version with updated code in type.BaseType == typeof(StiReport).

Thanks.
Post Reply