Page 1 of 1

Automatically Run the Report + File Name Change

Posted: Fri Jul 09, 2010 12:36 pm
by Lossadil
Hi,

The function "Automatically Run the Report" seems to be great but how can I provide at each time a different name for the report file ?

By exemple :

c:\report_2010.07.08.csv
c:\report_2010.07.09.csv
c:\report_2010.07.10.csv
c:\report_2010.07.11.csv
...

Cause at the moment, each new file erase the older ...

Thanks a lot.

Re: Automatically Run the Report + File Name Change

Posted: Sat Jul 10, 2010 11:24 am
by support
Sigh...

I was writing up a description of how this can be done and went to test it, only to find out it can't :-( The filename can be adjusted by the date/time if it's being FTP'ed up to a server but not if it's being saved to the local disk :wall: Not sure how I missed this but I'll add support for it in the next release.

In the meantime, if you're running the Pro Edition, you can save the report to a fixed-name file, then run a post-processing command to copy it to another file with a timestamped name.

Posted: Sun Jul 11, 2010 10:23 am
by Lossadil
Hi,

I'm very interested by the "post-processing" option ... cause, in the meantime, I have to launch a excel macro on the results ...

But the problem is that I didn't find any information on this "post-processing" function ... How can I code it ? In which language ? Parameters ?

thanks

Re: Automatically Run the Report + File Name Change

Posted: Mon Jul 12, 2010 9:39 pm
by kevotheclone
This feature isn't documented in the Awasu's help yet, and I thought it was documented in the release notices but I couldn't find it there either. So I guess the only real documentation to date was emailed to the beta testers:

Code: Select all

There's a new "Run post-processing command" button in the Channel Report config dialog. The command recognizes the following template parameters:
       - {%REPORT-FILENAME%}
       - {%REPORT-NAME%}
       - {%REPORT-DESCRIPTION%}
       - {%CHANNEL-FILTER-NAME%}
       - {%TEMPLATE-FILENAME%}
       - {%CHANNEL-FOLDERS%} (comma-separated list)
       - {%WORKPAD-NAME%}
plus any extra template parameters defined for the report.

So you could configure the command to be "notepad.exe {%REPORT-FILENAME%}"


Aligned with Awasu's standard of using ├╝ber-common programming paradigms, you can use any programming language that accepts command-line parameters... so virtually any programming language will work.


Last month I created an Awasu Wiki page that documents a super-simple Post Processing Open Command. This generic command uses the Windows file-extension mechanism to start the program that is associated with the file extension of your Channel Report. There's nothing to install it uses the built-in Windows Start command. This may (or may not) be applicable to your current task, but I thought you might be interested. So if your Channel Report file name ends withe .XLS or .CSV this start command should run Excel based upon the file extension association.

I'll add a Wiki page and a KML-based Channel Report soon that can be used with the above-mentioned command to open the KML-based Channel Report in Google Earth.

Update, Sept. 21, 2010: I finally added the KML Channel Report Awasu wiki page.

An alternative
As well as being able to push data out of Awasu and into Excel via Channel Reports, it's also possible to pull data out of Awasu and into Excel via the Awasu API. I just created an Awasu Wiki page documenting the pull technique last week (good timing :)): Inserting Awasu Data Into Microsoft Excel

And of course you can pull Awasu data into Word too.

Re: Automatically Run the Report + File Name Change

Posted: Tue Jul 13, 2010 3:54 pm
by kevotheclone
Regarding programming languages

How could I forget?

Last month I added this Awasu Wiki page Extensibility Skillsets (with Taka's help) listing the basic skills need for each of Awasu's different types of extentions.

I see I forgot about "Channel Report post processing" as an extention type (there's so many different types), I'll add it ASAP.

As you can see almost everything is language independant (XSLT and XPath being the main exceptions).

Re: Automatically Run the Report + File Name Change

Posted: Wed Jul 14, 2010 10:34 am
by support
kevotheclone wrote:I thought it was documented in the release notices but I couldn't find it there either.

Oops, busted :oops: This got missed but I've updated the 2.4.2 release notes.

Posted: Wed Jul 14, 2010 11:49 am
by support
Lossadil wrote:But the problem is that I didn't find any information on this "post-processing" function ... How can I code it ? In which language ? Parameters ?

I spent quite a bit of time stuffing around trying to get a batch file working that would do this but Windows is quite stubbornly refusing to allow Awasu to launch it :-( but it's quite easily do-able using a Python script.

Save this script somewhere e.g. <tt>c:\copyReport.py</tt>:

Code: Select all

import os
import sys
import time

fname = "c:\\report_%s.csv" % time.strftime("%Y.%m.%d")
os.system( "copy %s %s" % (sys.argv[1],fname) )

It simply takes a filename passed in on the command line and copies that file to another file with a timestamp in its name (using the naming convention you used in your original post).

Then configure your report to run a post-processing command like this:

Code: Select all

python.exe c:\copyReport.py "{%REPORT-FILENAME%}"

This launches Python, running your script, passing it the name of the generated report file.

Posted: Wed Jul 14, 2010 2:35 pm
by Lossadil
Hi guys,

Mr. "support", your script works like a charm... Thanks a lot !!! I'll go in holiday this sunday and it will be very helpfull !!!

Now, if you have any mean to launch a batch.bat in the meantime, it would be perfect :-)))