As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I found this code within the forum and modified to show the issue. I need to combine two reports together in Excel but loosing leading zeros in DEF_COL_A. Does anyone know how to fix this? Thank you!
Sorry, I forgot to attach the code
TABLE FILE CAR
PRINT
SEATS
-*BY CAR
-*BY COUNTRY
-*BY COUNTRY
BY CAR
ACROSS COUNTRY
ON TABLE HOLD AS HLD_1 FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA,COLUMN=N1,CLASS=NUMASTEXT,$
-*TYPE=DATA,COLUMN=N2,CLASS=NUMASNUM,$
ENDSTYLE
END
-RUN
DEFINE FILE CAR
DEF_COL_A/A20=IF COUNTRY EQ 'ENGLAND' THEN '001234' ELSE IF COUNTRY EQ 'ITALY' THEN '004231' ELSE '00056687';
END
TABLE FILE CAR
PRINT
DEF_COL_A
COMPUTE COM_COL_A/A20=IF COUNTRY EQ 'ENGLAND' THEN '001234 ' ELSE IF COUNTRY EQ 'ITALY' THEN '004231 ' ELSE '00056687 ';
BY CAR
BY COUNTRY
ON TABLE HOLD AS HLD_2 FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA,COLUMN=N1,CLASS=NUMASTEXT,$
-*TYPE=DATA,COLUMN=N2,CLASS=NUMASNUM,$
ENDSTYLE
END
SET HTMLFORMTYPE=XLS
-HTMLFORM BEGIN
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html;">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 10">
<style>
TD.NUMASTEXT
{mso-number-format:\@}
TD.NUMASNUM
{mso-number-format:\#\,\#\#0\.00}
</style>
</head>
<body>
<table>
<tr>
<td class="accountnum">
!IBI.FIL.HLD_1;
</td>
<td class="accountnum">
!IBI.FIL.HLD_2;
</td>
</tr></table>
</body>
-HTMLFORM END
This message has been edited. Last edited by: FP Mod Chuck,
I think that is the nature of Excel to suppress leading zero's. I am not sure if a Excel template would allow you to override that. I have never used a template..
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005
When you edit your post there is a link on the left that says Options. I think you click pure HTML if that doesn't work then try Disable HTML It has been a while so I can't remember which one will do it..
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005
To fix this all you need to to is assign the class NUMASTEXT to the DEF_COL_A column:
TYPE=DATA,COLUMN=DEF_COL_A,CLASS=NUMASTEXT,$
If you don't specifically format a cell as text in Excel, it will see a number and chage the format to a number and eliminate any leading zeros.
Try this code:
TABLE FILE CAR
PRINT
SEATS
-*BY CAR
-*BY COUNTRY
-*BY COUNTRY
BY CAR
ACROSS COUNTRY
ON TABLE HOLD AS HLD_1 FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA,COLUMN=N1,CLASS=NUMASTEXT,$
TYPE=DATA,COLUMN=DEF_COL_A,CLASS=NUMASTEXT,$
-*TYPE=DATA,COLUMN=N2,CLASS=NUMASNUM,$
ENDSTYLE
END
-RUN
DEFINE FILE CAR
DEF_COL_A/A20=IF COUNTRY EQ 'ENGLAND' THEN '001234' ELSE IF COUNTRY EQ 'ITALY' THEN '004231' ELSE '00056687';
END
TABLE FILE CAR
PRINT
DEF_COL_A
COMPUTE COM_COL_A/A20=IF COUNTRY EQ 'ENGLAND' THEN '001234 ' ELSE IF COUNTRY EQ 'ITALY' THEN '004231 ' ELSE '00056687 ';
BY CAR
BY COUNTRY
ON TABLE HOLD AS HLD_2 FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA,COLUMN=N1,CLASS=NUMASTEXT,$
TYPE=DATA,COLUMN=DEF_COL_A,CLASS=NUMASTEXT,$
-*TYPE=DATA,COLUMN=N2,CLASS=NUMASNUM,$
ENDSTYLE
END
SET HTMLFORMTYPE=XLS
-HTMLFORM BEGIN
!IBI.FIL.HLD_1;
!IBI.FIL.HLD_2;
-HTMLFORM END
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015
TABLE FILE CAR
PRINT
SEATS
-*BY CAR
-*BY COUNTRY
-*BY COUNTRY
BY CAR
ACROSS COUNTRY
ON TABLE HOLD AS HLD_1 FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA,COLUMN=N1,CLASS=NUMASTEXT,$
TYPE=DATA,COLUMN=DEF_COL_A,CLASS=NUMASTEXT,$
-*TYPE=DATA,COLUMN=N2,CLASS=NUMASNUM,$
ENDSTYLE
END
-RUN
DEFINE FILE CAR
DEF_COL_A/A20=IF COUNTRY EQ 'ENGLAND' THEN '001234' ELSE IF COUNTRY EQ 'ITALY' THEN '004231' ELSE '00056687';
END
TABLE FILE CAR
PRINT
DEF_COL_A
COMPUTE COM_COL_A/A20=IF COUNTRY EQ 'ENGLAND' THEN '001234 ' ELSE IF COUNTRY EQ 'ITALY' THEN '004231 ' ELSE '00056687 ';
BY CAR
BY COUNTRY
ON TABLE HOLD AS HLD_2 FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA,COLUMN=N1,CLASS=NUMASTEXT,$
TYPE=DATA,COLUMN=DEF_COL_A,CLASS=NUMASTEXT,$
TYPE=DATA,COLUMN=COM_COL_A,CLASS=NUMASTEXT,$
-*TYPE=DATA,COLUMN=N2,CLASS=NUMASNUM,$
ENDSTYLE
END
SET HTMLFORMTYPE=XLS
-HTMLFORM BEGIN
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html;">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 10">
<style>
TD.NUMASTEXT
{mso-number-format:\@}
TD.NUMASNUM
{mso-number-format:\#\,\#\#0\.00}
</style>
</head>
<body>
<table>
<tr>
<td class="accountnum">
!IBI.FIL.HLD_1;
</td>
<td class="accountnum">
!IBI.FIL.HLD_2;
</td>
</tr></table>
</body>
-HTMLFORM END
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015
Hallway, Thank you for your suggestion, it works in this example but in actual code, I use CSS stylesheet "endeflt.sty" and it doesn't display leading zeros. When I take out the stylesheet, it works. If you have any suggestion, I would appreciate.
TABLE FILE CAR
PRINT
SEATS
-*BY CAR
-*BY COUNTRY
-*BY COUNTRY
BY CAR
ACROSS COUNTRY
ON TABLE HOLD AS HLD_1 FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA,COLUMN=N1,CLASS=NUMASTEXT,$
TYPE=DATA,COLUMN=DEF_COL_A,CLASS=NUMASTEXT,$
-*TYPE=DATA,COLUMN=N2,CLASS=NUMASNUM,$
ENDSTYLE
END
-RUN
DEFINE FILE CAR
DEF_COL_A/A20=IF COUNTRY EQ 'ENGLAND' THEN '001234' ELSE IF COUNTRY EQ 'ITALY' THEN '004231' ELSE '00056687';
END
TABLE FILE CAR
PRINT
DEF_COL_A
COMPUTE COM_COL_A/A20=IF COUNTRY EQ 'ENGLAND' THEN '001234 ' ELSE IF COUNTRY EQ 'ITALY' THEN '004231 ' ELSE '00056687 ';
BY CAR
BY COUNTRY
ON TABLE HOLD AS HLD_2 FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/UNICODE/_EDAHOME/ETC/endeflt.sty,
TYPE=DATA,COLUMN=N1,CLASS=NUMASTEXT,$
TYPE=DATA,COLUMN=DEF_COL_A,CLASS=NUMASTEXT,$
TYPE=DATA,COLUMN=COM_COL_A,CLASS=NUMASTEXT,$
-*TYPE=DATA,COLUMN=N2,CLASS=NUMASNUM,$
ENDSTYLE
END
SET HTMLFORMTYPE=XLS
-HTMLFORM BEGIN
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html;">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 10">
<style>
TD.NUMASTEXT
{mso-number-format:\@}
TD.NUMASNUM
{mso-number-format:\#\,\#\#0\.00}
</style>
</head>
<body>
<table>
<tr>
<td class="accountnum">
!IBI.FIL.HLD_1;
</td>
<td class="accountnum">
!IBI.FIL.HLD_2;
</td>
</tr></table>
</body>
-HTMLFORM END
That is actually a FOCUS style sheet. If a style sheet has the extension .sty then it is a FOCUS style sheet. A CSS stylesheet will have the extension .css. The two types of files are VERY different.
That being said... Our endeflt.sty must be different than yours, because it still works when run your code posted with that FOCUS stylesheet.
What browser are you using?
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015
I'm at a loss. I tried replacing the INCLUDE with the styling that you provided, and it still works for me. I've tried Edge(Version 78.0.276.20) and IE11, and they both work for me.
Are you using Compatibility View in your IE11? Also, what version of Excel are you using. I'm using Office 365 ProPlus and the Excel version is 1902.
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015
Hallway, I had Compatibility view on and I turned off and ran it, still the same. I am running on IE 11 and Excel 2016. The difference is our office versions or the WebFOCUS versions, I am on WF 8.2.05. Thank you much for trying.