Focal Point
Formatting Issue While Printing in Loop...

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

April 30, 2008, 09:25 AM
focuzsambit
Formatting Issue While Printing in Loop...
i am printing my report in pdf in a loop. I have attached the code below.

Now the issue is that the tabular-report that is coming in the first part of the page is coming fine but the tabular-reports that coming next to that in a page(s) are getting deformatted.

any set command to put it in track??

-SET &SLNO = 0;
-SET MAXCNT = &LINES;
-TYPE MAXCOUNT IS &MAXCNT
-TYPE MAXCOUNT IS &MAXCNT
-RUN
-SET &IORETURN = 0;
-REPEAT :end_read WHILE &IORETURN EQ 0;
-READ TEST NOCLOSE &LINE.A15.
-IF &IORETURN NE 0 GOTO :end_read;
-SET &SLNO = &SLNO+1;
-TYPE SLNO = &SLNO
-TYPE LINE = &LINE
-RUN
-TYPE &SLNO
-SET &PDFFOR1 = IF &SLNO EQ '1' THEN 'ON TABLE PCHOLD FORMAT PDF OPEN NOBREAK' ELSE 'ON TABLE PCHOLD FORMAT PDF NOBREAK';
-SET &PDFFOR2 = IF &SLNO LT &MAXCNT THEN 'ON TABLE PCHOLD FORMAT PDF NOBREAK' ELSE 'ON TABLE PCHOLD FORMAT PDF CLOSE';
-IF &SLNO GT &MAXCNT GOTO LOOPEND;
-*-------------------------------------------------------------------------------------------------------------------
-* FIRST PROJECT DETAILS WITH HEADER
-*-------------------------------------------------------------------------------------------------------------------
TABLE FILE PCDAGS
SUM
     PM
     OSR
-*     DM
-*     REM
-*     DPM
BY PNAME AS 'Project Name'
BY PNUMBER AS 'Project,Number'
BY CYEAR AS 'Cycle Year'
BY CMONTH AS 'Cycle,Month'
WHERE PNUMBER EQ '&LINE'
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
	 PAGESIZE='Legal',
     SQUEEZE=OFF,
     ORIENTATION=LANDSCAPE,
$
TYPE=REPORT,BORDER=LIGHT,FONT='ARIAL',SIZE=8,COLOR='BLACK',BACKCOLOR='NONE',STYLE=NORMAL,$
TYPE=DATA,COLOR='WHITE',BACKCOLOR='SILVER',STYLE=BOLD,JUSTIFY=CENTER,$
TYPE=TITLE,BACKCOLOR=RGB(158 15 9),STYLE=BOLD,JUSTIFY=CENTER,$
TYPE=TITLE,COLUMN=N1,JUSTIFY=LEFT,$
TYPE=DATA,COLUMN=N1,JUSTIFY=LEFT,$
TYPE=REPORT,COLUMN=N1,WRAP=2.1700000,$
TYPE=REPORT,COLUMN=N2,WRAP=1.160000,$
TYPE=REPORT,COLUMN=N3,WRAP=1.175000,$
TYPE=REPORT,COLUMN=N4,WRAP=1.175000,$
TYPE=REPORT,COLUMN=N5,WRAP=1.175000,$
TYPE=REPORT,COLUMN=N6,WRAP=1.175000,$
TYPE=REPORT,COLUMN=N7,WRAP=1.175000,$
TYPE=REPORT,COLUMN=N8,WRAP=1.175000,$
TYPE=REPORT,COLUMN=N9,WRAP=1.175000,$
ENDSTYLE
&PDFFOR1
END
-TYPE &PDFFOR1
-*-------------------------------------------------------------------------------------------------------------------
-* DOCUMENTS SUMMARY PRINTING
-*-------------------------------------------------------------------------------------------------------------------
TABLE FILE PMAGS3
PRINT
TOT/I8   AS 'Total'
THREE  AS '3 - 5, days'
FIVE   AS '5 - 15, days'
FIFTEEN  AS '15 - 30, days'
THIRTY   AS 'Greater than 30, days'
BY NUMBER NOPRINT
BY PROJECTID NOPRINT
BY DOCTYPE AS ''
BY CATEGORY NOPRINT
WHERE NUMBER EQ '&LINE'
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
	 PAGESIZE='Legal',
     SQUEEZE=ON,
     ORIENTATION=LANDSCAPE,
$
TYPE=REPORT,BORDER=LIGHT,FONT='ARIAL',SIZE=8,COLOR='BLACK',BACKCOLOR='NONE',STYLE=NORMAL,$
TYPE=REPORT,COLUMN=N1,WRAP=3,$
TYPE=DATA,JUSTIFY=CENTER,$
TYPE=TITLE,BACKCOLOR=RGB(158 15 9),STYLE=BOLD,JUSTIFY=CENTER,$
TYPE=TITLE,COLUMN=N3,BACKCOLOR='NONE',BORDER-TOP=OFF,BORDER-BOTTOM=LIGHT,BORDER-LEFT=OFF,BORDER-RIGHT=LIGHT,$
TYPE=DATA,COLUMN=N1,STYLE=BOLD,JUSTIFY=LEFT,$
TYPE=REPORT,COLUMN=N3,WRAP=2.00000,$
TYPE=REPORT,COLUMN=N5,WRAP=0.990000,$
TYPE=REPORT,COLUMN=N6,WRAP=0.99000,$
TYPE=REPORT,COLUMN=N7,WRAP=0.99000,$
TYPE=REPORT,COLUMN=N8,WRAP=0.97000,$
TYPE=REPORT,COLUMN=N9,WRAP=0.97000,$
TYPE=DATA,COLUMN=N5,TARGET='_blank',
FOCEXEC=pm_aging_document_detail.fex(PROJECTID=N2 CATEGORY=N3 AGE='0'),$
TYPE=DATA,COLUMN=N6,TARGET='_blank',
FOCEXEC=pm_aging_document_detail.fex(PROJECTID=N2 CATEGORY=N3 AGE='5'),$
TYPE=DATA,COLUMN=N7,TARGET='_blank',
FOCEXEC=pm_aging_document_detail.fex(PROJECTID=N2 CATEGORY=N3 AGE='15'),$
TYPE=DATA,COLUMN=N8,TARGET='_blank',
FOCEXEC=pm_aging_document_detail.fex(PROJECTID=N2 CATEGORY=N3 AGE='30'),$
TYPE=DATA,COLUMN=N9,TARGET='_blank',
FOCEXEC=pm_aging_document_detail.fex(PROJECTID=N2 CATEGORY=N3 AGE='31'),$
ENDSTYLE
&PDFFOR2
END
-RUN
-TYPE &PDFFOR2
-:end_read
-GOTO LOOPEND
-LOOPEND
-TYPE LOOP ENDS



WF Server: 7.1.4 on Z/OS and Linux, ReportCaster
Data: DB2, DB2/UDB, Adabas, SQL Server, Oracle Output: HTML,PDF,Excel2K
WF Client: Servlet, CGI
April 30, 2008, 09:35 AM
Leah
I'm not sure if there is a solution. As you are doing it to an HTML page, sometimes the styling seems to be ignored, why? Any one else?
I don't use -READ so don't know if the Dialog Manager commands are an issue or not.


Leah
April 30, 2008, 09:35 AM
focuzsambit
and also when i am printing in browser, the formatting are not getting applied properly in 2nd print.

Isn't webfocus intelligent to handle these kinda codes....or am i making any blunders ??

any pointer...highly appreciable...

tks/sam


WF Server: 7.1.4 on Z/OS and Linux, ReportCaster
Data: DB2, DB2/UDB, Adabas, SQL Server, Oracle Output: HTML,PDF,Excel2K
WF Client: Servlet, CGI
April 30, 2008, 09:37 AM
focuzsambit
well, if i look the code in debug mode..then all DM comands are working fine but formatting??

And i can print in HTML and PDF through this way...but how to in Excel... Mad


WF Server: 7.1.4 on Z/OS and Linux, ReportCaster
Data: DB2, DB2/UDB, Adabas, SQL Server, Oracle Output: HTML,PDF,Excel2K
WF Client: Servlet, CGI
April 30, 2008, 10:03 AM
Francis Mariani
First, this is a PDF report, correct?

Second, I would set &ECHO=ON to see the code generated by WebFOCUS. Check to see if the stylesheet is applied to every report in the loop. Check to see if the COMPOUND PDF statements get applied correctly. Instead of incorporating the OPEN/CLOSE clauses of the COMPOUND report in the ON TABLE PCHOLD command, I prefer issuing the command independently:

Here's an example:

-SET &ECHO=ALL;

SET HOLDFORMAT = ALPHA
SET HOLDLIST = PRINTONLY
SET PAGE = NOPAGE
-RUN

TABLE FILE CAR
SUM COUNTRY
BY COUNTRY NOPRINT
ON TABLE HOLD AS CAR1
END
-RUN

-SET &COUNTRY_C = &LINES;

SET COMPOUND = OPEN
-RUN

TABLE FILE CAR
SUM COUNTRY AS ''
BY COUNTRY NOPRINT
HEADING
"COUNTRIES IN THIS REPORT"
" "
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
UNITS=IN, PAGESIZE='Legal', SQUEEZE=ON, ORIENTATION=LANDSCAPE, $
TYPE=HEADING, SIZE=13, $
TYPE=REPORT, FONT='Arial', SIZE=10, COLOR=RED, $
END
-RUN

-REPEAT LOOP_END &COUNTRY_C TIMES;

-READ CAR1 NOCLOSE &COUNTRY.A10.

TABLE FILE CAR
SUM SALES
BY CAR
ACROSS MODEL
WHERE COUNTRY EQ '&COUNTRY'
HEADING
"SALES REPORT FOR <COUNTRY"
" "
ON TABLE PCHOLD FORMAT PDF NOBREAK
ON TABLE SET STYLE *
UNITS=IN, PAGESIZE='Legal', SQUEEZE=ON, ORIENTATION=LANDSCAPE, $
TYPE=HEADING, SIZE=13, $
TYPE=REPORT, FONT='Arial', SIZE=10, COLOR=RED, $
ENDSTYLE
END
-RUN

TABLE FILE CAR
SUM DEALER_COST
BY MODEL
ACROSS MODEL
WHERE COUNTRY EQ '&COUNTRY'
HEADING
"INVENTORY REPORT FOR <COUNTRY"
" "
ON TABLE PCHOLD FORMAT PDF NOBREAK
ON TABLE SET STYLE *
UNITS=IN, PAGESIZE='Legal', SQUEEZE=ON, ORIENTATION=LANDSCAPE, $
TYPE=HEADING, SIZE=13, $
TYPE=REPORT, FONT='Arial', SIZE=10, COLOR=GREEN, $
ENDSTYLE
END
-RUN

TABLE FILE CAR
PRINT MODEL
WHERE COUNTRY EQ '&COUNTRY'
HEADING
"MODEL LIST FOR <COUNTRY"
" "
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET PAGE OFF
ON TABLE SET STYLE *
UNITS=IN, PAGESIZE='Legal', SQUEEZE=ON, ORIENTATION=LANDSCAPE, $
TYPE=HEADING, SIZE=13, $
TYPE=REPORT, FONT='Arial', SIZE=10, COLOR=BLUE, $
ENDSTYLE
END
-RUN

-LOOP_END

SET COMPOUND = CLOSE
-RUN

TABLE FILE CAR
PRINT CAR NOPRINT
WHERE RECORDLIMIT EQ 1
FOOTING
"END OF REPORT"
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET PAGE OFF
ON TABLE SET STYLE *
UNITS=IN, PAGESIZE='Legal', SQUEEZE=ON, ORIENTATION=LANDSCAPE, $
TYPE=FOOTING, SIZE=13, $
TYPE=REPORT, FONT='Arial', SIZE=10, COLOR=ORANGE, $
ENDSTYLE
END
-RUN



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
April 30, 2008, 10:09 AM
Francis Mariani
EXL2K example:

-SET &ECHO=ALL;

SET HOLDFORMAT = ALPHA
SET HOLDLIST = PRINTONLY
SET PAGE = NOPAGE
-RUN

TABLE FILE CAR
SUM COUNTRY
BY COUNTRY NOPRINT
ON TABLE HOLD AS CAR1
END
-RUN

-SET &COUNTRY_C = &LINES;

SET COMPOUND = OPEN
-RUN

TABLE FILE CAR
SUM COUNTRY AS ''
BY COUNTRY NOPRINT
HEADING
"COUNTRIES IN THIS REPORT"
" "
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='Summary', $
TYPE=HEADING, SIZE=13, $
TYPE=REPORT, FONT='Arial', SIZE=10, COLOR=RED, $
END
-RUN

-REPEAT LOOP_END &COUNTRY_C TIMES;

-READ CAR1 NOCLOSE &COUNTRY.A10.

TABLE FILE CAR
SUM SALES
BY CAR
ACROSS MODEL
WHERE COUNTRY EQ '&COUNTRY'
HEADING
"SALES REPORT FOR <COUNTRY"
" "
ON TABLE PCHOLD FORMAT EXL2K NOBREAK
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='&COUNTRY', $
TYPE=HEADING, SIZE=13, $
TYPE=REPORT, FONT='Arial', SIZE=10, COLOR=RED, $
ENDSTYLE
END
-RUN

TABLE FILE CAR
SUM DEALER_COST
BY MODEL
ACROSS MODEL
WHERE COUNTRY EQ '&COUNTRY'
HEADING
"INVENTORY REPORT FOR <COUNTRY"
" "
ON TABLE PCHOLD FORMAT EXL2K NOBREAK
ON TABLE SET STYLE *
TYPE=HEADING, SIZE=13, $
TYPE=REPORT, FONT='Arial', SIZE=10, COLOR=GREEN, $
ENDSTYLE
END
-RUN

TABLE FILE CAR
PRINT MODEL
WHERE COUNTRY EQ '&COUNTRY'
HEADING
"MODEL LIST FOR <COUNTRY"
" "
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET PAGE OFF
ON TABLE SET STYLE *
TYPE=HEADING, SIZE=13, $
TYPE=REPORT, FONT='Arial', SIZE=10, COLOR=BLUE, $
ENDSTYLE
END
-RUN

-LOOP_END

SET COMPOUND = CLOSE
-RUN

TABLE FILE CAR
COUNT COUNTRY AS 'COUNTRY COUNT'
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET PAGE OFF
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='Count', $
TYPE=FOOTING, SIZE=13, $
TYPE=REPORT, FONT='Arial', SIZE=10, COLOR=ORANGE, $
ENDSTYLE
END
-RUN



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
May 01, 2008, 01:17 AM
focuzsambit
thanks francis....but i am working offline ...so will chk and will let u know...if this patch goes through...

one more suggestion required...
while i am printing in browser the formatting not getting applied (for 2nd print) properly but getting diluted by the formatting for 1st print...

any help ??

This message has been edited. Last edited by: focuzsambit,


WF Server: 7.1.4 on Z/OS and Linux, ReportCaster
Data: DB2, DB2/UDB, Adabas, SQL Server, Oracle Output: HTML,PDF,Excel2K
WF Client: Servlet, CGI
May 01, 2008, 08:09 AM
Tony A
Sam,

Right click and view your source and you will see that each has it's own style. The problem with this is that the browser will only take one style fo a CSS class of x1 etc. (WebFOCUS default. To overcome this you could use the CLASS syntax of WF style sheets and then create your own CSS include or style section using SET CSSURL = [path to css file] or HTMLFORM BEGIN etc.

APP PREPENDPATH IBISAMP IBINCCEN
TABLE FILE CAR
SUM RCOST DCOST
BY COUNTRY
BY CAR
BY MODEL
ON TABLE HOLD AS MYREP FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
  UNITS=IN, PAGESIZE='Legal', SQUEEZE=ON, ORIENTATION=LANDSCAPE, $
TYPE=REPORT, BORDER=LIGHT, FONT='ARIAL', SIZE=8, COLOR='BLACK', BACKCOLOR='NONE', STYLE=NORMAL, $
TYPE=DATA, COLUMN=N1, CLASS=Col1, $
TYPE=DATA, COLUMN=N2, CLASS=Col2, $
ENDSTYLE
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<style>
.Col1 {font-color: #ffffff; background-color: #9e0f09; text-align: middle;}
.Col2 {font-color: #000000; background-color: #ffffff; text-align: middle;}
</style>
</head>
<body>
!IBI.FIL.MYREP;
</body>
</html>
-HTMLFORM END

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
May 05, 2008, 02:25 AM
focuzsambit
tony..i got ur point.
but if u will look at the code, i have 2 prints (one summary and one detail...one after another) and i have to print it for all the projects (there can be 100 projects also).

Now if i will take hold file approach, it will create 200 hold files..which is not advisable to create and also if i go for that approach, it's failing due to huge no of hold file.

Is there a way to ensure that the different styles are getting applied to different prints, without getting overlapped in the loop.

tks/sam


WF Server: 7.1.4 on Z/OS and Linux, ReportCaster
Data: DB2, DB2/UDB, Adabas, SQL Server, Oracle Output: HTML,PDF,Excel2K
WF Client: Servlet, CGI
May 05, 2008, 08:40 AM
Tony A
Sam,

Read my post again and you will see that there are ors contained within it. In your situation I would use the SET CSSURL and the CLASS= syntax within WF styling without the HTMLFORM BEGIN etc.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10