IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    column headings
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Platinum Member
Posted
I want my column heading to change depending on the data. Is there a way to do this without doing a compound report?

I currently have it working by using a subhead but if my report goes to a 2nd page, the original column headings appear and I want the subheading to appear instead of the column headings since the data at the point is my indices information.

My data_type is either category information (A) or indices information (I). My description field should be called category if my data_type eq 'A' or it should be called indices if my data_type eq 'I'.

My category information appears first so I have

table file car
print description as 'category'
marketvalue as 'market value'
pct.marketvalue as '% of total'
end

My columns for category information are:

category market value % of total

and for indices information:

indices market value % of total

I tried putting an if statement in my print and changing the column heading depending on data_type but that didn't work.

Any suggestions?
 
Posts: 156 | Registered: November 10, 2004Reply With QuoteEdit or Delete MessageReport This Post
RB
Gold member
Posted Hide Post
try this

-set &heading/a8= if description eq 'a' then 'category' else if description eq 'i' then 'indices';

table file car
print description as '&heading'
marketvalue as 'market value'
pct.marketvalue as '% of total'
end
 
Posts: 76 | Registered: October 28, 2003Reply With QuoteEdit or Delete MessageReport This Post
<Pietro De Santis>
Posted
Unfotunately, that's not going to work.

1) You cannot have a field format in a -SET command.

2) I don't think this can be done, you cannot base the AS statement on the data being printed on the report.
 
Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
Wanting to try something of course the CAR file doesn't have the fields, but I did some playing, of course this doesn't line up well in HTML nor excel, but:

-*just so I could force a page - break
SET LINES = 14
SET STYLEMODE = FIXED
DEFINE FILE CAR
COUNTEX/I2 WITH MODEL = (COUNTEX + 1);
REM/I1 WITH MODEL = IMOD ( COUNTEX, 2, REM );
DESCRIPTION/A1 WITH MODEL = IF REM EQ 0 THEN 'A' ELSE 'I';
MARKETVALUE/D12.2 = RETAIL_COST;
HEADMARK/A10 WITH MODEL = IF DESCRIPTION EQ 'A' THEN 'CATEGORY' ELSE 'INDICES';
END
TABLE FILE CAR
HEADING
"<HEADMARK MARKET VALUE % OF TOTAL PAGE: <TABPAGENO"
" "
PRINT DESCRIPTION AS ''
MARKETVALUE AS ''
PCT.MARKETVALUE AS ''
BY DESCRIPTION NOPRINT
ON DESCRIPTION
*-put in so if you don't page-break on the indices you will get the title change
SUBHEAD
" "
"INDICES MARKET VALUE % OF TOTAL"
" "
WHEN DESCRIPTION EQ 'I' AND TABPAGENO GT 1
END
 
Posts: 1307 | Location: Council Bluffs, IA | Registered: May 24, 2004Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
ON my last post should most likely not have left the tabpageno in it.
 
Posts: 1307 | Location: Council Bluffs, IA | Registered: May 24, 2004Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
this works like a charm(i'm in 525):
-SET &HDCOST = IF &WHICHCOST EQ 'STCOS' THEN 'Standard Cost' ELSE 'Actual Cost';
...
then in your code, not only the &var as a header but also a mouseover with info ( a bonus).

COST AS '<span title="Units * STSOC or STACC "> &HDCOST *,(d)</span>'

key is to make sure your &HDCOST header thing is separated by a blank before and after when you stick it in your AS phrase.
 
Posts: 2630 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    column headings

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