reportingrdlc

Adding a subreport to rdl table cell


I have this RDL report, which needs to show a list of objects. each objects itself contains multiple charts and tables so my idea was to add a single table in my report and add a sub-report to the table cell and feed the id of each object via a parameter to the sub-report.

This is how my report currently looks like: enter image description here

Many sites suggest that the proper file may be selected by navigating to the supreport properties screen and using the browse button on the "Use this report as subreport" section, but my designer has no browse button: enter image description here

My first thought is I'll just type in the path. But this doesn't work because it won't support : or \

Here I'd like to mention that we deploy our report in a subfolder of our application's deployment folder(generally something on the lines of "C:\Program Files\Company\Application\data\ReportDefinitions") Also the report files are not included in the application's solution. They're loaded at run time as needed.

I've also checked what msdn has to say on the matter. Some pages suggest using an expression like ="path" but this doesn't work for the same reasons.

Another article from Microsoft says something in the line of: enter image description here

but this doesn't work either it just can't find the report sub-report in any way: enter image description here enter image description here

I've double checked and triple checked. The sub report is in the same folder as the main report and it's name is correct, but it just won't see it

I've already spent hours on this and I feel like I've exhausted every option. What am I missing?


Solution

  • It seems my problem was not loading the subreport properly. I load and render my reports pragmatically. Adding the following line overcame the problem

    localReport.LoadSubreportDefinition(
                "SingleCalibrationCurveReport",
                new StreamReader(Path.Combine(this.systemSettings.DataPath, @"ReportDefinitionFiles\SingleCalibrationCurveReport.rdlc")));