Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Webfocus print full/extended date in document

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Webfocus print full/extended date in document
 Login/Join
 
Member
posted
Hello,

I'm creating a pdf document using appstudio and would like to print out the date on the master page in a textbox. The date needs to be in the format of wrMtrDYY, so something like Thursday March 28, 2019. I'm relatively new to webfocus and it's language, but not new to programming at all. I feel like i could figure out how to do this relatively easily with most languages with a quick google search, however i'm having no luck here. Am i missing something obvious ? as close as i can get is printing out 2019/03/28, and anything i try that seems like it should print out the wrMtrDYY date ends up printing out 5 or so digits that seem like the data stored in the variable but not displayed properly. any help would be greatly appreciated.

Thanks,
Greg Coley

This message has been edited. Last edited by: FP Mod Chuck,


Greg Coley
 
Posts: 11 | Location: Pittsburgh, PA | Registered: February 13, 2019Report This Post
Virtuoso
posted Hide Post
Go to Date Display Options topic here to find the masks specific to your use case.

https://webfocusinfocenter.inf...if42.htm#ddif1077126

  
TABLE FILE CAR
SUM DEALER_COST
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SUBHEAD
"&DATEtr &DATEtrM &DATED, &DATEYY "
ON TABLE PCHOLD FORMAT HTML
END


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Member
posted Hide Post
quote:
"&DATEtr &DATEtrM &DATED, &DATEYY "

Thanks, this definitely printed out the date. 2 follow up questions,

1) What can be done to print portions of a date like this on a date variable other than today ? For instance i need to print out yesterday's date and i've created the following variable:
-SET &YESTERDAY = AYMD(&YYMD, -1, 'I8YYMD');
How can i print the values of &YESTERDAY ? i'll likely need to do this with a variable i'm going to create that will be the "last working day" which will be the last day that's not a holiday or a weekend, i already have script that delivers that date i just need to display it correctly.

2) What can be done about the spacing in the displayed date ? &DATEtr &DATEtrM &DATED, &DATEYY displayed looks like: Friday March 29,2019, is there some way to concatenate and control the spacing ? i'm guessing by the look of it that it's almost putting each variable in a cell, or something similar.


Greg Coley
 
Posts: 11 | Location: Pittsburgh, PA | Registered: February 13, 2019Report This Post
Virtuoso
posted Hide Post
Populate a DEFINEd field with today's date and then manipulate the format and extract the components you need.
https://webfocusinfocenter.inf...ateSimplified175.htm

  
DEFINE FILE CAR
CURR_DAY/YYMD=&YYMD;
YESTERDAY/MtrDYY=DTADD(CURR_DAY, DAY, -1);
YES_DAY_NM/WR=YESTERDAY;
END
TABLE FILE CAR
PRINT CURR_DAY YES_DAY_NM YESTERDAY 
BY COUNTRY
END


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Member
posted Hide Post
So i can see how that allows you to print data within a report. However, I'm trying to do this in a textbox in a master page of a PDF document. It would appear that i don't have the ability to do a lot of the standard commands here / Or its not clear how to print the data i need.


Greg Coley
 
Posts: 11 | Location: Pittsburgh, PA | Registered: February 13, 2019Report This Post
Virtuoso
posted Hide Post
You should look at the doc to find out how to code these. There are a lot of ways to accomplish pretty much everything you describe. The best way to learn how is to look through the doc or take some training classes.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Member
posted Hide Post
quote:
Originally posted by BabakNYC:
You should look at the doc to find out how to code these. There are a lot of ways to accomplish pretty much everything you describe. The best way to learn how is to look through the doc or take some training classes.


Previously i worked in SQL SSRS for 8 years, and i'm a programmer who uses C#, SQL, and PHP daily. As far as webfocus goes, I have taken intro level classes for making reports, making master files, and making collaborative portals. At this point i've made 15-20 reports, and 20+ synonyms (I know these aren't huge numbers, but it's not like i logged into here immediately after i finished installing the program...). Unfortunately, there's a big push at IBI that everything can be done in webfocus using the GUI and the training courses reflect as much. However anyone that's spent more than 10 minutes trying to make a customized report for end users knows your going to end up in the code pretty quickly. I've done a ton of reading/researching date formatting and here's what i'm finding (NOTE: i'm working with a PDF Document here):
- The developer has almost unlimited ability for displaying/manipulating dates when creating a report. That's fine and it works really well when i'm developing a report. In the code for creating a document it would appear that i don't have the same freedom. for example, if i try to so something like "[variableName]/[DataType]", It's not allowed, i get an error. But i can use "-SET" Commands when i use -SET commands to get what i believe is a date formatted the way i'm looking for, i get a 5~6 digit output when it is displayed in the textbox in the master page of the document. I believe this is the data stored within the variable, which somehow loses formatting settings. Someone earlier mentioned using "&DATEtr &DATEtrM &DATED, &DATEYY " Which worked really well, however it results in giant gaps in between variables when displayed, is there anyway around these gaps ? Is there some other obvious way to print a date that i've already set in the format i want on a pdf in a text box ?


Greg Coley
 
Posts: 11 | Location: Pittsburgh, PA | Registered: February 13, 2019Report This Post
Gold member
posted Hide Post
Put this in a focexec and try executing it:

-SET &TODDATE =  &DATEtr || (' ' | &DATEtrM) || (' ' | &DATED || ',') || (' ' | &DATEYY) ;
-TYPE TODDATE:  &TODDATE

-TYPE TODAY IS &YYMD
-SET &MYDATE = DAYMD(&YYMD,'I6');
-SET &BEFORE = &MYDATE - 7 ;
-SET &BEFDAT = DTYMD(&BEFORE,'I8YYMD') ;
-TYPE MYDATE: &MYDATE  BEFORE: &BEFORE  BEFDAT: &BEFDAT

-SET &OUTDATE = '              ';
-SET &OUTDATE = FPRINT( &BEFORE - 365 , (MDYYt), '&OUTDATE') ;

-SET &MYWEEK = &BEFORE / 7 ;
-SET &MYWKDAY = &BEFORE - (&MYWEEK * 7) ;
-SET &MYWEEKD = DECODE &MYWKDAY(0 'Sunday' 1 'Monday' 2 'Tuesday'
-                 3 'Wednesday'  4 'Thursday' 5 'Friday' 6 'Saturday');
-TYPE &MYWEEKD &OUTDATE
-EXIT

>>ex test
TODDATE:  Monday April 01, 2019         
TODAY IS 20190401 
MYDATE: 43555  BEFORE: 43548  BEFDAT: 20190325           
Monday Mar 25, 2019   


This may help you to understand Focus dialog manager, NEWDATES and OLDDATES,
and dialog manager user functions.

Focus NEWDATES are integers representing the number of days since Dec 31, 1900. You can add or subtract days from a NEWDATE and you will get the correct NEWDATE using this date arithmetic.

OLDDATES are integer or alpha fields that, when printed as integers, look like a date but you cannot add or subtract values from them. E.g. BEFDATE is a I8YYMD OLDDATE, whose value is 20,190,325.

You can use the DTYMD and DAYMD functions to convert from newdate to olddate, or olddate to newdate.

FPRINT is a general purpose function that can be called to output formatted dates (or any IBI format, for that matter). Strangely, when given input NEWDATEs, you must subtract 365 to get the correct output alpha string.

Finally, look at &TODDATE to see how to format dialog mgr variables using strong (||) and weak (|) concat.


IBI Development
 
Posts: 61 | Registered: November 15, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Webfocus print full/extended date in document

Copyright © 1996-2020 Information Builders