Focal Point
[SOLVED] problem in displaying a text with % symbol in Excel

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

June 12, 2010, 01:22 AM
subbu
[SOLVED] problem in displaying a text with % symbol in Excel
Hi,

I had a problem while displaying the text in excel along with '%' symbol.

I want to display a text for a column as a title like 'PMU%' with out spaces between characters. Here, in the output I'm missng the '%' symbol. It is showing as 'PMU' instead of 'PMU%'

Here is the code for testing..
  
TABLE FILE CAR
PRINT CAR OVER
COMPUTE TEST/I4 = 10 * 10; AS 'PMU%'
ON TABLE PCHOLD FORMAT EXL2K
END
-EXIT


Scenario's I tested

'PMU%' --> 'PMU'
'P%' --> 'P%'
'PM%' --> 'PM'

My ultimate objective is not miss the percentage symobol

Thanks in Advance.

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


WebFOCUS 7.6.10
Windows
Output: Excel,PDF
June 12, 2010, 02:30 AM
Anmol
Subbu,
From the example it seems that OVER is causing this issue.
If you use this without OVER keyword, you will get the Percent Symbol....
Is it requirement to display the column OVER other?


WebFocus7.6.2, WebFocus 7.1.1,Windows
HTML, PDF and Excel
June 12, 2010, 04:43 AM
subbu
quote:
display the column OVER other

Yes Anmol, I'm converting some colums to rows so they are becoming row titles now I have to show "%"


WebFOCUS 7.6.10
Windows
Output: Excel,PDF
June 12, 2010, 10:31 AM
Ram Prasad E
Not sure why such behavior, this could be the reason. When you add percentage symbol to the end of the title, excel treats it as a calculation and omits the symbol. When you force it to consider as Alpha format, then it works fine.
Hope this will help.
TABLE FILE CAR
PRINT CAR AS 'CAR12345' OVER
COMPUTE TEST/I4 = 10 * 10; AS 'PMU%'
ON TABLE HOLD AS HLD_1 FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA,COLUMN=N1, CLASS=TEXTASTEXT,$
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.TEXTASTEXT
{mso-number-format:\@}
</style>
</head>
<body>
<table>
<tr>
<td class="accountnum">
!IBI.FIL.HLD_1;
</td>
</tr></table>
</body>
-HTMLFORM END



WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
June 14, 2010, 02:48 PM
Francis Mariani
Here's another method that works:

TABLE FILE CAR
PRINT 
COMPUTE TCAR/A10 = 'CAR'; AS ''
CAR AS '' OVER
COMPUTE TPMU/A10 = 'PMU%'; AS ''
COMPUTE PMU/I4 = 10 * 10; AS ''
ON TABLE PCHOLD FORMAT EXL2K
END
Instead of relying on the AS column titles, create them with COMPUTEs.


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
June 15, 2010, 02:17 PM
subbu
Thanks for the above solution Francis. It is working fine. I have one more issue which it is not working if i am using ACROSS along with OVER.

Please find the below code:

TABLE FILE CAR
SUM CAR OVER
COMPUTE VOLT/A10 = 'PMU%'; AS ''
DEALER_COST AS ''
ACROSS COUNTRY
ON TABLE PCHOLD FORMAT EXL2K
END
 



WebFOCUS 7.6.10
Windows
Output: Excel,PDF
June 16, 2010, 12:03 PM
Dan Satchell
Try this:

TABLE FILE CAR
 SUM COMPUTE XCAR/A3 = 'Car'; AS ''
     CAR AS ''
  OVER
     COMPUTE VOLT/A4 = 'PMU%'; AS ''
     DEALER_COST AS ''
 ACROSS COUNTRY AS ''
 ON TABLE PCHOLD FORMAT EXL2K
END

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
June 27, 2010, 06:25 AM
subbu
Thanks for the above solution.

I want the row titles 'CAR' and 'PMU %' to be displayed only once first time then for each country columns coressponding row aggregated values under each county should displayed something like below

ENGLAND INDIA
CAR BMW TYOTOA
PMU% 1000 200000

for england and india the car and PMU% is coming only one time. I want in this way. The row titles should not repeat for each country


WebFOCUS 7.6.10
Windows
Output: Excel,PDF
June 27, 2010, 07:38 PM
Dan Satchell
This seems to work. But I think it might be worthwhile to open a case with IBI to determine why the % sign fails to appear with format EXL2K.

TABLE FILE CAR
 SUM CAR AS 'Car'
     OVER
     DEALER_COST AS 'PMU%'
 ACROSS COUNTRY AS ''
 ON TABLE SET ASNAMES ON
 ON TABLE HOLD FORMAT HTMTABLE
END
-*
SET HTMLFORMTYPE=XLS
-RUN
-*
-HTMLFORM BEGIN
!IBI.FIL.HOLD ;
-HTMLFORM END



WebFOCUS 7.7.05
October 17, 2013, 05:41 AM
Prabhakar
Thought of posting as this is a relevant thread.
In spite of trying with the .mht (Excel) format option, I am still not able to get the % symbol in the Excel output.
To isolate the issue. Please check the below example
TABLE FILE CAR
PRINT
COMPUTE TEST/A600V = 'SAMP%LE%';
CAR
ON TABLE PCHOLD FORMAT EXL2K
END
For PDF, % is being displayed on the O/P for col TEST.
For excel its simply showing as SAMPLE. However if i change the data type from A600V to A575V it is working fine. Not sure why it is getting broken after A575V. Please assist. Thanks.


WebFOCUS 7.7.05 and 8.x
Windows, All Outputs
October 17, 2013, 10:21 AM
Francis Mariani
Works for me. WF 7.7.05 and Excel 2007:




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 17, 2013, 11:47 PM
Prabhakar
Thanks for your prompt response. I am able to get the expected output as 'SAMP%LE%' in the Command console. However when the same is getting executed in any of the Dev or Stage environemnts (FEX file) it is coming as 'SAMPLE' for the same A600V. Not sure if I need to keep some SET commands.


WebFOCUS 7.7.05 and 8.x
Windows, All Outputs