I've implemented a custom ReportStorageExtension class and a custom ReportTypeService class to be able to create and store reports in a database.
However, since all reports derive from a common base class, it's impossible to create sub-reports (due to the restriction mentioned in the subject).
How can I overcome this?
P.S A sample application can be found in issue B195170 (marked Private).
I believe that you can use the CodeDOM methods to generate a report types for subreports at runtime. For instance, review the EUD nameing of nested subreports thread where a similar question has been answered.
Thank you for your very quick reply.
I looked at the thread you mentioned and I do not think this is the solution.
It is possible in the EUD to create two reports where both derive from XtraReport and have one be a sub report within the other.
Creating two reports which derive from a base class (which derives from XtraReport) however, is not possible.
A solution I've found from browsing in your code is this: Adding the RootClassAttribute to my base class.
Which consequenced could this have for my application besides enabling subreports?
Thank you for your feedback.
With the 2010.2 version of the XtraReport suite. I believe that you can utilize the XRSubreport.ReportSourceUrl property to solve this problem.
PROBLEM WITH THE REPORTSOURCE PROPERTY OF THE SUBREPORT CONTROL
Thanks for your reply.
I am using the approach you mention, and my question was not answered.
As previously stated I've found a way to use the same base class for both master and sub report. By decorating the base class with the rootclass attribute the internal validation passes.
My question was which consequences this might have besides passing validation?
Thank you for your reply. It answered my question.
I hope you do not plan to remove this check within the validation function in the future.
As a side note, why is this check here? There must have been a reason for checking for that particular attribute, and as far as I can see, this attribute is not applied to the XtraReport base class.
Basically, the RootClassAttribute is used only in the XtraReport class to designate that this class instance can be used as a subreport in the instance of the same class. However, we do not recommend using this attribute for the user-defined classes. Otherwise, you might encounter a cyclic references error and a StackOverflowException. Please feel free to contact us if you need any additional assistance. We will be happy to help you.