Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Plain Text output with some modifications
Go
New
Search
Notify
Tools
Reply
  
[CLOSED]Plain Text output with some modifications
 Login/Join
 
Gold member
posted
I need to create a file in plain text and when i browsed focal point i found out you can use
ON TABLE PCHOLD FORMAT DOC as output which is partially there. I need some assistance figuring out the last bit.

Below is the expected output and i have some questions:

A) How i can remove leading zeros? Based off another thread i see i can place <0> before headings but there is still one space.

B) How i can remove leading zeros from fields on the report?

C) How can i add 14 spaces between two columns?

-* the first string 1234567...25 based on a field
-* there are 14 spaces shown as _
-* 1234 is right aligned based off another field
1234567...25______________1234


Thank you!

This message has been edited. Last edited by: <Emily McAllister>,


WebFocus 8.02, SQL Server 2008r2
 
Posts: 51 | Registered: November 30, 2012Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Hi cs,

You do not say what you want to do with your plain text file:
1. Use it as input to something?
2. Create a WORD document?
3. Simply print it?
4. Anything else?
If you do use FORMAT DOC, you should not see any leading zeros, unless you have an L option on a numeric field; and a field containing 14 spaces should display as 14 spaces.

Could you post your code, preferably a repro using the CAR file?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1932 | Location: Tel Aviv, Israel | Registered: March 23, 2006Reply With QuoteReport This Post
Expert
posted Hide Post
From what you have said, I think HOLD FORMAT ALPHA may be a better way.

You can use FPRINT to format the fields.

But as Danny says, what do you want to use it for, it has a large bearing on the method to be used.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.05OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6053 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport This Post
Master
posted Hide Post
I'm in total agreement with Danny and Waz - not just concerning this post but posts in general. It helps an awful lot if the general objective is spelled out at the beginning before getting to the code. Often enough there is a completely different and better way to accomplish something rather than tinkering with code that is already lame to start with.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
I'm in total agreement with Danny, Waz, And George. There are many ways to Skin-A-Cat. But, it's always nice to know what kind of cat it is, Kitty Cat, Bengal or Sabre Tooth Tiger... Confused
 
Posts: 2967 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005Reply With QuoteReport This Post
Gold member
posted Hide Post
Thank you Danny and Waz;

The purpose of the file is to upload to an internal application. The file type must be .txt and the type of files needs to follow a standard which is what i'm attempting to configure. My goal for the file is to use Report Caster to place the file on a network share so a co-worker can access the file make any last minute adjustments and then upload to our application.

Waz, when the output is set as ALPHA i notice the header is removed but the leading spaces concern is resolved.

####################################
Below is my code and some notes i have:

DEFINE FILE [SYNONYM]
-*I thought to create this so one of our co-workers knows where to right align the number (14 spaces after Field1). I wasn't sure how to complete this in webfocus?
SPACE/A50=[SYNONYM].[SYNONYM].[FIELD1][||' |';
END

TABLE FILE [SYNONYM]
SUM
COMPUTE [NEW_FIELD1]/I8 = [SYNONYM].[SYNONYM].[FIELD2] * 100; AS 'ALIGN LAST DIGIT WITH |.'
BY LOWEST [SYNONYM].[SYNONYM].SPACE AS 'REMOVE THIS LINE. LEADING SPACES. LINE BELOW'
HEADING
-*I need two headers in the file
"HEADER1"
"HEADER2"
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT ALPHA
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
TYPE=DATA,
COLUMN=N2,
JUSTIFY=LEFT,
$
TYPE=DATA,
COLUMN=N3,
JUSTIFY=LEFT,
$
TYPE=TITLE,
COLUMN=N2,
JUSTIFY=LEFT,
$
TYPE=TITLE,
COLUMN=N3,
JUSTIFY=LEFT,
$
TYPE=HEADING,
LINE=1,
JUSTIFY=LEFT,
$
TYPE=HEADING,
LINE=2,
JUSTIFY=LEFT,
$
TYPE=REPORT,
COLUMN=N2,
SQUEEZE=ON,
$
TYPE=REPORT,
COLUMN=N1,
SQUEEZE=ON,
$
ENDSTYLE
END

################################################
The output file will look like this:

HEADER1
HEADER2
REMOVE THIS LINE. LEADING SPACES. LINE BELOW ALIGN LAST DIGIT WITH |.
-------------------------------------------- ------------------------
XXXXXXXXXXXXXXXXXXXXXXXXX | 999

################################################
The final state of the file should look like this:

HEADER1
HEADER2
XXXXXXXXXXXXXXXXXXXXXXXXX 999


WebFocus 8.02, SQL Server 2008r2
 
Posts: 51 | Registered: November 30, 2012Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Plain Text output with some modifications

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.