Focal Point
[SOLVED] WEBFOCUS Large DEFINE field in SUBFOOT inserting CR/LF into rendered HTML

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

October 27, 2010, 02:16 PM
CaseyF
[SOLVED] WEBFOCUS Large DEFINE field in SUBFOOT inserting CR/LF into rendered HTML
Hi everyone,

I've been researching this issue trying to get to the exact 'why' of it. I have a project where under each retreived row, I display notes as a SUBFOOT that vary in length from 1-1500 characters.

Here's the problem, occurs when using FORMAT HTMTABLE. When I take the notes from a DEFINE or COMPUTE and display them in the SUBFOOT, webfocus inserts a CR/LF into the text at various points as it generates the HTML to send to the browser.

As a result of this, when looking in the view source, instead of seeing...
1234567890 1234567890 1234567890

you might see...
1234567890 123
4567890 1234567890

Internet explorer interprets the CRLF as a space and displays accordingly with the magic space in your otherwise nicely formatted notes...

Has anyone encountered this before, and if so, do you know of a workaround? Thank you in advance.
  

I have constructed a very simplified CAR table demonstration of the issue. It saves the table in HTMTABLE FORMAT and then displays it in a HTMLFORM block.
(Note the space between the 7 and 8 on the 3rd line of the SUBFOOT)

  

DEFINE FILE CAR
TXT/A1700='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789';
END
TABLE FILE CAR
PRINT 
CAR
BY MODEL 
ON MODEL SUBFOOT
"<TXT"
ON TABLE SET STYLE *
TYPE=REPORT,SIZE=8, $
ENDSTYLE
ON TABLE HOLD FORMAT HTMTABLE AS RPT
END
-RUN


-HTMLFORM BEGIN


<html>
<body>


<table cellpadding=0 cellspacing=0 border=0 id=rpt style="width:100%;">
	<tr>
		<td style="padding: 0px 5px 0px 5px; width:100%;">
		  <div id=reportdiv>	  
		  !IBI.FIL.RPT;
		  </div>
		</td>
	</tr>
</table>


</body>
</html>
-HTMLFORM END

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


Production: 7.6.4
Test: 7.6.10
Windows XP, all output
IE6
October 27, 2010, 02:29 PM
CaseyF
I apologize, the HTML did not come through in the copy/paste of the code...

  

DEFINE FILE CAR
TXT/A1700='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 <br>';
END
TABLE FILE CAR
PRINT 
CAR
BY MODEL 
ON MODEL SUBFOOT
"<TXT"
ON TABLE SET STYLE *
TYPE=REPORT,SIZE=8, $
ENDSTYLE
ON TABLE HOLD FORMAT HTMTABLE AS RPT
END
-RUN


-HTMLFORM BEGIN


<html>
<body>


<table cellpadding=0 cellspacing=0 border=0 id=rpt style="width:100%;">
	<tr>
		<td style="padding: 0px 5px 0px 5px; width:100%;">
		  <div id=reportdiv>	  
		  !IBI.FIL.RPT;
		  </div>
		</td>
	</tr>
</table>


</body>
</html>
-HTMLFORM END

-EXIT




Production: 7.6.4
Test: 7.6.10
Windows XP, all output
IE6
October 27, 2010, 03:26 PM
Microfich
Try this:

  
.
.
.
ON TABLE PCHOLD FORMAT HTMTABLE AS RPT
END
HOLD AS RPT FORMAT HTMTABLE
-RUN



WebFOCUS 8105
Windows;
DB2, UDB, SQL Server, Oracle
FOCUS-WebFOCUS since 1981
October 27, 2010, 04:34 PM
CaseyF
Hi Microfich,

That actually worked like a charm on the simplified demonstration I provided. The problem is my actual application has a lot of css styling which is lost when I implement your solution (which DOES fix the spacing issue)...

I have added the 2 simple styles to the original demo to illustrate...

  
DEFINE FILE CAR
TXT/A1700='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 <br>';
END
TABLE FILE CAR
PRINT 
CAR
BY MODEL 
ON MODEL SUBFOOT
"<TXT"
ON TABLE SET STYLE *
TYPE=REPORT,SIZE=8, $
TYPE=SUBFOOT,CLASS=SUBFOOTCONTENT,COLSPAN=9,$
TYPE=DATA,CLASS=sicdata,$
ENDSTYLE
ON TABLE HOLD FORMAT HTMTABLE AS RPT
END

-RUN





-HTMLFORM BEGIN


<html>
<head>

<style>
.sicdata {
	background-color: #DFDED9;
	border: none;
	padding: 3px 0px 3px 4px;
	font-family: verdana;
	font-size: 12px;
	font-weight: normal;
	border-right: 1px solid #FFFFFF;
}

.SUBFOOTCONTENT {
	font-family: verdana;
	font-size: 12px;
	font-weight: normal;
	background-color: #FFFFFF;
	padding-bottom: 4px;
	white-space:normal;
}
</style>

</head>
<body>


<table cellpadding=0 cellspacing=0 border=0 id=rpt style="width:100%;">
	<tr>
		<td style="padding: 0px 5px 0px 5px; width:100%;">
		  <div id=reportdiv>	  
		  !IBI.FIL.RPT;
		  </div>
		</td>
	</tr>
</table>


</body>
</html>
-HTMLFORM END

-EXIT




Production: 7.6.4
Test: 7.6.10
Windows XP, all output
IE6
October 27, 2010, 05:13 PM
Waz
I think the issue is with the !IBI.FIL.RPT; command.

The long text only gets corrupted when included with this command.

If you can get all the code into the TABLE request and point to the CSS file for styling, then you may be able to get it working.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

October 27, 2010, 05:17 PM
Tony A
For info your original example worked on my set-up, without any changes.

What browser are you using?

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 
October 27, 2010, 05:29 PM
Francis Mariani
I recall this problem was reported fairly recently, but I cannot find the post.

It appears WebFOCUS breaks the footing into strings 498 characters long.

Correction: 511 character strings.

This message has been edited. Last edited by: Francis Mariani,


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
October 27, 2010, 06:16 PM
dbeagan
I tried
 
TYPE=REPORT,SIZE=8,  [COLOR:RED]WRAP=OFF,[/COLOR] $  


Worked for me. I would be interested to hear if it has a positive effect in your situation.


WebFOCUS 8.2.06
October 27, 2010, 06:17 PM
dbeagan
Tags don't nest. Meant to post:

TYPE=REPORT,SIZE=8, WRAP=OFF, $


WebFOCUS 8.2.06
October 28, 2010, 03:08 AM
GamP
Casey is using 7.6.3. In versions prior to 7.7 there is indeed a limit of 511 character per html record. Anything larger than that will be split into two (or more) lines.
This limit is not present anymore in 7.7.01, there these long lines are left intact.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
October 28, 2010, 09:01 AM
CaseyF
Good morning everyone, and thank you for the prompt and insightful replies.

In answer to a few questions. My users are all using IE6 currently (upgrading to IE8 in Feb).

We are using Webfocus 7.6.6 currently and are also in the process of upgrading this to 7.6.10

This makes GamP's comment that much nicer to hear. The problem should be resolved when the upgrade is complete with no further changes. I will confirm this in our sandbox environment.

Thank you again everyone. Smiler


Production: 7.6.4
Test: 7.6.10
Windows XP, all output
IE6
October 28, 2010, 10:27 AM
GamP
Mind you, 7.6.10 still has the limit. It's only with 7.7 that the limit is raised (or removed).


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
October 28, 2010, 11:06 AM
CaseyF
Oops, for some reason I read 7.7 as 7.6.7

Looks like I need to find a workaround afterall. WRAP=OFF doesn't fix the issue in 7.6.4 unfortunately.

Thank you for clearing that up for me GamP.


Production: 7.6.4
Test: 7.6.10
Windows XP, all output
IE6
September 13, 2012, 01:18 PM
njsden
quote:
Originally posted by GamP:
This limit is not present anymore in 7.7.01, there these long lines are left intact.


Unfortunately, that seems not to be the case in 7.7.03M.

I am experiencing the same issue where creating an HTMTABLE HOLD file out of columns longer than 511 characters is breaking their content into chunks of 511 characters (squeezing a line break in between) which are finally rendered as a SPACE (char 32) in HTML (using Internet Explorer 8).

This would it be so bad if it wasn't for the fact that we use HTML as part of our actual data to provide "formatted comments" in our reports and that "magic" space may actually be happening in the middle of an HTML tag rendering useless.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
September 14, 2012, 11:19 AM
Mighty Max
I know this is dumb but try holding as EXL2K instead of HTMTABLE. It seems to have fixed the issue in our reports. You will have to use WebFocus styling. I could not get CSS Classes to work but you can still manipulate the body, table, td, using styles. Also you can define fields that have html tags in them to manipulat e the styling of the data.

  
DEFINE FILE CAR
TXT/A1700='123456789 123456789 123456789 123456789 123456789 123456789 ' |
          '123456789 123456789 123456789 123456789 123456789 123456789 ' |
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' |
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' |
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789 123456789 123456789 ' | 
		  '123456789 123456789 123456789 123456789';
END
TABLE FILE CAR
PRINT 
CAR
BY MODEL 
ON MODEL SUBFOOT
"<TXT"
ON TABLE SET STYLE *
TYPE=REPORT,SIZE=8, $
ENDSTYLE
ON TABLE HOLD AS RPT FORMAT EXL2K
END
-RUN

-HTMLFORM BEGIN
<html>
 <head>
  <style type="text/css">
  body { font-size: 10pt; font-family: "Times New Roman"; }
  table { border-collapse: collapse; width: 100%; }
  td { vertical-align: top !important; white-space:normal !important; }
  </style>
 </head>
<body>
 !IBI.FIL.RPT;
</body>
</html>
-HTMLFORM END



WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files