Focal Point
[SOLVED] DATE OF DAY IN THE EXCEL FILE NAME PRODUCED WITH CASTER AND SENT BY MAIL

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

October 10, 2011, 12:10 PM
Cati - France
[SOLVED] DATE OF DAY IN THE EXCEL FILE NAME PRODUCED WITH CASTER AND SENT BY MAIL
Hi Everybody,

I need to have the date of day in the file name attached to the mail sent via report caster, something like this : filename_jjmmaaaa.xls

I search in the forum but can't find the solution.

How can I do that ?

Thanks a lot for your answers.
Catherine

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


7.7.02 (Html, Excel, Ahtml, Pdf,Graph,.....)
OS400 V5R3, V5R4
Windows 2000/2003/2007/2010
October 10, 2011, 02:03 PM
Prarie
I'm sure there other methods, but I run a job in Reportcaster and save the report.

ON TABLE HOLD FORMAT EXL2K AS ONEGRAPH

then I have a copy job that copies it and adds the date sends to location and a link is sent via e-mail AS an inline message from Reportcaster

COPY \\CORP\TRANS\\GRAPHS\ONEGRAPH.xls \\CORP\\TRANS\GRAPHS\TWOGRAPH&MDYY...xls
October 11, 2011, 04:48 AM
Cati - France
Thanks for the answer.

What do you mean with "a link is sent via e-mail....".
How do you do that wiht report caster ?
Could you provide an example ?

Thanks a lot
(merci beaucoup)
Catherine


7.7.02 (Html, Excel, Ahtml, Pdf,Graph,.....)
OS400 V5R3, V5R4
Windows 2000/2003/2007/2010
October 11, 2011, 08:27 AM
Prarie
This is the entire Fex.

You run it as an inline message in Reportcaster

COPY \\CORP\TRANS\\GRAPHS\ONEGRAPH.xls \\CORP\\TRANS\GRAPHS\TWOGRAPH&MDYY...xls
NT DEL \\CORP\TRANS\GRAPHS\ONEGRAPH.xls
-*this  is run in Reportcaster and sends the link to the customer
DEFINE FILE CAR
MYLINK/A255='<A HREF="V:\TRANS\Graphs/TWOGRAPH&MDYY...xls">V:\TRANS\Graphs/TWOGRAPH&MDYY...xls </A>';
TODAY/MDYY = '&DATEMDYY';

END
TABLE FILE CAR
 PRINT
  CAR NOPRINT
  MYLINK AS ' '
 
IF READLIMIT EQ 1

HEADING
"Daily Spreadsheet Link"
"<TODAY"

" "

ON TABLE SET PAGE-NUM OFF

ON TABLE PCHOLD FORMAT HTML

ON TABLE SET STYLE *
     UNITS=IN,
     PAGESIZE='Letter',
     LEFTMARGIN=0.000000,
     RIGHTMARGIN=0.000000,
     TOPMARGIN=0.250000,
     BOTTOMMARGIN=0.250000,
     SQUEEZE=ON,
     ORIENTATION=LANDSCAPE,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=9,
    COLOR='BLUE',
     BACKCOLOR='NONE',
     STYLE=BOLD,
     RIGHTGAP=0.000000,$

TYPE=HEADING,
     BACKCOLOR='SILVER',
  JUSTIFY=CENTER,
  SIZE=10,
$

END  

October 11, 2011, 09:05 AM
njsden
Cati, this is one case where the "Burst Report" feature of Report Caster may come in handy.

See this:

DEFINE FILE CAR
TODAYDT/A8 WITH CAR = '&DMYY';
END
TABLE FILE CAR
PRINT COUNTRY AND CAR
BY TODAYDT NOPRINT
END


I'm using today's date (but this can be any date you need) as the first BY field of the request; I'm using NOPRINT as I don't need that value to be displayed but just to be picked by Repor Caster.

You can now add a new Report Caster schedule specifying email distribution with report attachement and, in the "Task" tab:

- Choose EXL2K as Report Format
- Check the "Burst Report" checkbox
- Specify the base filename you need in Save report As. For instance, try something like: "test_report.xls"

Burst will automatically take each unique instance of the first BY field value and append it to the filename specified (just before the file extension).

Once the schedule runs, you should be receiving an email with an attachement called: "test_report_11102011.xls".

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



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.
October 11, 2011, 10:01 AM
Prarie
That's good to know.
October 11, 2011, 12:43 PM
Cati - France
Does it work with a .txt file (format ALPHA) ?

Merci (thank you).
Catherine


7.7.02 (Html, Excel, Ahtml, Pdf,Graph,.....)
OS400 V5R3, V5R4
Windows 2000/2003/2007/2010
October 11, 2011, 12:56 PM
njsden
I've done it with HTML, EXL2K and PDF without any issue. I don't see why ALPHA or any other WebFOCUS-supported format would be excluded.

There's no better way to see if this works than to actually trying and testing it. Create a schedule and when choosing your 'Report Output' format make sure the ALPHA format is available. If it is, then the technique should apply equally; the final result is just a file so the behaviour should be the same.

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



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.
October 11, 2011, 01:53 PM
Cati - France
I'll try it and let you know if it works.
Thanks.
Catherine


7.7.02 (Html, Excel, Ahtml, Pdf,Graph,.....)
OS400 V5R3, V5R4
Windows 2000/2003/2007/2010
October 11, 2011, 02:20 PM
njsden
Yes, please Cati. You cathed my interest on this now Wink



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.
October 14, 2011, 10:17 AM
Cati - France
Hello,

We made a lot of different tests.
It works with a .txt file but only when a unique email address is used in the caster.
When we try to use a distribution list with several email addresses, it does not work.
When we try to use an external file containing several email addresses, it does not work.

So, we have been obliged to create one instance of report caster for each adressee.

Thanks again for your precious help.
Catherine


7.7.02 (Html, Excel, Ahtml, Pdf,Graph,.....)
OS400 V5R3, V5R4
Windows 2000/2003/2007/2010