Question


Last activity: 21 Jul 2015 14:05 EDT
Is it possible to use a subreport in a subreport?
This question is on behalf of a customer and regards Pega 7.1.7:
"Is there a way to include subreports within subreports? When we attempt to use a report definition for a subreport which already contains a subreport we get a validation error to prevent this."
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution


Pegasystems
IN
- How are you trying to get only the most recent record? Are you using the sub report to return the MAX(pxUpdateDateTime) or something like that?
- Did you trying using ranking to get the most recent record?
- Define main report on A
- Define two sub reports for report on A
- Sub report 1 is defined on B. In that report use ranking to get the data for the most recent record based on the data in A
- Sub report 2 is defined on C. In that report use ranking to get the data for most recent record based on the data returned in B.


Pegasystems Inc.
US
David,
Unless it has changed recently, a subreport cannot have its own subreport.
Matt


Seniorlink
US
OK, and there's a validation that prevents the configuration. The question is really if there's an alternative to solve the following within a report definition.
I have a three tables A, B, and C such that for a row in A there will be multiple rows in B which match the key and we want the most recent (sys update date is a key as well) from B for a record in A. C is such that there will, again, be several records and we only care about the most recent in relation to a given row in B. So, for the most recent A we want the most recent B and for that most recent B we want the most recent C. A single layer of sub-reports will allow us to select for the most recent B, but without multiple layers we're not able to support this within a single report definition.
Barry


Pegasystems Inc.
US
Barry,
I believe that have done similar things in the past using the Class Joins and Associations on the Data Access tab of a Report Definition rule. Someone from either the Casino Royale or DB Dynamos team should be able to provide better direction.
Matt
Accepted Solution


Pegasystems
IN
- How are you trying to get only the most recent record? Are you using the sub report to return the MAX(pxUpdateDateTime) or something like that?
- Did you trying using ranking to get the most recent record?
- Define main report on A
- Define two sub reports for report on A
- Sub report 1 is defined on B. In that report use ranking to get the data for the most recent record based on the data in A
- Sub report 2 is defined on C. In that report use ranking to get the data for most recent record based on the data returned in B.


Seniorlink
US
Let me share this with our development team and see if we can work it out with your idea. It's pretty reasonable and reflects Matt's suggestion above. So a performance question, as a follow up: I could make a data page for each level that returns the more atomic results and then assemble in a data transform within the (Grand)Parent data page. How is that compared to a report of all nodes (this join) rather than building the nodes up?
Thank you both so much for your input,
Barry


Pegasystems
IN
Database queries work well if the right indices are defined on the columns and you get less data into memory compared the data page approach. So it boils down to how many records are we talking about in each of these tables.


Seniorlink
US
Right now, small, less than 50 records in most of the first pass queries. I think the combination of indices and the suggestion of how to structure the sub-reports above should let us work through the requirement we're trying to satisfy.