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

Adding detail section and sub report not working

7 Answers 459 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
rh
Top achievements
Rank 1
rh asked on 19 Oct 2008, 11:37 PM
When I use the following code my detail section (backDetail) doesn't show. It is like it is completely ignoring it. Why?

RalphsReportDuplex report = new RalphsReportDuplex();  
 
                RalphsPostcardFront01 front = report.PostcardFront.ReportSource as RalphsPostcardFront01;  
 
                Telerik.Reporting.DetailSection backDetail = new Telerik.Reporting.DetailSection();  
                backDetail.Name = "PostcardBack";  
                backDetail.ColumnCount = 2;  
                backDetail.Height = new Telerik.Reporting.Drawing.Unit(4.05F, Telerik.Reporting.Drawing.UnitType.Inch);  
 
                Telerik.Reporting.SubReport backSubReport = new Telerik.Reporting.SubReport();  
                backSubReport.Height = backDetail.Height;  
                backSubReport.Location = new Telerik.Reporting.Drawing.PointU(  
                    new Telerik.Reporting.Drawing.Unit(0F),  
                    new Telerik.Reporting.Drawing.Unit(0F));  
                backSubReport.Size = new Telerik.Reporting.Drawing.SizeU(  
                    new Telerik.Reporting.Drawing.Unit(5.10F, Telerik.Reporting.Drawing.UnitType.Inch),  
                    new Telerik.Reporting.Drawing.Unit(4.05F, Telerik.Reporting.Drawing.UnitType.Inch));  
                RalphsPostcardBack01 back = new RalphsPostcardBack01();  
                backSubReport.ReportSource = back;  
 
                report.Items.Add(backDetail);  
                backDetail.Items.Add(backSubReport); 

7 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 20 Oct 2008, 01:04 PM
Hi rh,

The code you've sent looks correct. However it is not clear where do you use this code and what is the RalphsReportDuplex() report. Generally it is best practice to use the designer to create what you need and then see the code it produced in the InitializeComponent() method to understand what is needed for the programmatic creation.

All the best,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
rh
Top achievements
Rank 1
answered on 20 Oct 2008, 03:28 PM
I can't figure out in the designer how to add multiple detail sections. If I could figure that out then I wouldn't even have to bother trying to make it work in code.
0
Steve
Telerik team
answered on 20 Oct 2008, 04:11 PM
Hello rh,

You can't find a way to add multiple detail sections, because it is officially not supported. Is there any reason why you would need a second detail section? What do you expect that it would happen and would be different from having a single one? Please elaborate on your scenario.

Sincerely yours,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
rh
Top achievements
Rank 1
answered on 20 Oct 2008, 04:38 PM
I am creating a report that is the combination of a couple of other reports that we already have. So it makes sense for me to just use sub reports that combine the sub reports onto a new composite report. However, I need page breaks between the sub reports and the only way to get page breaks is on a section (header, detail. etc). There isn't a page break property on the sub report component.

For this particular scenario I could probably have one of the sub reports in the report header and the other in the report detail. However, it would probably be good for us to know why adding a detail section programatically isn't working with the posted code.
0
Steve
Telerik team
answered on 22 Oct 2008, 01:06 PM
Hello rh,

As we've stated previously - the code you've posted is correct and should work. Most likely the reason it is not working on your end is that you're trying to add more than one details section, which is not officially supported scenario and as such has never been researched and tested on.

Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Adrian Segovia
Top achievements
Rank 1
answered on 11 May 2010, 07:42 PM
Hello Telerik,
 You  stated that multiple detail sections are not supported. My question is how come when I import a report from Crystal Reports I see more than one detail section? The report in Crystal is pretty long and I need to create a long report now. How do I create a second detail section? or is there a round around  that I can use?

thanks

Adrian
0
Adrian Segovia
Top achievements
Rank 1
answered on 11 May 2010, 07:55 PM
Hello Telerik,

Nevermind I just realized that the "detailsection2" is a panel...

Sincerely

Adrian
Tags
General Discussions
Asked by
rh
Top achievements
Rank 1
Answers by
Steve
Telerik team
rh
Top achievements
Rank 1
Adrian Segovia
Top achievements
Rank 1
Share this question
or