I am using controls Devxpress and specifically XtraReports to complete a system for editing user reports.
In this case I am loading from the database a Report from a serialized XML and the main report is correctly generated. But this report has a Subreport (like XRSubReport) embedded in the XML (as seen in the image). The problem is that at runtime, when obtaining subreport control from the main report, the subreport has the Reportsource to null property, although as indicated by the XML, it contains the sub-port code .
I was able to make it work by separating the XML code of the subreport in another report and assigning it to ReportSource again, but it is a solution that forces me to store the code of each subreport separate from the main report and I do not see it necessary if it already includes it the main report.
I have to say that as indicated by the Devxpress documentation I am accessing the ReportSource property from the BeforePrint event and even then this is null. I add that I need ReportSource to set the Datasource of the subreport.