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

Need parent - multiple child report (or how to simulate multiple detail sections)

3 Answers 170 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Don
Top achievements
Rank 1
Don asked on 06 Apr 2013, 04:47 PM
I have a report that has a single parent (Patient) and multiple children (test results, recommendations, background information) with forced page breaks before each section. This is NOT a hierarchy it is distinct sets of information for the patient. 

In other products that I am familiar with you would create multiple detail sections but i understand from reading that this is not supported. I've tried to simulate this feature with groups but there only seems to be one hierarchy of groups. 

I've tried dropping each logical detail section in panels but:
a. there does not seem to be a way to create a page break for a panel
b. keeptogether does not always work as I would expect when the height of the section changes (i.e. if the kept-together section is longer than a page the first lines of it will be pushed to the prior page rather than creating a page break)

I am using report designer and pushing the XML report definitions to a server and then running them from there so assembling a set of subreports is not practical.

Any suggestions would be greatly appreciated.
Don Rule
Translational Software

3 Answers, 1 is accepted

Sort by
0
Milen | Product Manager @DX
Telerik team
answered on 10 Apr 2013, 01:32 PM
Hi Don,

The easiest way to implement your scenario is using a ReportBook. It natively supports combining distinct reports (and that is what you have - distinct reports with common ReportParamenter named Patient) in a single document. Each additional report will be rendered on a new page.

See a sample code demonstrating how to combine trdx reports in a single ReportBook instance:

[Description("A collection of Patient-related reports")]
 public class ReportBook : Telerik.Reporting.ReportBook
 {
     public ReportBook()
     {
         Report report1 = DeserializeReport(@"C:\PATHtoTRDX\TestResults.trdx");
         report1.ReportParameters["Patient"].Value = "John";
         this.Reports.Add(report1);
  
         Report report2 = DeserializeReport(@"C:\PATHtoTRDX\Recommendations.trdx");
         report2.ReportParameters["Patient"].Value = "John";
         this.Reports.Add(report2);   
     }
  
     public Report DeserializeReport(string path)
     {
         System.Xml.XmlReaderSettings settings = new System.Xml.XmlReaderSettings();
         settings.IgnoreWhitespace = true;
  
         using (System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(path, settings))
         {
             Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer =
                 new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
             Telerik.Reporting.Report report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
             return report;
         }
     }
 }

Please find more information on the subject in the help chapter Report Book.


All the best,
Milen
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
Don
Top achievements
Rank 1
answered on 22 May 2013, 06:53 PM
I don't think that these are distinct reports they are just different sections of the same report. They have the same title and footer and I want to instantiate the data for them once. It is somewhat closer to a subreport but since I am pushing all the report definitions to a database and loading them dynamically from my server i don't want to track the subreport dependencies. There is probably an even I could listen for when the subreport is loaded by the main report but that would result in a lot of round trips to the database.

I simulated this using groups but that is a very poor solution. When you want to add a new section you need to add a new group and then move the data in all other sections around.

There has got to be a better way than that.

Thanks,
Don Rule
0
Stef
Telerik team
answered on 27 May 2013, 03:36 PM
Hi Don,

Basically these are the approaches we can suggest you according to the provided information:
  1. Using grouping based on the types of details that will be loaded for a Patient and a SubReport item in the detail section. According to the grouping criteria the SubReport.ReportSource can be set to the required report document from your database. Each group section has a PageBreak property.
  2. Each detail about the Patient can be defined in a separate report document, and all details can be gathered within a ReportBook as illustrated by my colleague.

In both cases data can be retrieved at once and shared between report documents.

If you need further help, please open a support ticket and send us the report definitions, the desired report layout and the logic which is used to load specific information about a patient.

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Tags
General Discussions
Asked by
Don
Top achievements
Rank 1
Answers by
Milen | Product Manager @DX
Telerik team
Don
Top achievements
Rank 1
Stef
Telerik team
Share this question
or