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.
After scavenging for help and attempting this several ways I thought I would finally post my solution for taking dates from a Webfocus data source and outputting it into an HTML calendar.
For my example I used the EMPDATA table and added each employee's upcoming anniversary date and year(s) of service. To display the HTML calendar I chose to use an outside product ScriptCalendar which seems to have many additional features. This calendar product is somewhat affordable, very easy to use, and accepts events as XML data which is pretty much the bread and butter of this trick.
This is a screen shot only. With the actual finished product you can scroll through the months, hyperlink text, display mouse-over text, show holidays, etc.
I am running this out of the BASEAPP folder and have placed the HTML and JS files from ScriptCalendar in the same folder. The code will take the dates and parse them into a XML file SCEVENT.XML which ScriptCalendar reads. DevStudio XML output is not suitable for this method so that is why I create a temp file and read/write the records into an XML file. Once the XML file is set I run calendar.htm using HTMLFORM. Again calendar.htm is the ScriptCalendar file which drives the product and places the XML data into the HTML calendar.
In the past I was really hoping to do all this inside of WebFocus however trying to code tables, placeholders, etc. to form monthly calendars in html and insert data just seemed way to overkill when its much easier to use a more powerful product that is easy to integrate.
Please let me know if you have any questions and I would like to hear of ways this method could be helpful to you.This message has been edited. Last edited by: trob,
Thanks trob, So, who's going to take this as a challenge to do this entirely in WebFOCUS? I will... But, that'll be in my spare time. I just spent an hour on it up to, but not to include the "-HTMLFORM CALENDAR"
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
trob, How about providing me with a data, preferably FOCUS DB, and the associated MFD? If so, I'll work on it in my spare time. I'm sure that it'll come in useful for someone.. someday... Besides, I think that "Yes, We Can Do That In WebFOCUS."
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
Here's some code I threw together a while ago to demonstrate creating a calendar on the fly. It could easily be extended to achieve what you wanted. It uses Dialogue Manager to create the code for the months data creation and highlights dates held in the HDAY file specified.
As you can tell from the fex name I have other calendar functions as well as this one.
T
-*******************************************************************************
-* Report Name : calendar_3.fex
-*
-* Report Description: Produce a calendar output for the current month.
-*
-* Tables Used :
-*
-* Report Parameters :
-*
-* Written by : Anthony Alsford EDATA Limited 13/02/2008
-*
-* Amendments :
-*
-* Notes:
-*
-*******************************************************************************
SET MSG = OFF
-* Identify the holiday file
FILEDEF HDAY DISK \\[your server]\c$\ibi\srv76\wfs\bin\HDAYFSLH.ERR
-* Build a temporary master file for the complete date data
FILEDEF DATEMAS DISK DATERNG.MAS
-RUN
-WRITE DATEMAS FILE=DATERNG,SUFFIX=XFOC
-WRITE DATEMAS SEGNAME=SEG1
-WRITE DATEMAS FIELD=DATE_KEY, ,DMYY ,DMYY , $
-RUN
-* Now create it
CREATE FILE DATERNG
-* and add all possible dates within a month
MODIFY FILE DATERNG
FREEFORM DATE_KEY.A8.
LOG FORMAT MSG OFF
LOG TRANS MSG OFF
LOG INVALID MSG OFF
DATA
-* This repeat loop will ensure at least a whole month is input,
-* Any invalid dates will be rejected.
-DEFAULT &Year = 2006
-SET &Year = EDIT(&YYMD,'9999$');
-SET &Mnth = EDIT(&YYMD,'$$$$99$');
-SET &Day = 1;
-SET &Yearx = &Year;
-REPEAT :Loop1 31 TIMES;
-SET &Date = IF &Day LT 10 THEN '0' || &Day ELSE &Day;
&Date&Mnth&Yearx
-SET &Day = &Day + 1;
-:Loop1
END
-RUN
-*
DEFINE FILE DATERNG
YEAR/YY = DATE_KEY;
MNTH_TTL/MTYY = DATE_KEY;
DOM/D = DATE_KEY;
KEY_YYMD/I8YYMD = DATE_KEY;
-* The day of week (DOW) gives us the column number
-* we require Monday thru Sunday so no change
DOW/W = DATE_KEY;
-* and the week no (WNO) gives us the row number - NOTE this is not the ISO week number!!!!
WNO/I2 = IF DOW EQ 1 THEN LAST WNO + 1 ELSE LAST WNO;
-* The first day of month (FDOM) gives us the offset column to begin the calendar display
FDOM/W = DATEMOV(DATE_KEY, 'BOM');
-* DAY_ADJ gives us the ability to line up weeks when used in the single row per month version
DAY_ADJ/I2 MISSING ON = IF DATE_KEY IS-NOT MISSING THEN (DOM + FDOM - 1) ELSE MISSING;
END
-*
TABLE FILE DATERNG
SUM DOM AS ''
COMPUTE WEEKEND/A1 = IF DOW IN (6,7) THEN 'x' ELSE '-'; AS '' NOPRINT
COMPUTE TODAY/A1 = IF DATE_KEY EQ '&DMYY' THEN 'Y' ELSE ''; NOPRINT
COMPUTE MNTH_YEAR/MTYY = DATE_KEY; NOPRINT
COMPUTE HDAY/A1 = IF DECODE KEY_YYMD(HDAY ELSE 'N') NE 'N' THEN 'Y' ELSE ''; NOPRINT
ACROSS DOW AS '' NOPRINT
BY WNO AS '' NOPRINT
HEADING
"<MNTH_TTL"
"M<+0>T<+0>W<+0>T<+0>F<+0>S<+0>S"
-* You could use this as an HTMTABLE
-*ON TABLE HOLD FORMAT HTMTABLE AS CALOBJ
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET NODATA ''
ON TABLE SET STYLE *
UNITS=IN, PAGESIZE='A3', LEFTMARGIN=0.2, RIGHTMARGIN=0.2, TOPMARGIN=0.2, BOTTOMMARGIN=0.2,
SQUEEZE=ON, ORIENTATION=LANDSCAPE, HEADALIGN=BODY, SIZE=9, GRID=ON, $
TYPE=HEADING, SIZE=10, BORDER=MEDIUM, BORDER-COLOR=RGB(66 66 66),
BACKCOLOR=RGB(189 190 194), HEADALIGN=BODY, $
TYPE=HEADING, LINE=1, STYLE=BOLD, JUSTIFY=CENTER, COLSPAN=7, $
TYPE=HEADING, LINE=2, OBJECT=TEXT, WIDTH=0.15, WRAP=0.15, JUSTIFY=CENTER, $
TYPE=REPORT, ACROSSCOLUMN=N1, WIDTH=0.15, WRAP=0.15, $
TYPE=ACROSSVALUE, COLOR=WHITE, $
TYPE=TITLE, BORDER=LIGHT, BORDER-COLOR=WHITE, $
TYPE=DATA, ACROSSCOLUMN=N1, JUSTIFY=CENTER, GRID=ON, $
-* Colour code the weekends
TYPE=DATA, ACROSSCOLUMN=N1, WHEN=HDAY EQ 'Y', BACKCOLOR=RGB(235 255 230), $
TYPE=DATA, ACROSSCOLUMN=N1, WHEN=TODAY EQ 'Y', BACKCOLOR=RGB(255 000 000), BORDER=MEDIUM, COLOR=WHITE, STYLE=BOLD, $
TYPE=DATA, ACROSSCOLUMN=N1, WHEN=WEEKEND EQ 'x', BACKCOLOR=RGB(215 220 255), $
TYPE=DATA, ACROSSCOLUMN=N1, WHEN=WEEKEND EQ '-', BACKCOLOR=RGB(230 235 255), $
ENDSTYLE
END
This message has been edited. Last edited by: Tony A,
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, 2004