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     Report Caster - How to date stamp the file name of your email distributed files

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Report Caster - How to date stamp the file name of your email distributed files
 Login/Join
 
Gold member
posted
Ok, well I searched the forums a while and searched the document lib but could not find any easy solutions for date stamping your email distributed files. I brainstormed a bit and this is the method I came up with. It's pretty clean and easy and requires little maintenance. There are other methods for ftp but I use email for distribution, however this should work for any type.

My methods was using MSSQL 2000 server as the 7.6.5 Report Caster repository. The db name is rcaster and user is iadmin.

Report Caster keeps its task info in the BOTTASK table and I will also use the BOTPARMS table to control which task to update.

I setup a stored procedure sp_datestamp_bottask on the MSSQL server in the rcaster database.

CREATE procedure dbo.sp_datestamp_bottask
as
UPDATE BOTTASK
SET ASVALUE = LOWER( convert(varchar, getdate(), 112) + '_' +SUBSTRING(BOTTASK.TASKOBJ , CHARINDEX('/', BOTTASK.TASKOBJ)+1 , 200 ) + '.' + BOTPARMS.PARAM_VALUE ) 
FROM BOTTASK JOIN BOTPARMS ON BOTTASK.TASKID = BOTPARMS.TASKID
WHERE BOTPARMS.PARAM_NAME LIKE 'datestamp';

commit
GO

This code is MSSQL syntax so it needs to be adjusted if your not using MSSQL for your repository.

The procedure joins BOTTASK and BOTPARMS by TASKID and updates ASVALUE (Save Report AsSmiler in BOTTASK where PARAM_NAME is like 'datestamp'. To select which records to update inside of caster I select the scheduled job -> task -> go into Advanced and add a parameter named 'datestamp' with the value of the file extension. I could not figure an easier way to control the file extension so I just us the value of the parameter. Your Save Report As changes to 20080620_car_report.xls, if you used xls as your datestamp parameter.

The update command will change the save report as name to the procedure name starting past the /. If your in deeper folders you will need to adjust this. It works great for my environment. So if you have a procedure named car_report in the rcaster application folder it would look like this rcaster/car_report. The update will strip off rcaster/ and use car_report as the file name, add the date as a prefix in YYMD format followed by an underscore and postfix .file extension (from parameter value). For MSSQL you can change the date format by changing the third parameter in convert().

From here you can run this several ways. I decided to create a .fex to run this procedure out of Reportcaster so I can handle it all from there. For MSSQL you can also just schedule the procedure to run on the server. You could also run it as a pre-processing procedure of any task.

Here is my procedure I schedule to run everyday at 12:01 in reportcaster.

-* File datestamp.fex

ENGINE SQLMSS SET CONNECTION_ATTRIBUTES rcaster tiawebfocus/iadmin,encryptedpassword

SQL SQLMSS EX dbo.sp_datestamp_bottask ;

-EXIT

This runs the procedure and updates my datestamps for the selected task every morning. You could easily add a timestamp if necessary, the Save Report As: (ASVALUE) field is varchar(64).

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


------------------------------------------
DevStudio 8.2.03
WFS 8.2.03
 
Posts: 86 | Location: Atlanta | Registered: May 10, 2007Report This Post
Gold member
posted Hide Post
^^^^^

LOL Smiler

: ) I'm not going to fix it.


------------------------------------------
DevStudio 8.2.03
WFS 8.2.03
 
Posts: 86 | Location: Atlanta | Registered: May 10, 2007Report 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     Report Caster - How to date stamp the file name of your email distributed files

Copyright © 1996-2020 Information Builders