Focal Point
[CLOSED] chaning the file name dinamically in RC, appeding todays date to filename

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

April 08, 2012, 04:24 PM
FOCUS393
[CLOSED] chaning the file name dinamically in RC, appeding todays date to filename
I am trying different options , if guys any other ideas

I have a by field by default the out file name changes according to the BY field but I want to append the todays date to the output file name

I created a pre processing fex in theRC which
appends the asvalue column in the BOTTASK table
but am only able to access DTSSCHEDULEID and DTSTASKID in original task it self not in the pre processing so , I have to supply the SCHEDULEID manually , which is not a good idea for me

So is there any way I can update the file name dynamically when scheduling the report in report caster other than EDA mail

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


WebFOCUS 7.6
Windows, All Outputs
April 09, 2012, 09:16 AM
Prarie
I have a Reportcaster job that runs each day and then I have a little copy job that runs and copies it to a location with the appended date, then I delete the first file. Maybe you can do something like this.


 COPY \\CORP\GROUP\TRANS\DEMREPORT.xls  \\CORP\GROUP\TRANS\DEMREPORT&MDYY...xls
NT DEL \\CORP\GROUP\TRANS \DEMREPORT.xls

April 09, 2012, 11:50 AM
FOCUS393
Thanks for the reply

How can we hold a report in a particular location ?

after holding can we rename by copying into different locations in the same fex

if am using distribution list for rc can we achieve the above


WebFOCUS 7.6
Windows, All Outputs
April 09, 2012, 02:18 PM
Prarie
In this case I FILEDEF the file to a location
Put this at the top of the report
FILEDEF MYDOC DISK \\CORP\GROUP\TRANS\REPORTRAPH.xls

Then in your report
ON TABLE HOLD FORMAT EXL2K AS MYDOC

Yes you can copy it as manytimes and locations as you want.
I have a link to the final location sent to users in the distribution list.

I'm sure others have different ideas that may come along.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
I couldn't figure it out either. I opened a case with IBI and they finally threw up their hands and said there was an NFR outstanding that they would attach my case to. See:
Case: 73392519
Summary: NFR: ReportCaster send report to FTP site with a timestamp


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
Have you considered concatenating the date and the original first BY field in a new virtual field and use the latter to burst the report instead?

As ReportCaster will put the BY value as part of the file name you will get your date in there ... just an idea.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
Guys, unless I'm totally mis-reading the question, this is an easy one...though I'm not sure why tech support could not answer it.

You use the dynamic distro method to append the data/time to the file name. Here's a brief method using the CAR table.

For this example, make sure you're bursting on COUNTRY. Note this example also shows how to send each bursted report to it's own country folder:

DYNAMIC DISTRIBUTION LIST fex
DEFINE FILE CAR
DEST/A50=COUNTRY||'\'||CAR||'_&YYMD';
END
TABLE FILE CAR
SUM DEST
BY COUNTRY AS VALUE
ON TABLE SET ASNAMES ON
ON TABLE PCHOLD
END


The output is:
  <?xml version="1.0" encoding="ISO-8859-1" ?> 
- <fxf version="1.0" data="hold">
- <report records="10" lines="5" columns="2" rows="5">
  <target format="" version="" type="" destination="HOLD" /> 
- <column_desc>
  <col colnum="c0" fieldname="COUNTRY" alias="COUNTRY" datatype="char" width="10" focus_format="A10" description="" accept="" help_message="" title="" within="" property="" reference="" valign="left" /> 
  <col colnum="c1" fieldname="DEST" alias="E02" datatype="char" width="50" focus_format="A50" description="" accept="" help_message="" title="" within="" property="" reference="" valign="left" /> 
  </column_desc>
- <table>
- <tr linetype="data" linenum="1">
  <td colnum="c0">ENGLAND</td> 
  <td colnum="c1">ENGLAND\TRIUMPH_20120410</td> 
  </tr>
- <tr linetype="data" linenum="2">
  <td colnum="c0">FRANCE</td> 
  <td colnum="c1">FRANCE\PEUGEOT_20120410</td> 
  </tr>
- <tr linetype="data" linenum="3">
  <td colnum="c0">ITALY</td> 
  <td colnum="c1">ITALY\MASERATI_20120410</td> 
  </tr>
- <tr linetype="data" linenum="4">
  <td colnum="c0">JAPAN</td> 
  <td colnum="c1">JAPAN\TOYOTA_20120410</td> 
  </tr>
- <tr linetype="data" linenum="5">
  <td colnum="c0">W GERMANY</td> 
  <td colnum="c1">W GERMANY\BMW_20120410</td> 
  </tr>
  </table>
  </report>
  </fxf>


This works for timestamps and any other variable you want to add to the filename.



In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle
But here is what I did temp fix

I had setup a diff job 5 mins early to the original job , which will update the asvalue column in Bottask table of webfocus

I tried the same thing in
pre processioning fex but it did not worked because it is already taking the file name into the memory as soon as schedule execution is initiated

Thank you all

DavSmith's idea looks good I will give it a try



Njsden,Thanks
but I have some distribution list based on the
burst field if I concatenate the burst field with date for the by field then I have to change the distribution list every day because I have to concatenate the date field to the burst field in Distribution list too or I can generate dynamic distribution list from other fex which becomes complicated


WebFOCUS 7.6
Windows, All Outputs
I had a report where the client wanted the date appended to the report name. Here is how we did it:

-* File newfex_car.fex
APP PATH IBISAMP

DEFINE FILE CAR
HIDDEN_SORT/I9 = &YYMD;
END

TABLE FILE CAR
SUM
DEALER_COST
BY HIDDEN_SORT NOPRINT
BY COUNTRY
BY CAR
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
-*ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=TITLE,
STYLE=BOLD,
$
TYPE=TABHEADING,
SIZE=12,
STYLE=BOLD,
$
TYPE=TABFOOTING,
SIZE=12,
STYLE=BOLD,
$
TYPE=HEADING,
SIZE=12,
STYLE=BOLD,
$
TYPE=FOOTING,
SIZE=12,
STYLE=BOLD,
$
TYPE=SUBHEAD,
SIZE=10,
STYLE=BOLD,
$
TYPE=SUBFOOT,
SIZE=10,
STYLE=BOLD,
$
TYPE=SUBTOTAL,
BACKCOLOR=RGB(210 210 210),
$
TYPE=ACROSSVALUE,
SIZE=9,
$
TYPE=ACROSSTITLE,
STYLE=BOLD,
$
TYPE=GRANDTOTAL,
BACKCOLOR=RGB(210 210 210),
STYLE=BOLD,
$
ENDSTYLE
END

The HIDDEN_SORT saves the current date. When creating the job in RC, on the Task tab we checked the Parameter Name and the Burst Report checkboxes. We have the Report Name as newfex_car.xls. When the job is run, the report name is newfex_car_20120417.xls.

It's worked perfectly for us. I was in a RC training class at IBI and asked the instructor how to do this and this is what he came up with.

simba


WF 7.7/Windows
Simba, I just tested your solution and it does work if you want to send the entire report to a non-dynamic single or multi address.

Because adding the date to the filename depends on the BURST checkbox being checked, the dynamic distro burst process I describe above does not work. The reason why is because the first sort value in the report fex must match the first by sort field in the dynamic distro fex. This is true whether the first sorts are displayed or hidden. I tested this theory and could not make it work using Dynamic Distribution.

Thanks for providing this info, though. I'm sure it will prove useful for many.



In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle