Focal Point
[SOLVED] Repeated subhead formatting issue

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3557073276

August 26, 2014, 09:34 AM
suni
[SOLVED] Repeated subhead formatting issue
Hello,
I was able to figure out a way to make the 3 subheads in my report to repeat on the next page if the detail data flows on to the next page by using the row count code as below. However, I am not able to figure out a way to break the Rowcnt subhead, item by item further down and I need different formatting for all these 3 subheads.

I have given separate backgrounds for each item in LINE 1 and it shows row as a vertical column.(Screen shot below) Is there a way to identify each item by item?

PRINT
'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.SMPL_DATE' AS ''
'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.TEST_CODE' AS ''
'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.TEST_DESCRIPTION' AS ''
'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.ADDITIONAL_INDICATION' AS ''
'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.ORDER_SIGNED' AS ''
'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.NON_ESRD' AS ''
COMPUTE ROWCNT/I9 = LAST ROWCNT + 1; NOPRINT
BY 'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.CONTRACT_NAME' NOPRINT
BY 'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.CLINIC_ID' NOPRINT
BY 'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.SHORT_NAME' NOPRINT
BY 'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.PATIENT_NAME' NOPRINT
BY 'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.SAMPLE_DATE' NOPRINT
BY 'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.CONTRACT_ID' NOPRINT
BY 'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.PATIENT_ID' NOPRINT
BY 'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.COMPOSITE_DATE' NOPRINT
BY 'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.PLAN_NUMBER' NOPRINT
BY 'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.PLAN_NAME' NOPRINT
BY 'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.TEST_CODE' NOPRINT
BY 'PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.PROGRESSNOTES' NOPRINT
BY TOTAL ROWCNT NOPRINT

ON ROWCNT SUBHEAD
" "
WHEN PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.CONTRACT_ID NE LAST PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.CONTRACT_ID OR TABPAGENO NE LAST TABPAGENO;

ON ROWCNT SUBHEAD
" "
WHEN PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.CLINIC_ID NE LAST PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.CLINIC_ID OR TABPAGENO NE LAST TABPAGENO;

ON ROWCNT SUBHEAD
" WHEN PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.PATIENT_ID NE LAST PRC_OUTSIDE_LAB_RESULTS.ANSWERSET1.PATIENT_ID OR TABPAGENO NE LAST TABPAGENO;
$
TYPE=SUBHEAD,
BY=ROWCNT,
LINE=1,
ITEM=1,
OBJECT=FIELD,
BACKCOLOR='RED',
WIDTH = 1,
JUSTIFY=LEFT,
$
TYPE=SUBHEAD,
BY=ROWCNT,
LINE=1,
ITEM=2,
OBJECT=FIELD,
BACKCOLOR='GREEN',
WIDTH = 1.5,
JUSTIFY=LEFT,

$
TYPE=SUBHEAD,
BY=ROWCNT,
LINE=1,
ITEM=3,
OBJECT=FIELD,
BACKCOLOR='BLUE',
$
TYPE=SUBHEAD,
BY=ROWCNT,
LINE=1,
ITEM=4,
OBJECT=FIELD,
BACKCOLOR='YELLOW',

This message has been edited. Last edited by: <Kathryn Henning>,


Webfocus 7.6.1,Windows 7
August 26, 2014, 10:39 AM
j.gross
The three subheads for ROWCNT are conceptually a single subhead of three lines (with each line made contingent on a WHEN condition). To control the style of each separately, think of the output when all three WHEN conditions are true, and set LINE accordingly.

So simply repeat the STYLE declaration for LINE=1 two more times, with LINE=2 and with LINE=3, and then modify as needed.
August 26, 2014, 11:33 AM
suni
Thank you for your response j.gross. but, I am very new to web focus development. Can you please help me with sample code. Also, this report is about 200 pages and there is no way I can anticipate all the 3 subhead conditions to be true to make it happen. I would like to know if this is even doable? Is there a better way to make the subhead repeat on to next pages without having to use rowcount? Please help.


Webfocus 7.6.1,Windows 7
August 26, 2014, 04:27 PM
j.gross
This may be of help.


- Jack Gross
WF through 8.1.05
August 29, 2014, 02:38 PM
suni
Hi,
I had to write below code to make the (new) subhead reappear on the next page


DEFINE FILE XXX
CON_FL/I1=IF CONTRACT_ID NE LAST CONTRACT_ID THEN 1 ELSE 0;
CLI_FL/I1=IF CLINIC_ID NE LAST CLINIC_ID THEN 1 ELSE 0;
PAT_FL/I1=IF PATIENT_ID NE LAST PATIENT_ID THEN 1 ELSE 0;
RPT_FL/I1= CON_FL + CLI_FL + PAT_FL;
END
-----
PRINT
BY 'XXX.ANSWERSET1.RPT_FL' NOPRINT

ON CONTRACT_ID SUBHEAD
""
ON CLINIC_ID SUBHEAD
""
ON PATIENT_ID SUBHEAD

ON RPT_FL SUBHEAD
"SUBHEAD 1"
"SUBHEAD 2"
"SUBHEAD 3"
WHEN RPT_FL EQ 0 AND TABPAGENO NE LAST TABPAGENO AND TABPAGENO NE 1
ON RPT_FL NOSPLIT

Thanks everyone who tried helping me on this.
I am not able to edit the subject line to update it with [SOLVED]


Webfocus 7.6.1,Windows 7