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 am having serious problems trying to create a delimited file from WebFocus. The requirement is to define each column at a certain width and pad that column with spaces if the column is shorter than that length.
I tried Excel, HTML and PDF versions and it looks like the spaces are getting lost.
I even went to the extent of padding each of the columns using rpad function of Oracle sql, but the spaces disappear when run in HTML.
I can replace the padding character from space to any other character and I can see that character being retained when converted to HTML, but not the space. Is it because the inconsistency between the db os and the windows client?
HTLM will not show your spaces due to the browser more than anything, have you tried one of the comma formats. What is the purpose of the 'fixed lengths' if I may ask?
Leah
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004
Your signature says Output: Excel, so I'm assuming you want to create an Excel 2000 spreadsheet (WebFOCUS format EXL2K). You can control the width of an Excel 2000 column by using WebFOCUS Style Sheet commands like WRAP.
Here's an example:
TABLE FILE CAR
SUM
SALES
BY COUNTRY
HEADING
"WEBFOCUS REPORT"
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLESHEET *
TYPE=REPORT, FONT='ARIAL', SIZE=8, $
TYPE=HEADING, SIZE=10, $
TYPE=TITLE, STYLE=BOLD, $
TYPE=REPORT, COLUMN=SALES, WRAP=2, COLOR=BLUE, $
TYPE=REPORT, COLUMN=COUNTRY, WRAP=5, COLOR=GREEN, $
END
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
The output format you want is ALPHA ON TABLE HOLD FORMAT ALPHA will make a fixed format file each field will be as wide as you have specified it. You filedef the output file and park it somewhere. *Any* app you open it with other than Notepad and the like, will squoosh spaces. Spaces *will* disappear when you display in html... by definition. but you say you are trying to make a 'delimited' file, which suggests text. If you want BOTH, say a fixed format with a specified delimiter, say a pipe, then DEFINE FILE CAR PIPE/A1 WITH CAR = '|'; END TABLE FILE CAR PRINT COUNTRY PIPE MODEL PIPE CAR PIPE ...etc Any help?
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Don't forget that wonderful APP HOLD dirname command which will hold it in a directory without having to do a filedef and makes your program platform independent.
Alternates to this are
APP HOLDMETA dirname which only saves the master. APP HOLDDATA dirname which only saves the data file.
There is also an APP FI ddname DISK dirname/filename as an alternate to the original FILEDEF where you had to put the full disk path of the file.
Try adding an lrecl specification to your filedef. I had a similar task as yours and this is how I resolved the issue: APP HOLD car_dept FILEDEF TIAASAV DISK /comm/ibi/webfocus/apps/car_dept/carinfo.FTM (LRECL 68 RECFM V
Then I defined fields equal to the length of the blank spaces needed and concatenated these to my record instead of concatenating ' '
Anish, while you're trying out the ideas presented here, could you please describe in more detail what you're trying to achieve. Is it a comma delimited file, an alpha file with columns padded by spaces, an Excel file or an Excel 2000 file?
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
It has nothing to do with the number of characters. - it can't, because the size of the characters would would depend on the font and the font size.
The resulting Excel 2000 spreadsheet column does not contain trailing blanks to make the width, the width of the column is adjustable by the WebFOCUS style sheet WRAP attribute. You have to decide how wide you want the column to be.
The user can adjust the width of the column when the file is opened in Excel. I don't understand your concern about the width of a column.
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
thanqs The report consists of 18 columns, in that first column should start at 1 and end at 18 and second column should start at 19 and end at 30......etc. because output is sent as source further
The width (and wrap) values in the style sheet relates to the UNITS attribute.
In the help file(s) this information is given -
quote:
Procedure: How to Measure for Column Width and Decimal Alignment Measuring Width. Determining the width of a heading or footing item is a three-step process:
Identify the maximum number of characters in a text string or field.
For a text string, simply count the characters. For a field, refer to the format specification in the Master File or in a command such as a DEFINE.
Measure the physical space in units (for example, in inches) that is required to display the number of characters identified in step 1, based on the size of the font you are using. For example, the following value of the COUNTRY field would measure as follows:
Font Font size Comparison Inches
Helvetica 10 England .5
Times New Roman 10 England .44
Courier 10 England .56
Tip: Consider using a consistent set of fonts in your reports to make your measurements reusable.
Measuring for Decimal Alignment. After you have determined the width of an item, you can do a related measurement to determine the physical space required to display decimal data with a varying number of digits to the right of the decimal point.
Determine the maximum number of decimal places you need to accommodate to the right of the decimal place, plus the decimal point itself.
Measure the physical space in units (for example, in inches) that is required to display the number of characters identified in step 1, based on the size of the font you are using.
You can also find this info using the search facility (top right). Use the left hand search option on the resulting screen (Search Technical Documentation), select your release and then search on the text "width attribute". Look at the first item returned and you should have loads of info. to help you.
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
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
The report consists of 18 columns, in that first column should start at 1 and end at 18 and second column should start at 19 and end at 30......etc. because output is sent as source further
Then you don't want an Excel 2000 spreadsheet, you want an ALPHA HOLD or SAVE file.
SET HOLDLIST=PRINTONLY
-RUN
TABLE FILE CAR
PRINT
CAR/A18
COUNTRY/A20
MODEL/A25
ON TABLE HOLD AS H001 FORMAT ALPHA
END
-RUN
?FF H001
-RUN
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