Focal Point
[SOLVED] Indentation of a Field in a cell - for Excel output

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

January 26, 2011, 10:27 AM
tlbrydie2
[SOLVED] Indentation of a Field in a cell - for Excel output
Good Morning,

I have a field that is to be displayed indented from the left. I modify that field for three different versions of output. (HTML,Excel & PDF).
I do this by the following code:

DESC_NEW_H/A100 = IF SGN EQ 1 AND SNO IN( 8,9,10,11) THEN '&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;' | DESC ELSE DESC;
DESC_NEW_P/A100 = IF SGN EQ 1 AND SNO IN( 8,9,10,11) THEN ' ' | DESC ELSE DESC;
DESC_NEW_Q/A100 = IF SGN EQ 1 AND SNO IN( 8,9,10,11) THEN ' ' | DESC ELSE DESC;
DESC_DISP_FIELD/A100 = IF '&FORMAT.EVAL' EQ 'HTML' THEN DESC_NEW_H ELSE
IF '&FORMAT.EVAL' EQ 'PDF' THEN DESC_NEW_P ELSE
IF '&FORMAT.EVAL' EQ 'EXL2K' THEN DESC_NEW_Q;


The spaces for the HTML and PDF versioned field is respected.
The problem is that the spaces for the Excel field are not respected and the field comes out left justified.

How do I accomplish padding spaces in front of my field for Excel output.

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




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

January 27, 2011, 03:35 AM
Wep5622
You could try creating the value using HEXBYT(). For the EURO sign I use this:
-SET &LABEL = 'Price (' | HEXBYT(128, 'A1') | ')';


I don't know what encoding Excel uses by default, it appears to be something unusual, but you could try code 160 ('nbsp' and '#160' are the same entity in HTML).

Also keep in mind that, although the name of the HEXBYT function suggests that it expects hexa-decimal input, it actually expects decimal input.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
January 27, 2011, 04:22 AM
Alan B
Try using HEXBYT(13,'A1') for indentation in EXL2K output. Plain EXCEL output respects spaces.


Alan.
WF 7.705/8.007
January 27, 2011, 07:54 AM
GinnyJakes
quote:
You can use the SET SHOWBLANKS command in the SET tooI if you want to preserve leading and internal blanks in HTML and EXL2K report output. By default, HTML browsers and Excel remove leading and trailing blanks from text and compress multiple internal blanks to a single blank.


How about leaving the spaces and using the SHOWBLANKS setting? Try that and see if it works for you.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
January 28, 2011, 09:46 AM
tlbrydie2
Thanks everyone for your responses to this issue. This problem was soulved by implementing the command below. Which allows youe code to respect/display spaces...
Thanks Again


SET SHOWBLANKS = ON  

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




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC