Page 1 of 1

Deriving from Stimulsoft.Report.StiReport

Posted: Mon Jun 19, 2006 3:40 pm
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.

Deriving from Stimulsoft.Report.StiReport

Posted: Tue Jun 20, 2006 3:16 am
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.