It's all about the answers!

Ask a question

Where does the ExcludeDays parameter get set in Burndown Report?


Ryan McBryde (5711130) | asked Feb 14 '17, 3:58 p.m.

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



permanent link
Donald Nong (14.5k414) | answered Feb 14 '17, 8:03 p.m.

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) &amp;&amp; (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
Ryan McBryde commented Feb 15 '17, 4:45 p.m.

 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);



Ryan McBryde commented Feb 15 '17, 5:16 p.m.

 As far as you know does that code to do the following:


Set "d" to the value of whatever was selected in the "Week Days" report parameter.
Sets "ExcludeDays" to False.
WeekDays to NULL
if "d" exists and "d" is not empty THEN
   set weekDays to the result of splitting "d" on a comma (if more than one day in "d" then WeekDays will be more than 1.  If only one day in "d" then Weekdays will be 1.
check to see if Weekdays is equal to 0 or 7 and if either, 0 = no days selected, 7 = all days selected, then set weekDays to NULL   ELSE set ExcludeDays to TRUE (indicating that at least one day and less than 7 days were selected.


Donald Nong commented Feb 16 '17, 12:11 a.m.

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.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.