Excel reports post processing script question
-
Hey hey, quick question, does the post processing script have any idea what points are assigned to the specific report? For example, I'd like to assign a point to a report and then have the script work with that particular point rather than having to hard code a point into the script.
-
Hi psysak,
I'm not 100% sure what you mean, but the points associated with named ranges are available to the script as context points using their range names. I believe if one uses a range name that shadows something defined in JavaScript that could be an issue. So, no naming a range "var" and using a post processing script, but "VAR" is fine.
Try out,
for(p in CONTEXT_POINTS) { print(p); }
If you
print(ExcelReportUtility)
you should see a method likeopenNamedRange(String namedRange, boolean append)
which you can use to continue writing values to a range used in the report if append is true when opening the range (see methods for writing to open ranges in print output). -
Hi @phildunlap what I mean is something akin to Script Context points in the sense that when the post processing script runs does it know which actual points are part of that report? I think you answered my question about the CONTEXT_POINTS.
-
One more question related to this, is the post processing script somehow aware of the time period that the report is running for? So for example my report is configured to run "Previous Month". Is there some parameter that the script can see which I could use to determine that the time range is currently Feb 1 - Feb 28?
-
Not currently. It's a relatively new feature and may not have had every possible use considered and accounted for yet. I do like the idea, I will see about adding it.
-
Great!
-
It will be possible in 3.6 via
//add ExcelReportVO available under 'report' variable name for post processing script for(var k = 0; k < report.getTimeSeries().length; k+=1) { //epoch time of time series beginning and end, for actual run var startTimestamp = report.getTimeSeries()[k].getStartTimestamp(); var finishTimestamp = report.getTimeSeries()[k].getFinishTimestamp(); }