Focal Point
[CLOSED] COlumn Date in Heading

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

June 29, 2010, 02:52 PM
Arif
[CLOSED] COlumn Date in Heading
I have a report that runs for certain date. I also have a column in the report that has period and year associated to the date. Is there a way I can show period information in header? I looked in here I found that I can show paramet value in hearer; however, I want a different value from a field showing in my heading. Is it possible?

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


WebFOCUS 7.6.10
Windows
HTML
June 29, 2010, 03:04 PM
FrankDutch
I am sure it can be done, but not easy to give you an answer you can use.
post something more info and we might be able to help a bit.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

June 29, 2010, 05:21 PM
Arif
Sorry I didnt provide complete information. Here is the list of complete information:

I have a field called date I am using in parameter. I also have a column name Fiscalyearperiod. I want to show FISCALyearperiod information for the user selected dated in the header information. Exmaple:
User Selected date> 01/01/2010

Coresponding Value for FiscalYearPERIOD is 201001
So, I want to show 201001 in header when user select 01/01/2010


IF User Selected date> 02/01/2010

Coresponding Value for FiscalYearPERIOD is 201002
So, I want to show 201002 in header when user select 02/01/2010


WebFOCUS 7.6.10
Windows
HTML
June 29, 2010, 05:38 PM
Darin Lee
Just put that amper variable in the AS phrase for that column. Say your date input variable is &FY_PERIOD.

PRINT Fiscalyearperiod AS '&FY_PERIOD'


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
June 29, 2010, 05:59 PM
Waz
If this is about Titles and not Headings, perhaps the title should be changed to "Column Date in Title".


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 29, 2010, 05:59 PM
Darin Lee
I guess that I'm assuming that by "header" you mean the column title. For putting it in a sub/page/report heading, the &var name just goes between the double quotes wherever you want it placed.


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
June 30, 2010, 12:08 AM
Arif
I think I still didnt post clearly what I want.
Here is what my Table looks like

Date FYP
01/01/2010 201001
02/01/2010 201002
03/01/2010 201003
When user runs the report, report opens a parameter page with date selection. User selectc a date 01/01/2010, so when user selects this date I want it to show 201001 in heading of the report not column. If user select 02/01/2010 then heading should be 201002. I hope I am clear enough I can not use &FYP because I am not selcting FYP in the parameter. Any idea?


WebFOCUS 7.6.10
Windows
HTML
June 30, 2010, 12:25 AM
Waz
OK,

If FYP is in the data you are tabling, then include the field in the heading "
If its not, TABLE the file with the FYP in it, with a date filter, Hold it, then -READ the value into a variable.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 30, 2010, 09:34 AM
Arif
quote:
with a date filte

Folloing is the table so i have the FYP value in my table but user is seletcing DATE Value in the parameter, so I cant use &DATE variable. I need FYP for the selected date in my heading. 
DATE          FYP
01/01/2010   201001
02/01/2010   201002
03/01/2010   201003



WebFOCUS 7.6.10
Windows
HTML
June 30, 2010, 06:04 PM
Waz
I think that I'm getting old.....

Is this what youa are looking for.

The heading has two options in it.

EX -LINES 4 EDAPUT FOCTEMP,TMP_FYP,CV,FILE
01012010 201001
02012010 201002
03012010 201003

EX -LINES 5 EDAPUT MASTER,TMP_FYP,CV,FILE
FILENAME=TMP_FYP, SUFFIX=FIX,$
SEGNAME=TMP_FYP, $
  FIELD=DATE,ALIAS=  ,DMYY ,A9 ,$
  FIELD=FYP,ALIAS=  ,A6    ,A6 ,$

FILEDEF TMP_FYP DISK tmp_fyp.ftm (LRECL 15

-RUN

-SET &Filter = '> 01/01/2010' ;

-SET &DateTemp= EDIT(&Filter,'$$9999999999');
-SET &DTest   = EDIT(&Filter,'99');
-SET &DTest   = DECODE &DTest('>' 'GT') ;

TABLE FILE TMP_FYP
HEADING
"Date From: <MIN.DATE"
"Selected Dates: &Filter"

PRINT *
WHERE DATE &DTest '&DateTemp'
END



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 30, 2010, 06:12 PM
Darin Lee
You cannot use the value of another field in the column heading. If you want anything in the column title other than the field name it has to go in the AS phrase and the only thing that can go in there is text or an &var. A little creativity would allow you to easily manipulate the date you are passing and create an &var that can be used in the column title:

-Set &TITLE=EDIT(&SELECTDATE,'$$$$$$9999')|EDIT(&SELECTDATE,'99');

No need to rely on a field.

This message has been edited. Last edited by: Darin Lee,


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
June 30, 2010, 08:00 PM
Dan Satchell
If your report is based on FYP, why not use FYP for user selection on your parameter selection page? What does the WHERE clause in your report look like? I would be interested to see how you obtain the data for FYP on your report if you are using a DATE value in your WHERE clause.

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
July 01, 2010, 04:25 PM
Darin Lee
Alternatively, you could write a separate procedure that would create dynamic Dialogue Mangager code to populate the column title based on a selected parameter value. Here's an example from CAR:

-SET &ECHO=ALL;
-DEFAULTH &CAR=JENSEN
-* &CAR is the user selected value
-* Set up your dynamic fex
FILEDEF HOLD DISK dmfex.ftm (APPEND
-RUN
-WRITE HOLD -SET &|TITLE=
-* read the car file creating a matched pair  of value(CAR) and column heading(COUNTRY) for the value selected and write out the DM code
DEFINE FILE CAR
COUNTER/I9 WITH RCOST=COUNTER+1;
LINE1/A80=IF COUNTER EQ 1 THEN '- IF &|CAR EQ '|''''||CAR||''''||' THEN '|''''||COUNTRY||'''' ELSE
                                '- ELSE IF &|CAR EQ '|''''||CAR||''''||' THEN '|''''||COUNTRY||'''' ;
END
TABLE FILE CAR
PRINT LINE1
ON TABLE HOLD FORMAT ALPHA
END
-RUN
-WRITE HOLD - ELSE ' ' ;
-CLOSE HOLD
-* HOLD now contains a complete Dialogue Manager statement  which will take the value selected and populate &TITLE with the appropriate value.
-MRNOEDIT -INCLUDE dmfex.ftm
TABLE FILE CAR
PRINT CAR AS '&TITLE'
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF,$
TYPE=TITLE, STYLE=BOLD,$
ENDSTYLE
END


If you view source on this you'll see the contents of the dynamically generated fex with the DM code.


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