Where does the ExcludeDays parameter get set in Burndown Report?
In looking at the Javascript code that is embedded in and used by the Burndown rptdesign file, I see a couple of instances of "ExcludeDays" being used in IF statements, indicating that it can be used as a boolean value. I cannot find where it is being set. It would appear that it is tied to the report parameter "Week Days" where one can select on of the days of the week to restrict which days of the week are included in the report. From this it would appear that if you select any one, or more of the Week Day values, it will set ExcludeDays to TRUE, otherwise it is false.
Can anyone confirm that this is where "ExcludeDays" comes from and that this is how it is used?
One answer
You probably don't need others to confirm for you. The only place that the excludeDays variable is set is in the "initialize" function of the report. I agree with your reasoning.
<method name="initialize"><![CDATA[function replaceAll(str, src, dst) {
while (str.indexOf(src) !== -1) {
str = str.replace(src, dst);
}
return str;
}
var d = params["Week Days"].value;
excludeDays = false;
weekDays = null;
if ((d) && (d != "''")) {
weekDays = d.split(',');
if ((weekDays.length == 0) || (weekDays.length == 7)) {
weekDays = null;
} else {
excludeDays = true;
}
}
reportContext.setGlobalVariable("excludeDays", excludeDays);
offset = params["Offset"].value;
if (!offset) {
offset = 0.0;
} else if (offset < 0.0) {
offset = 0.0;
}
dateTimeFormat = new java.text.SimpleDateFormat("dd/MM/yyyy H:mm");]]></method>
Comments
Donald,
Thanks. Where are you finding that "initialize" code? I found that in the "OnRender" function of the chart itself that this code is apparently setting "ExcludeDays" to TRUE as well as setting the "startDate", "firstDate", and the other date parameters from the global variables (getGlobalVariable) set in the data set code
xAxisPrimary.setCategoryAxis(context.getExternalContext().getScriptable().getGlobalVariable("excludeDays") == true);
As far as you know does that code to do the following:
I would say your interpretation of the code is correct.
I simply open the Burndown.rptdesign file to check. The variable "ExcludeDays" is set only in the report's "initialize" function, and used in several places - the "open" and "fetch" function of the scripted data source, and "beforeGeneration" function of the chart.