I think MikeD has the right idea. I have never used Jasper, but if it is a CSV or Excel file, why not write a block in your macro script that opens the Jasper report, makes a pivot table, then saves it again.
Honestly years have passed since I did VBA, but this code was what I found on the Internet for opening books (ref: http://p2p.wrox.com/excel-vba/10510-opening-excel-file -vba.html )
Dim oExcel as Excel.Application Dim oWB as Workbook Set oExcel = new Excel.Application Set oWB = oExcel.Workbooks.Open(<pathToWorkbookHere>)
Forgive the syntax on this, as it was with 10 year old memories, but from there you could do something like
oWB.Sheets(1).Cells.Copy ThisWorkBook.Sheets("PIVOTDATA").Cells.Paste() ThisWorkBook.Sheets("PIVOTTABLE").Cells.Refresh ThisWorkBook.Saveas("<path to new report>", xlExcel12)
If your reports are compiled by date, you can programmatically select either the latest version, download the folder and analyze all of them, or whatever. Your template file is the one that runs the script, and saves copies of itself in a "no macro" state, so your users never get a security warning.
If you correctly determine the file name programmatically, set the code to run βON OPENβ in the template macro and run thisworkbook.close
at the end of the script, all you need to do is create a batch file that automatically opens your book on the command line
excel.exe <template_filename>
then set up a cron job for Windows (called a scheduled task) to run automatically every day, immediately after running the jasper report.
Sorry if some of them are βhit and missedβ in terms of syntax. I was no longer elbows in Excel VBA for more than 10 years, but at that time I was writing a system that generated hundreds of beautifully formatted Excel reports every day ... pivot tables and all that.
It is achievable, and you are on the right track.