Focal Point
Display two fields in Subfoot

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

July 16, 2008, 11:25 AM
ColdWhiteMilk
Display two fields in Subfoot
I'm trying to include two fields in my subfoot section.

However, when I add the second field (FLD1) to the subfoot code, and run the report, the FLD0 and FLD1 values are merged into one field.

Does anyone know how to fix this?

  
DEFINE FILE BASELINE
COL0/A25= 'Clearance'; 
COL1/A25= 'Type';
RECCOUNTER/I8 = 1;
END

TABLE FILE BASELINE
HEADING
"<+0 <COL0<+0 <COL1"
PRINT

RECCOUNTER NOPRINT

BY BASELINE.CLEARANCE NOPRINT
BY BASELINE.TYPE NOPRINT

ON BASELINE.TYPE RECAP
FLD0/A250= BASELINE.CLEARANCE;
FLD1/A250= BASELINE.TYPE;

ON BASELINE.TYPE SUBFOOT
"<FLD0<FLD1"

ON TABLE SUBHEAD
"SUMMARY - BY CLEARANCE TYPE"

ON TABLE SET STYLE *
TYPE=TITLE, COLOR=NAVY, STYLE=BOLD+UNDERLINE, $
TYPE=REPORT, TITLETEXT= &FSTTITLE, $
TYPE=TABHEADING,STYLE=BOLD,$
TYPE=SUBHEAD,STYLE=BOLD,$
TYPE=HEADING, LINE=1, STYLE=BOLD+UNDERLINE, COLOR=NAVY,$
TYPE=HEADING,HEADALIGN=BODY,$                                   
TYPE=HEADING,OBJECT=TEXT,LINE=1,ITEM=1, STYLE=BOLD+UNDERLINE, COLOR=NAVY,$              
TYPE=HEADING,OBJECT=TEXT,LINE=1,ITEM=2, STYLE=BOLD+UNDERLINE, COLOR=NAVY,$
TYPE=HEADING,OBJECT=TEXT,LINE=1,ITEM=3, STYLE=BOLD+UNDERLINE, COLOR=NAVY,$
TYPE=TABFOOTING,STYLE=BOLD,$
ENDSTYLE

ON TABLE PCHOLD FORMAT EXL2K
END

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


Production - 7.6.4
Sandbox - 7.6.4
July 16, 2008, 11:41 AM
Danny-SRL
CWM,

Please repost your example putting it between CODE tags (click on the right-most icon).


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

July 16, 2008, 12:14 PM
ColdWhiteMilk
I've fixed the original post.


Production - 7.6.4
Sandbox - 7.6.4
July 16, 2008, 12:35 PM
Danny-SRL
You should write with an additional space between the fields"

ON BASELINE.TYPE SUBFOOT
"<FLD0 <FLD1"



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

July 16, 2008, 02:21 PM
Darin Lee
And/Or use the close carat to preserve trailing blanks in the fields
"<FLD0> <FLD1>"



Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
July 16, 2008, 03:55 PM
ColdWhiteMilk
Neither solution works.

Could it be the field lengths or data types in the fields (they are just text)?


Production - 7.6.4
Sandbox - 7.6.4
July 16, 2008, 04:08 PM
fthompson
Try putting this in you stylesheet:
TYPE=SUBFOOT, HEADALIGN=BODY, $

That will split any fields you include into separate columns.


Production/Test: WF 7.1.4, WIN2K3 Server
July 16, 2008, 04:38 PM
ColdWhiteMilk
Adding that line to the stylesheet fixed it!

Thank you.


Production - 7.6.4
Sandbox - 7.6.4
July 16, 2008, 06:01 PM
Leah
quote:
  ON BASELINE.TYPE SUBFOOT
"<FLD0<FLD1"


ColdWhiteMilk, interesting handle. Fthompson, I learned a new thing from a new poster. Of course, the whole issue is related to the lack of spacing and how the output of subfoots is handled in EXL2K as well.


Leah
July 17, 2008, 09:01 AM
ColdWhiteMilk
I'm learning more and more about the stylesheet as well from this.


Production - 7.6.4
Sandbox - 7.6.4
July 17, 2008, 10:14 AM
PBrightwell
Just a hint, OBJECT is not needed, it is a whole lot easier to count your ITEMS and not worry if they are TEXT or FIELD. Also if you want to position the ITEM in a particular location you can add a COLSPAN.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
July 17, 2008, 03:03 PM
ColdWhiteMilk
When I add a third field (FLD2) into the RECAP Section, it places the result in column "D" instead of column "C". Is this also part of the stylesheet that I can set?

DEFINE FILE BASELINE
COL0/A25= 'Clearance'; 
COL1/A25= 'Type';
RECCOUNTER/I8 = 1;
END

TABLE FILE BASELINE
HEADING
"<+0 <COL0<+0 <COL1"
PRINT

RECCOUNTER NOPRINT

BY BASELINE.CLEARANCE NOPRINT
BY BASELINE.TYPE NOPRINT

ON BASELINE.TYPE RECAP
FLD0/A250= BASELINE.CLEARANCE;
FLD1/A250= BASELINE.TYPE;
FLD2/A250='<td align=left x:num x:fmla=''=SUMPRODUCT((E10:E5000=T(INDIRECT( "A" ' | '&' | 'ROW())))*(F10:F5000=T(INDIRECT( "B" ' | '&' | 'ROW()))))''>0</td>';

ON BASELINE.TYPE SUBFOOT
"<FLD0<FLD1<FLD2"

ON TABLE SUBHEAD
"SUMMARY - BY CLEARANCE TYPE"

ON TABLE SET STYLE *
TYPE=TITLE, COLOR=NAVY, STYLE=BOLD+UNDERLINE, $
TYPE=REPORT, TITLETEXT= &FSTTITLE, $
TYPE=TABHEADING,STYLE=BOLD,$
TYPE=SUBHEAD,STYLE=BOLD,$
TYPE=SUBFOOT, HEADALIGN=BODY, $
TYPE=HEADING, LINE=1, STYLE=BOLD+UNDERLINE, COLOR=NAVY,$
TYPE=HEADING,HEADALIGN=BODY,$                                   
TYPE=HEADING,OBJECT=TEXT,LINE=1,ITEM=1, STYLE=BOLD+UNDERLINE, COLOR=NAVY,$              
TYPE=HEADING,OBJECT=TEXT,LINE=1,ITEM=2, STYLE=BOLD+UNDERLINE, COLOR=NAVY,$
TYPE=HEADING,OBJECT=TEXT,LINE=1,ITEM=3, STYLE=BOLD+UNDERLINE, COLOR=NAVY,$
TYPE=TABFOOTING,STYLE=BOLD,$
ENDSTYLE

ON TABLE PCHOLD FORMAT EXL2K
END



Production - 7.6.4
Sandbox - 7.6.4
July 17, 2008, 03:26 PM
Tom Flynn
CWM,

Why is your HEADING different than your SUBFOOT since you are using HEADALIGN?

  
HEADING
"<COL0<COL1<+0> <+0>"



Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 17, 2008, 04:12 PM
ColdWhiteMilk
My honest answer is that I don't understand what HEADALIGN does.


Production - 7.6.4
Sandbox - 7.6.4
July 17, 2008, 04:20 PM
Tom Flynn
CWM,

Aligning Headings and Footings

Choosing an Alignment Method for Heading and Footing Elements


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 17, 2008, 04:22 PM
fthompson
If you want an in depth explanation of HEADALIGN you can pull it up in the Dev Studio Help Index or in the manauls under Creating Reports With WebFOCUS Language > Using Headings, Footings, Titles, and Labels > Aligning a Heading or Footing Element in an HTML Report. Its designed for HTML but works in Excel 2000.


Production/Test: WF 7.1.4, WIN2K3 Server
July 18, 2008, 09:47 AM
ColdWhiteMilk
These are both very interesting, however my problem is not that the column headers are not lining up with the data. The column headers are showing up in the right places.

The problem is that the data is not lining up with the column headers.

My results look like this:

Column "A"        Column "B"        Column "C"                Column "D"  

ColumnHeader1     ColumnHeader2     ColumnHeader3  

DataField1        DataField2                                  DataField3  

DataField1        DataField2                                  DataField3  



Even if I just bake the HEADING as
 "<COL0<COL1<COL2" 
, and the subfoot fields as
 "<FLD0<FLD1<FLD2" 
, the data is not lining up with the column headers.


Production - 7.6.4
Sandbox - 7.6.4
July 18, 2008, 09:49 AM
Tom Flynn
CWM,

What data:

quote:

PRINT

RECCOUNTER NOPRINT

BY BASELINE.CLEARANCE NOPRINT
BY BASELINE.TYPE NOPRINT



Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 18, 2008, 10:23 AM
ColdWhiteMilk
The data fields for the SUBFOOT are coming from the RECAP

 ON BASELINE.TYPE RECAP
FLD0/A250= BASELINE.CLEARANCE;
FLD1/A250= BASELINE.TYPE;
FLD2/A250='<td align=left x:num x:fmla=''=SUMPRODUCT((E10:E5000=T(INDIRECT( "A" ' | '&' | 'ROW())))*(F10:F5000=T(INDIRECT( "B" ' | '&' | 'ROW()))))''>0</td>';

ON BASELINE.TYPE SUBFOOT
"<FLD0<FLD1<FLD2"



Production - 7.6.4
Sandbox - 7.6.4
July 18, 2008, 10:26 AM
Tom Flynn
CWM,

Try this:

 
TYPE=SUBFOOT, HEADALIGN=BODY, $ 
TYPE=SUBFOOT, ITEM=1, COLSPAN=1, POSITION=N1, $ 
TYPE=SUBFOOT, ITEM=2, COLSPAN=1, POSITION=N2, $ 
TYPE=SUBFOOT, ITEM=3, COLSPAN=1, POSITION=N3, $  


Tom

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 18, 2008, 11:03 AM
ColdWhiteMilk
My concern is that I think that I am forcing the FLD2 data field over 1 column to many with the
<td 
in the HTML, but I don't know how to get this formula to work correctly without the HTML tags.

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


Production - 7.6.4
Sandbox - 7.6.4
July 19, 2008, 12:04 PM
Tom Flynn
CWM,

Here is another idea:

Add these in you DEFINE FILE:

  
 TABLE1/A30 = '<TABLE WIDTH=100% border=0>';
 TR1/A5     = '<TR>';
 TR2/A5     = '</TR>';
 TD0/A5     = '<TD ';
 TD1/A20    = '<TD ALIGN=RIGHT>';
 TD2/A5     = '</TD>';
 TABLE2/A10 = '</TABLE>';


Comment out -* TYPE=SUBFOOT, HEADALIGN=BODY, $

Then, remove the TD tags in your RECAP for FLD2, just for consistency:

  
ON BASELINE.TYPE RECAP
FLD0/A250= BASELINE.CLEARANCE;
FLD1/A250= BASELINE.TYPE;
FLD2/A250='align=left x:num x:fmla=''=SUMPRODUCT((E10:E5000=T(INDIRECT( "A" ' | '&' | 'ROW())))*(F10:F5000=T(INDIRECT( "B" ' | '&' | 'ROW()))))''>0';

ON BASELINE.TYPE SUBFOOT
"<TABLE1<TR1<TD1<FLD0<TD2<TD1<+0><FLD1<TD2<TD0<+0><FLD2<TD2<TR2<TABLE2"


If you want to leave the TD tags in FLD2, just remove TD0 and the last TD2..

Also, you "may" not need the spot markers...

Hope this helps...

Tom

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 08, 2008, 01:40 PM
ColdWhiteMilk
I finally got this figured out.

I entered a case with IBI, and they were not able to fix the issue, but they were ably to duplicate it in the CAR datbase so I know it was not a data issue.

Instead of using two fields in the SUBFOOT, I concatenate the values in columns A & B into one field with a delimiter between the values. Then I've only got one field in the SUBFOOT again.

Then within the HTML formula, I compare against the first half of the new column A value or the second half of the new column A value.

It is kind of messy, but it is giving me the result I need.


Production - 7.6.4
Sandbox - 7.6.4