Focal Point Banner


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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
indentation
 Login/Join
 
<Mairead Lawlor>
posted
I have been searching the docs and formums for information on how to indent a line on my report.
I want to indent the store code and the rest of the line items.
All I find relates either to hierarchy relationships and FML. Is there not a simple way to do this.

Here is the code:

TABLE FILE CENTORD
PRINT
STORE_CODE
PLANT
MONTH
BY
REGION NOPRINT
BY
STATE
BY
STORENAME

ON REGION SUBHEAD
"<REGION "
HEADING
"Sales By Plant"
WHERE PLANT EQ 'BOS' OR 'DAL' OR 'LA';
ON TABLE NOTOTAL

How can I specify the indentation? Thanks in advance.
 
Report This Post
Expert
posted Hide Post
In my example, ndentation in PDF uses LEFTGAP, indentation in HTML uses the CSS styling class "padding2":
-SET &ECHO=ALL;<br />-*SET &OUTPUT = 'HTMTABLE';<br />-SET &OUTPUT = 'PDF';<br /><br />-SET &HOLDTYPE   = IF &OUTPUT EQ 'HTMTABLE' THEN 'HOLD' ELSE 'PCHOLD';<br /><br />TABLE FILE CAR<br />  PRINT MODEL<br />    BY  COUNTRY<br />  ON TABLE &HOLDTYPE AS 'CAROUT' FORMAT &OUTPUT<br />  ON TABLE SET STYLE *<br />  TYPE=REPORT, GRID=OFF, SIZE=9, $<br />  TYPE=REPORT, COLUMN=COUNTRY, $<br />  TYPE=REPORT, COLUMN=MODEL, CLASS=padding2, LEFTGAP=.5, $<br />END<br />-RUN<br /><br />-HTMLFORM BEGIN<br /><style type="text/css"><br />.padding2<br />  {<br />  padding: 0px 0px 0px 25px; /* padding in each cell - Top Right Bottom Left */<br />  }<br /></style><br />!IBI.FIL.CAROUT;<br />-HTMLFORM END
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
M,

When you say indent do you want the fields to be

Region data data data

or
Region
data
data
data

The 'IN' option can let you specify a start column

Print data IN 20

Or if you want it 20 from the last position
then

Print data IN +20

If you want the second way, you have to use OVER combined with IN.
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
<Mairead Lawlor>
posted
Thanks for your reply.
I want my output to be:
Region
<indent of 5 spaces> State StoreCode Plant

I added the "IN 20" as follows but it did not work. In fact it would not even save the text I added. I don't get an error message it just that the text is gone after I press save. Would you know why it won't let me do that?


TABLE FILE CENTORD
PRINT
STORE_CODE IN 20
PLANT
MONTH
BY
REGION NOPRINT
BY
STATE
BY
STORENAME

ON REGION SUBHEAD
"<REGION "
HEADING
"Sales By Plant"
WHERE PLANT EQ 'BOS' OR 'DAL' OR 'LA';
 
Report This Post
Virtuoso
posted Hide Post
What is your version number of WebFOCUS I'm assuming here. In 4.3.6 I know if you did some thing like a copy/ paste and the line went past the 80 mark it disappeared. However, in your case, I'm not sure.

We are at 5.3.4 on Win2k or 7.1 on LINUX, so could check. I also still have some access to our old 4.3.6.
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
<Mairead Lawlor>
posted
It's version 526. I'm very new to wefocus but I don't think it's the length of the line. But I am stumped as to what it could be.
 
Report This Post
Virtuoso
posted Hide Post
Well let's look for the not so obvious, did you perhaps use the tab key. We've had some very strange things happen when a tab was in the code rather than spaces.

Sometimes it is the JAVA version. I had this nice chat with an Information Builders person on the JAVA issues and versions of desktop versus application server.

At the moment I'm doing it all in MRE haven't used the new Developer Studio. Are you using the MRE interface?
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Expert
posted Hide Post
Mairead,

Try this (it will work only in HTML format)-

DEFINE FILE CENTORD
INDENT/A60 = '&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;';
END
TABLE FILE CENTORD
PRINT STORE_CODE IN 20
PLANT
MONTH
BY INDENT AS ''
BY REGION NOPRINT
BY STATE
BY STORENAME
ON REGION SUBHEAD
"<REGION "
HEADING
"Sales By Plant"
WHERE PLANT EQ 'BOS' OR 'DAL' OR 'LA';
END

It basically defines a new field and fills it with ten "non blank spaces" which effectively indents your row by that amount.

Good luck
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Hi Mairead,

Hopefully you have received my reply and as promised I have a version that will function with PDF format output.

-DEFAULT &Format='PDF';
-* Set a variable to a HTML or normal space
-SET &Spc = IF &Format EQ 'HTML' THEN '&|nbsp;' ELSE ' ';
DEFINE FILE CENTORD
INDENT/A60 = '&Spc&Spc&Spc&Spc&Spc&Spc&Spc&Spc&Spc&Spc';
END
TABLE FILE CENTORD
PRINT STORE_CODE IN 20
PLANT
MONTH
BY INDENT AS ''
BY REGION NOPRINT
BY STATE
BY STORENAME
ON REGION SUBHEAD
"<REGION "
HEADING
"Sales By Plant"
WHERE PLANT EQ 'BOS' OR 'DAL' OR 'LA';
ON TABLE SET ONLINE-FMT &Format
END

From memory I'm afraid as I am now at home, so you will have to double check that it works!

Regards

Tony

Apologies, only just now had a little time to double check what I put above Red Face .

So scratch that, it works much better with positioning as Leah suggested, but you need to add it to all the columns as follows -

-DEFAULT &Format='PDF';
TABLE FILE CENTORD
PRINT STORE_CODE IN +2
PLANT IN +2
MONTH IN +2
BY REGION NOPRINT
BY STATE IN 10
BY STORENAME IN +2
ON REGION SUBHEAD
"<REGION "
HEADING
"Sales By Plant"
WHERE PLANT EQ 'BOS' OR 'DAL' OR 'LA';
ON TABLE SET ONLINE-FMT &Format
END

Hope this helps

Tony
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
<Mairead Lawlor>
posted
Thanks for your help and your mail Tony, will keep it in mind. The indentation does not seem to work with subtotal rows. Does anyone know of a way that I can indent the text of a subtotal, have about 10 spaces before it:
' subtotal'

Thanks!
 
Report This Post
Virtuoso
posted Hide Post
First time I tried to post I got an error so will try again:

TABLE FILE CAR
COUNT MODEL
BY COUNTRY
BY SEATS
ON SEATS SUBTOTAL AS ' SUBTOTAL'
END

Unfortuneately it doesn't work for html with my limited html knowledge.
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Expert
posted Hide Post
The trouble(?) with HTML is that white space is squeezed into minimal space and that is where the &|nbsp; comes into play. The &|nbsp; forces a space to be respected in HTML and therefore a string of them will 'force' a leading area prior to your text etc.

In PDF the spaces are preserved and therefore should always be present.

Use a combination of the variable &spc above being set to '&|nbsb;' or ' ' depending upon the output format being used.

Edited to 'escape' the ampersands
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
<Antony Gubert>
posted
Hi Tony,

The following code given by you does not work with Excel format. Any idea why?

-* Set a variable to a HTML or normal space
-SET &Spc = IF &Format EQ 'HTML' THEN '&|nbsp;' ELSE ' ';
DEFINE FILE TEST
INDENT/A60 = '&Spc&Spc&Spc&Spc&Spc&Spc&Spc&Spc&Spc&Spc';
END;


Thanks

Antony
 
Report This Post
Expert
posted Hide Post
Antony,

What are you trying to do? Give an example with the CAR file

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, 2004Report This Post
<Antony Gubert>
posted
Hi Tony,

please execute the following code. You won't find the space in the heading. But the same code work fine for HTML.


-SET &HEADING_WITH_SPACE = 'Car Report' | ' ' | 'Tony' ;
-*
TABLE FILE CAR
PRINT
*
HEADING
"&HEADING_WITH_SPACE"
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN



Tony, I have tried with the following code as well. But it does not work with excel format.

-SET &HEADING_WITH_SPACE = 'Car Report' | '&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;' | 'Tony' ;

Pls let me know why it doesn't....

Thanks

Antony
 
Report This Post
Virtuoso
posted Hide Post
Mairead,
I don't know if your indentation problem has been solved, but here is a solution that works both in HTML and in PDF:
-SET &ECHO=ALL;
-DEFAULT &OUTPUT=HTML;
-SET &HTMLSP='&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;';
-SET &PDFSP='.     ';
-SET &SP=IF &OUTPUT EQ HTML THEN &HTMLSP ELSE &PDFSP;
-SET &P=IF &OUTPUT EQ HTML THEN '' ELSE '.';
-SET &INDENT=IF &OUTPUT EQ HTML THEN 'INDENT/A35 = ''&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;'';' ELSE
-                                    'INDENT/A5 = ''     '''; 
DEFINE FILE CAR
&INDENT
END
TABLE FILE CAR
SUM SALES RCOST DCOST
BY COUNTRY NOPRINT SUBTOTAL AS '&P|Total Country'
BY INDENT AS '' 
BY CAR SUBTOTAL AS '&SP Total Car'
BY BODYTYPE
ON COUNTRY SUBHEAD
"<COUNTRY "
ON TABLE COLUMN-TOTAL AS '&P|Grand Total'
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT &OUTPUT
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, FONT=COURIER NEW, SIZE=10, $
ENDSTYLE
END

You will see that the report is indented and the subtotals also. For PDF, in WF7.1.3, it is necessary to have a period (or any other character) as first character otherwise WF will squeeze out the beginning spaces!


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

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
<Antony Gubert>
posted
Hi Danny,

Your example works well with PDF but not with "Excel".

My requirement is, I wants leave space between 2 columns/strings. Look at the following example.

DEFINE FILE CAR
COUNTRY_CAR/A100 = COUNTRY | < Leave 10 spaces > | CAR;
END

TABLE FILE CAR
PRINT
COUNTRY
CAR
COUNTRY_CAR
ON TABLE PCHOLD FORMAT EXL2K
END

Hope, you understand the requirement.

Thanks

Antony
 
Report This Post
Virtuoso
posted Hide Post
The issue here is that Excel is reducing the spacing, not WF. If you HOLD the EXL2K file and then look at it, you will see that the spacing is there in the XML. The question becomes how do you force Excel to preserve the whitespace given to it, and that is a whole new ball game.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
Ah gotcha,

DEFINE FILE CAR
COUNTRY_CAR/A100 = COUNTRY | '..........' | CAR;
new_COUNTRY_CAR/A100 = CTRAN(100,COUNTRY_CAR,46,13,'A100'); 
END

TABLE FILE CAR
PRINT
COUNTRY
CAR
new_COUNTRY_CAR
ON TABLE PCHOLD FORMAT EXL2K
END

Late explanation: WF treats the ascii 10 as a nbsp now, rather than passing just a space across to the XML.

This message has been edited. Last edited by: Alan B,


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Guru
posted Hide Post
To indent all output formats to look the same and eliminate the '.' in PDF as well as add a 'Country' heading:

Change the initial set up.

-SET &CHAR=CTRAN(1, ' ', 32, 13, 'A1');
-SET &HTMLSP='&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;';
-SET &PDFSP='&CHAR.EVAL'|' ';
-SET &XLDOTS='...............................';
-SET &XLSP=CTRAN(31,&XLDOTS,46,13,'A31');
-SET &SP=IF &OUTPUT EQ HTML THEN &HTMLSP ELSE IF &OUTPUT EQ PDF THEN &PDFSP ELSE &XLSP;



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
 
Posts: 274 | Location: Boston/New England | Registered: February 12, 2006Report This Post
Virtuoso
posted Hide Post
Slight warning: there is an issue with the spacing in EXL2K format using the method I gave, and Gregv uses, to convert the required spaces to an ascii 10, which WF converts to a nbsp;

WF breaks the PCHOLD FORMAT EXL2K into an LRECL of 512. Any nbsp; that span the line break at 512 will not be read correctly and will show up in the Excel text.

Anyone know how to increase the LRECL that WF puts into the PCHOLD FORMAT EXL2K?

This message has been edited. Last edited by: Alan B,


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
Thanks very much gregv. Your &XLSP solution work most excellently, even with tag labels in FML or FRL or whatever it is called today.

IMO, you should submit this for a Tips contest if you're going to Summit.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders