Question

I have a report that I am building which uses a rowset with six child rowsets. I am generating this report via pplcode on a button. I declare the rowsets:

rs_resp = CreateRowset(Record.AVZ_JD_RESP_TBL);
&rs_expr = CreateRowset(Record.AVZ_JD_EXPR_TBL);
&rs_skls = CreateRowset(Record.AVZ_JD_SKLS_TBL);
&rs_educ = CreateRowset(Record.AVZ_JD_EDUC_TBL);
&rs_lic = CreateRowset(Record.AVZ_JD_LIC_TBL);
&rs_cond = CreateRowset(Record.AVZ_JD_COND_TBL);
&rs_dtl = CreateRowset(Record.AVZ_JD_DTL_VW, &rs_resp, &rs_expr, &rs_skls, &rs_educ, &rs_lic, &rs_cond);

Then I go through and fill the rowsets:

&rs_dtl.Fill("WHERE FILL.AVZ_JD_DESCRID = :1 AND EFFDT = %DATEIN(:2)", &jdDescrID, &effdt); 

And so on.

On my report, I have some stuff from the parent rowset at the top, and then the child rowsets (with "section headers") following:

Child One: data from &rs_resp

Child Two: data from &rs_expr ... My problem is not all of the rowsets will have data & I want to exclude those sections from my report. I first attempted to use the @numrows in a conditional region on the RTF template, but was quickly reminded that even empty rowsets have at least 1 row...

The challenge seems to be getting the title as well as the data area to be affected by the condition...

Has anyone done this, or have any ideas?

Thanks!

Was it helpful?

Solution

You current order seems to be something like,
Parent 1
Parent 2

   Child 1.1
   Child 1.2
   Child 2.1
   Child 2.2
   Child 1.3
   Child 1.4
   Child 2.3
   Child 2.4
   Child 1.5

In the approach that you are trying to use above, you will end up having all the parent rows in the &rs_dtl and all the child rows in the respective rowsets. In this case, you will need to search for the corresponding child rows (for each parent row that is present) in the RTF template, which I would say is a tedious task.

Instead try ordering the rowset in the following order :

Parent 1
   child 1
   child 2
   child 3
   child 4
Parent 2
   child 1
   child 2
   child 3
   child 4

This will make it easier for you to print the child rows for the parent rows. Also, checks can be put in - to verify if the child rows are empty and print accordingly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top