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.
August 03, 2005, 06:35 PM
Francis Mariani
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
August 03, 2005, 06:45 PM
Leah
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.
August 04, 2005, 02:23 PM
<Mairead Lawlor>
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';
August 04, 2005, 02:40 PM
Leah
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.
August 04, 2005, 02:58 PM
<Mairead Lawlor>
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.
August 04, 2005, 03:25 PM
Leah
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?
August 04, 2005, 03:42 PM
Tony A
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
August 04, 2005, 08:10 PM
Tony A
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 .
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
August 08, 2005, 01:17 PM
<Mairead Lawlor>
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!
August 08, 2005, 01:27 PM
Leah
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.
August 08, 2005, 02:30 PM
Tony A
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
April 13, 2007, 03:11 AM
<Antony Gubert>
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
April 13, 2007, 04:58 AM
Tony A
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
April 13, 2007, 07:33 AM
<Antony Gubert>
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.
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
April 16, 2007, 03:01 AM
<Antony Gubert>
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
April 16, 2007, 03:52 AM
Alan B
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
April 16, 2007, 04:31 AM
Alan B
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
April 16, 2007, 10:25 AM
gregv
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
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
April 16, 2007, 01:42 PM
jgelona
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.