Focal Point
Removing grid

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

July 09, 2007, 10:33 AM
<Marcel Naumann>
Removing grid
Hello all,

I want to build up an HTML table and fill it with images (key performance indicators) from several procedures. I want to turn off the grid when reusing the image from the holdfile. Here's an example of the code:

TABLE FILE EMPDATA
SUM
     COMPUTE STOPLIGHT/A150 = IF SALARY GT 100000 THEN '<IMG  SRC="http://demos.ibi.com/approot/ibicentury/r1.gif">'
	 ELSE IF SALARY LT 100000 THEN '<IMG  SRC="http://demos.ibi.com/approot/ibicentury/g1.gif">'
	 ELSE '<SRC="http://demos.ibi.com/approot/ibicentury/y1.gif">'; AS ''
ON TABLE HOLD AS KPI3 FORMAT HTMTABLE

ON TABLE SET STYLE *
TYPE=REPORT,
GRID=ON,
$
ENDSTYLE
END


-HTMLFORM BEGIN
<TABLE heigth="1" width="45%" BORDER="0" CELLPADDING="0" CELLSPACING="0" bgcolor="#C57FB2" >
	<TR>
		<td height="8"> </td>
	</TR>
	<TR>
		<TD align="left" valign="middle" Height="25"><FONT COLOR="white" FACE="arial"><strong>Test with and without borders</strong></FONT></TD>
	</TR>
		<TR>
		<td height="8"> </td>
	</TR>
	<TR>
		<TD bgcolor="#E8CCE0" valign="top" align="center" heigth="1" border="0" CELLPADDING="0">!IBI.FIL.KPI3;</TD>
	</TR>
	<TR>
	    <TD bgcolor="#E8CCE0" valign="top" align="center" heigth="0">!IBI.FIL.KPI3;</TD>
	</TR>

</TABLE>
-HTMLFORM END


Notice that this format is exactly what I want, except for the grid around the image. Turning the setting SET GRID=OFF will work for the image, but then some CSS is created by WebFOCUS which will show the images with 3 empty rows underneath. I look for both: a table with images underneath without any spacing and no borders. How do I do this?

Thanks,
Marcel

This message has been edited. Last edited by: Kerry,
July 09, 2007, 10:39 AM
Francis Mariani
Marcel,

Put your code between
[code] 
[/code]

tags so we can see the image code in the compute statements. If you don't already have it, add border=0 to the image code.


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
July 09, 2007, 10:43 AM
Francis Mariani
Your image code should be
<IMG  SRC="http://demos.ibi.com/approot/ibicentury/r1.gif" border=0>

although now I'm not sure if this will solve the problem.


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
July 09, 2007, 10:54 AM
<Marcel Naumann>
Oops,

I didn't realise that there's a WF server parsing my request. Smiler
the BORDER syntax did not resolve, unfortunately.

TABLE FILE EMPDATA
SUM
     COMPUTE STOPLIGHT/A150 = IF SALARY GT 100000 THEN '<IMG  SRC="http://demos.ibi.com/approot/ibicentury/r1.gif" border="0">'
  ELSE IF SALARY LT 100000 THEN '<IMG  SRC="http://demos.ibi.com/approot/ibicentury/g1.gif" border="0">'
  ELSE '<SRC="http://demos.ibi.com/approot/ibicentury/y1.gif" border="0">'; AS ''
ON TABLE HOLD AS KPI3 FORMAT HTMTABLE
ON TABLE SET STYLE *
TYPE=REPORT,
GRID=ON,
$
ENDSTYLE
END

-HTMLFORM BEGIN
<TABLE heigth="1" width="45%" BORDER="0" CELLPADDING="0" CELLSPACING="0" bgcolor="#C57FB2" >
 <TR>
  <td height="8"> </td>
 </TR>
 <TR>
  <TD align="left" valign="middle" Height="25"><FONT COLOR="white" FACE="arial"><strong>Test with and without borders</strong></FONT></TD>
 </TR>
  <TR>
  <td height="8"> </td>
 </TR>
 <TR>
  <TD bgcolor="#E8CCE0" valign="top" align="center" heigth="1" border="0" CELLPADDING="0">!IBI.FIL.KPI3;</TD>
 </TR>
 <TR>
     <TD bgcolor="#E8CCE0" valign="top" align="center" heigth="0">!IBI.FIL.KPI3;</TD>
 </TR>
</TABLE>
-HTMLFORM END 

July 09, 2007, 11:32 AM
mgrackin
Marcel,

If you are only going to include URL references to images in the HTMTABLE, you could try using a different output format such as WP. This will write just to contents of the fields to a file. This eliminates the additional HTML code wrapped arund the URLs to the images. I'm not sure if this will work for you but it was just a thought.

TABLE FILE EMPDATA
SUM
COMPUTE STOPLIGHT/A150 = IF SALARY GT 100000 THEN '<IMG SRC="http://demos.ibi.com/approot/ibicentury/r1.gif">'
ELSE IF SALARY LT 100000 THEN '<IMG SRC="http://demos.ibi.com/approot/ibicentury/g1.gif">'
ELSE '<SRC="http://demos.ibi.com/approot/ibicentury/y1.gif">'; AS ''
ON TABLE HOLD AS KPI3 FORMAT WP

ON TABLE SET STYLE *
TYPE=REPORT,
GRID=OFF,
$


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
July 09, 2007, 11:42 AM
mgrackin
The following seems to work as well:

Please note the additions of HTML code in BOLDFACE:

TABLE FILE EMPDATA
SUM
COMPUTE STOPLIGHT/A150 = IF SALARY GT 100000 THEN '<IMG SRC="http://demos.ibi.com/approot/ibicentury/r1.gif">'
ELSE IF SALARY LT 100000 THEN '<IMG SRC="http://demos.ibi.com/approot/ibicentury/g1.gif">'
ELSE '<SRC="http://demos.ibi.com/approot/ibicentury/y1.gif">'; AS ''
ON TABLE HOLD AS KPI3 FORMAT HTMTABLE
ON TABLE SET STYLE *
TYPE=REPORT,GRID=ON,$
ENDSTYLE
END
-HTMLFORM BEGIN
<HTML>
<STYLE>
TABLE {border:0px}
TD {border:0px}
</STYLE>
<BODY>

<TABLE heigth="1" width="45%" BORDER="0" CELLPADDING="0" CELLSPACING="0" bgcolor="#C57FB2" >
<TR>
<td height="8"> </td>
</TR>
<TR>
<TD align="left" valign="middle" Height="25"><FONT COLOR="white" FACE="arial"><strong>Test with and without borders</strong></FONT></TD>
</TR>
<TR>
<td height="8"> </td>
</TR>
<TR>
<TD bgcolor="#E8CCE0" valign="top" align="center" heigth="1" border="0" CELLPADDING="0">!IBI.FIL.KPI3;</TD>
</TR>
<TR>
<TD bgcolor="#E8CCE0" valign="top" align="center" heigth="0">!IBI.FIL.KPI3;</TD>
</TR>

</TABLE>
</BODY>
</HTML>

-HTMLFORM END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
July 09, 2007, 11:44 AM
Francis Mariani
Will this be closer to what you need:

I'm not sure if you want the "PAGE 1" text to appear twice, but SET PAGE NOLEAD removes the text and the blank cells.

TABLE FILE EMPDATA
SUM
COMPUTE STOPLIGHT/A150 =
IF SALARY GT 100000 THEN '<IMG  SRC="HTTP://DEMOS.IBI.COM/APPROOT/IBICENTURY/R1.GIF" BORDER="0">' ELSE
IF SALARY LT 100000 THEN '<IMG  SRC="HTTP://DEMOS.IBI.COM/APPROOT/IBICENTURY/G1.GIF" BORDER="0">' ELSE
                         '<SRC="HTTP://DEMOS.IBI.COM/APPROOT/IBICENTURY/Y1.GIF" BORDER="0">'; AS ''
ON TABLE HOLD AS KPI3 FORMAT HTMTABLE
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
<TABLE HEIGTH="1" WIDTH="45%" BORDER="0" CELLPADDING="0" CELLSPACING="0" BGCOLOR="#C57FB2" >
<TR>
<TD HEIGHT="8"> </TD>
</TR>
<TR>
<TD ALIGN="LEFT" VALIGN="MIDDLE" HEIGHT="25"><FONT COLOR="WHITE" FACE="ARIAL"><STRONG>TEST WITH AND WITHOUT BORDERS</STRONG></FONT></TD>
</TR>
<TR>
<TD HEIGHT="8"> </TD>
</TR>
<TR>
<TD BGCOLOR="#E8CCE0" VALIGN="TOP" ALIGN="CENTER" HEIGTH="1" BORDER="0" CELLPADDING="0">!IBI.FIL.KPI3;</TD>
</TR>
<TR>
<TD BGCOLOR="#E8CCE0" VALIGN="TOP" ALIGN="CENTER" HEIGTH="0">!IBI.FIL.KPI3;</TD>
</TR>
</TABLE>
-HTMLFORM END


Result:



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
July 09, 2007, 11:49 AM
mgrackin
Francis,

I had that thought as well that PAGE was putting the extra space in but did not test for it. I tested your code AS IS wiht WF713 and it still adds two blank lines before the image tag. The NOLEAD setting seems to be a problem in WF713.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
July 09, 2007, 12:05 PM
Francis Mariani
We go through hoops to do something simple and it gets broken in the next release!


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
July 10, 2007, 03:41 AM
Tony A
Marcel,

Mickey hit the problem you are having and it is one that always happens, we forget that WF HTMTABLE output still contains the HTML wrapper to portray the output in an HTML TABLE arrangement. To let you take control of the HTML that you will be including in your final HTMLFORM use a non-HTML output format like WP as Mickey suggests. Then the only inclusion that you will get from your output is the IMG tag that you want.

BTW you might like to check the occurences of "heigth" for spelling (I notice Francis and Mickey reproduced them in theirs as well Wink)

You also do not require the border="0" on your TD tags either as the border="0" on the TABLE tag suffices in your example.

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 
July 10, 2007, 05:30 AM
Alan B
One approach I have used when WF gets in the way(!) of what I want to achieve, is to take the data into a SAVE file and use a repeat loop and -READ:
TABLE FILE EMPDATA
SUM SALARY
COMPUTE STOPLIGHT/A150 =
IF SALARY GT 100000 THEN '<img  src="../approot/ibidemo/r1.gif">' ELSE
IF SALARY LT 50000 THEN '<img  src="../approot/ibidemo/g1.gif">' ELSE
                        '<img  src="../approot/ibidemo/y1.gif">'; AS ''
BY LASTNAME
ON TABLE SAVE
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<style>
body {background-color:gray;}
table {background-color:#ddd;}
.title {background-color:#202020;color:white;}
</style>
<head>
<table width="45%">
<tr>
<td class="title" colspan="3">Without borders</td>
</tr>
-REPEAT LOOP &LINES TIMES
-READ SAVE &NAME.A15 &SAL.12 &IMG.150
<tr><td>!IBI.AMP.NAME;</td><td>!IBI.AMP.SAL;</td><td>!IBI.AMP.IMG;</td></tr>
-LOOP
</table>
</html>
-HTMLFORM END

This allows you to put in all the formatting you want with CSS.


Alan.
WF 7.705/8.007
July 10, 2007, 01:12 PM
<Marcel Naumann>
quote:
NOLEAD

Hi all,

thanx for your quick responses! All above worked for me. Strange thing with the NOLEAD setting, indeed it worked before! Cool thing with the Dialogue Manager, Alan. I should try more with it.

Best regards,
Marcel
July 11, 2007, 04:02 PM
susannah
NOLEAD is tricky...you think you've turned it on just right, and then it seems to get turned back off if you have any other SET PAGE features anywhere in the fex.
It is, indeed, buggy




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID