0

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!

Chip
  • 1,653
  • 2
  • 20
  • 27
  • thanks navi - I am actually generating the report via a button on the page, so I am only dealing with one parent (and its children) at a time. The report does work as expected, but the problem is the empty rowsets -- how do I check for empty rowsets? – Chip May 09 '12 at 14:15

1 Answers1

1

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.

navi
  • 179
  • 1
  • 7
  • Would using a conditional region to check if the keys in the child rows are set help? – navi May 13 '12 at 03:20