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

Repeating Report

1 Answer 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 03 Aug 2017, 03:00 AM

Hi Experts,
I need to have a report break AFTER the PathwayId changes. I have used 2 queries/reports to get the desired results:
For the Header/Footer of the report which shows the Title, Description, Date and Score of each Pathway I used:

SELECT DISTINCT r.PathwayId,  p.Title, p.Description, s.Score, CONVERT(Varchar(10), s.CreateDate, 101) AS [Date]
  FROM ucare.Responses r
  INNER JOIN ucare.RiskScores s ON s.ScheduleId = r.ScheduleId
  INNER JOIN ucare.Pathways p ON p.Id = r.PathwayId
  WHERE r.ScheduleId = @Enc AND PathwayId IN (Select DISTINCT PathwayId FROM ucare.Responses
  WHERE r.ScheduleId = @Enc )and Score = (SELECT MAX(Score) FROM ucare.RiskScores
  WHERE ScheduleId = @Enc)
  GROUP BY r.PathwayId,  p.Title, p.Description,  s.Score, s.CreateDate
  ORDER BY r.PathwayId, p.Title

For the Detail section Sub-Report that will have the Questions and Answers per each Pathway I have used:

SELECT PathwayId, d.Label AS Question,
CASE WHEN Text = 'False' THEN 'No'
     WHEN Text = 'True' THEN 'Yes'
     ELSE Text END AS Answer, CONVERT(Varchar(10), EntryDate, 101) AS Entered
FROM ( SELECT p.PathwayId, p.Text, p.EntryDate, p.DecisionInputId,
      MAX(p.EntryDate) over (PARTITION BY p.PathwayId) AS Entered
      FROM ucare.Responses p
      WHERE p.ScheduleId = @Enc) t
  INNER JOIN ucare.DecisionInputs d ON d.Id = t.DecisionInputId
  WHERE EntryDate = Entered
  ORDER BY PathwayId

I’ve placed this report in the detail section with approximately 50 other sub-reports linked with the report parameters of @CaseNum and/or @Enc.

The diagram below is showing what I need this report to output:
Pathway_1_Title                           Date_Entered
      Question_1                          Answer_1
      Question_2                          Answer_2
      Question_3                          Answer_3
Pathway_1_Description                     Score
Pathway_2_Title                           Date_Entered
      Question_1                          Answer_1
      Question_2                          Answer_2
      Question_3                          Answer_3
Pathway_2_Description                     Score
Pathway_3_Title                           Date_Entered
      Question_1                          Answer_1
      Question_2                          Answer_2
      Question_3                          Answer_3
Pathway_3_Description                     Score

Any help or guidance will be appreciated. If you need anymore info please do not hesitate to ask.

Thank you,

Jack Willhoite

1 Answer, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 07 Aug 2017, 01:06 PM
Hi Jack,

You can check for the updates in the support ticket #1123597. For other community members interested in this topic, below is the reply from the ticket:

"The only way to force page breaks in reports is with a PageBreak property of report sections. For example, if you group the data in the master report by PathwayId each group can start from a new page after setting PageBreak property of Group Header or Group Footer sections.

If PageBreak property is not used the report will be paged according to report's PageSettings, size of report sections items and their KeepTogether properties - Understanding Pagination.

If you need to filter the sub report's data based on the current PathwayId you can map it to the value of sub report's parameter when configuring the ReportSource of the Subreport item - SubReport - Passing Parameters to a SubReport.
The approach is similar to the Invoice sample report located in Telerik Reporting installation foler ([installation folder]\Telerik\Reporting [version]\Report Designer\Examples)."


Regards,
Katia
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Greg
Top achievements
Rank 1
Answers by
Katia
Telerik team
Share this question
or