This is a migrated thread and some comments may be shown as answers.

SubReport Issue

3 Answers 78 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 29 Mar 2014, 09:38 PM
I found an old post with a sample for a SubReport to display hierarchical data.  There was an error in it that I cannot seem to fix.  I created my SubReport and have it working recursively.  But when I add it to my main report in the details section, it works for the first data item, but when it adds the subreport for the second data item it gives an error because there is already a SubReport with that name.  So, I add a SubReport to my details section, it automatically names it subReport1.  When I run the report the first item in my details section runs beautifully.  When it gets to the second item the Subreport displays an error because it is also named subReport1.  The Name property of Telerik.Reporting.Processing.SubReport only allows getting, not setting, so I can not programmatically rename it on ItemDataBinding.  What would the work around be for this?

3 Answers, 1 is accepted

Sort by
0
Hinata
Top achievements
Rank 1
answered on 02 Apr 2014, 02:49 PM
Hello Joshua,

I am not aware of your exact code, but it sounds like you are adding Telerik.Reporting.SubReport objects manually and multiple times via code. Instead I can suggest that you use the report designer and place a single SubReport item in the detail section of the main report. Note that the detail section is printed once for every row in the data source. This way you won't get the described error.
0
Joshua
Top achievements
Rank 1
answered on 02 Apr 2014, 03:03 PM
Incorrect.  I am adding it via the report designer into the detail section.  The first row of my data it works fine, from the second row on it gives the error message that an object with that name already exists.  I think when it renders the detail section, Telerik in the background is copying the control for each record and the name is staying the same.  I am also using an old version (2011) of the control, so it could be something that has been addressed since then.  I recently purchased the updated version so I may have to convert it to it to see if it fixes my issue.
0
Hinata
Top achievements
Rank 1
answered on 07 Apr 2014, 10:29 AM
Hi Joshua,

It is a good idea to test with the latest version, because I am unable to reproduce this on my end and I am also using latest.
If it doesn't help you can attach a sample demonstrating the issue.
Tags
General Discussions
Asked by
Joshua
Top achievements
Rank 1
Answers by
Hinata
Top achievements
Rank 1
Joshua
Top achievements
Rank 1
Share this question
or