Focal Point
Strange Error

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

April 08, 2005, 12:49 PM
Kamesh
Strange Error
Hi,
I'm trying the compound html report with this sample database code but it is not working in Self Service Application (working in WF Console). If I comment the ECHO it's working but I dont think the problem with that. After run this program, check your view source and look for html tag. You can find the html tag starts in between the code.
eg; TYPE=HEADING,'<'html'>'
If anybody have any suggestion, Please let me know.

Note: In my sample code, html tags I'm not included '<' and '>' as it is not allowing me to type that here.

Thanks
Kamesh


-SET ECHO=ALL;

SET HTMLCSS = OFF
-DEFAULT &NOIMG = 'NO';
-DEFAULT &SKPALL = 'YES';

-DEFAULT &I=2;
-DEFAULT &J=0;
-DEFAULT &FORMAT='HTML';

SET LINES=9999
SET PAGE=99999999

-HTMLFORM BEGIN
TITLE USBANK Sample Report /TITLE
-HTMLFORM END


DEFINE FILE CAR
NCAR/A20 = '&' || 'NEW' || CAR;
END
-RUN

TABLE FILE CAR
PRINT
CAR NOPRINT
IF RECORDLIMIT EQ 1
HEADING
"SAMPLE REPORT"
"Printed on 03-25-2005"
ON TABLE PCHOLD FORMAT HTML
-******************************************
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT,IMAGE=/IMAGES/test_LOGO.gif,
POSITION=(+0.000000 +0.000000),ALT='test Logo',JAVASCRIPT= closewin(),$
-INCLUDE STYLEV01IR
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
html
head
SCRIPT LANGUAGE="JavaScript"
function closewin()
{
window.close()
}
/SCRIPT
/head
/html
-HTMLFORM END

-LOOPBNK
-IF &J EQ &I THEN GOTO ENDPRG;
DEFINE FILE CAR ADD
SP/A1=HEXBYT(160,'A1');
END

TABLE FILE COURSE
PRINT *
ON TABLE HOLD FORMAT HTMTABLE AS PYDYCBO1
ON TABLE SET STYLE *
TYPE=REPORT,FONT='ARIAL',SIZE=9,$
-INCLUDE STYLEV01IR
ENDSTYLE
END
-RUN

TABLE FILE CAR
BY CAR NOPRINT
WHERE CAR EQ 'BMW' OR 'JAGUAR'
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS CAREQBMW
END
-RUN

-IF &LINES EQ 0 THEN GOTO ERRNOBMW;

TABLE FILE CAR
PRINT BODYTYPE MODEL OVER
SEATS DEALER_COST OVER
SP AS ''
BY CAR NOPRINT
IF CAR EQ 'BMW' OR 'JAGUAR'
ON TABLE SUBHEAD
"DETAILS ABOUT BMW AND JAGUAR CARS"
ON CAR SUBFOOT
"SUBTOTAL: <ST.DEALER_COST"
ON TABLE SUBFOOT
"---END OF REPORT---"
ON TABLE NOTOTAL
ON TABLE SET PAGE NOLEAD
ON TABLE HOLD FORMAT HTMTABLE AS PYDYCBO2
ON TABLE SET STYLE *
-INCLUDE stylev01ir
ENDSTYLE
END
-RUN
-GOTO CARNEBMW;

-ERRNOBMW
TABLE FILE CAR
BY CAR NOPRINT
ON TABLE SUBHEAD
"NO BMW CAR AVAILABLE"
ON TABLE HOLD FORMAT HTMTABLE AS PYDYCBO2
ON TABLE SET STYLE *
-INCLUDE STYLEV01IR
ENDSTYLE
END
-RUN

-CARNEBMW
TABLE FILE CAR
BY CAR NOPRINT
WHERE CAR NE 'BMW'
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS CARNEBMW
END
-RUN

-IF &LINES EQ 0 THEN GOTO ERRBMW;

TABLE FILE CAR
PRINT NCAR
BY CAR
IF CAR NE 'BMW'
ON TABLE SUBHEAD
"DETAILS ABOUT CARS OTHER THAN BMW AND JAGUAR"
ON CAR SUBFOOT
"</1 SUBFOOT ON 2ND REPORT"
ON TABLE SUBFOOT
"---END OF REPORT---"
ON TABLE HOLD FORMAT HTMTABLE AS PYDYCBO3
ON TABLE SET STYLE *
-INCLUDE stylev01ir
ENDSTYLE
END
-RUN

-GOTO CNTPRG;
-ERRBMW
TABLE FILE CAR
BY CAR NOPRINT
ON TABLE SUBHEAD
"BMW CAR NOT AVAILABLE"
ON TABLE HOLD FORMAT HTMTABLE AS PYDYCBO3
ON TABLE SET STYLE *
-INCLUDE STYLEV01IR
ENDSTYLE
END
-RUN
-CNTPRG
-SET &J=&J+1;

-HTMLFORM BEGIN
html
head
style type="text/css"
table { border-collapse: collapse; }
td {border: 0px; padding-left: 4px;}
.rborder { border-right: 1px solid black; }
.tborder { border-top: 1px solid black; }
.bborder { border-bottom: 1px solid black;
border-top: 1px solid black; }
.border { border-bottom: 1px solid black;
border-top: 1px solid black;
page-break-before:always; }
.pagebreak {page-break-before:always; }
/style
/head
body
table
TR TD !IBI.FIL.PYDYCBO1; /TD /TR
TR TD !IBI.FIL.PYDYCBO2; /TD /TR
TR TD !IBI.FIL.PYDYCBO3; /TD /TR
p STYLE="page-break-before:always" /p
/table
/body
/html
-HTMLFORM END


-GOTO LOOPBNK;

-ENDPRG

TABLE FILE CAR
BY CAR
ON TABLE HOLD AS TEMPFILE
END
-RUN

TABLE FILE CAR
BY CAR
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
-INCLUDE STYLEV01IR
ENDSTYLE
END
-RUN


TABLE FILE CAR
BY COUNTRY
ON TABLE HOLD FORMAT HTMTABLE AS PYDYCBO4
ON TABLE SET STYLE *
-INCLUDE STYLEV01IR
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
!IBI.FIL.PYDYCBO4;
-HTMLFORM END

-EXIT
April 08, 2005, 02:32 PM
<Pietro De Santis>
Like I mentioned in my private note to you, you cannot have more than one
<html><br /></html>
tag set in an html page - the web browser progam may behave unpredictably.

First, remove all the
<html><br /></html>
tag sets in between the main one.

Then, adjust other things, like
<head><br /></head>
- there should only be one in an html page.

As well, this program could be better written - first, use one DM loop to create all the reports in HTMTABLE format and then, use another DM loop to include them in the html page.
April 08, 2005, 03:01 PM
Kamesh
I tried using one html tag only, even that didn't work. And also I tried only one loop and finally included all the htmtable in to html. That also didn't work.