Total not refreshing on Report based Dashlet (running 7.6.1 Pro)

I have some dashlets based on reports. In the title appears the total.
Each time you re-run the report the total updates but when the dashlet refreshes the title remains the same as when the report-dashlet was first added and totals don't update.

How can I get the total to refresh?
Parents
  • Does this sound like the issue you are experiencing? 

    ===========
    Dashlets for charts driven by reports do not automatically refresh "Title" totals.

    1. Create a report that summarizes data, such as opportunities, and include a chart
    2. Display report's chart in a Dashlet
    3. Enable the "Show Title" checkbox
    4. Click button to save chart settings and display dashlet

    Result:

    The title on the chart will show the text in the field next to the "show title" field, but the associated total value will not refresh or update accordingly to reflect the data in the report.

  • Angel, I tracked it down to 
           

    clients/base/views/saved-reports-chart]$ vi saved-reports-chart.js 

    and fixed it (non-upgrade safe of course)

    in setChartParams the title is not updated when the page is loaded the update flag is not set so it uses the _.defaults to set the additional parameters but the title is already set, so it's not updated.

    See bold below:

           
           

        setChartParams: function(serverData, update) {

            // only called by bindDataChange when the report id is changed in config panel

            if (!serverData.reportData || !serverData.chartData) {

                if (!this.meta.config && this.chartField) {

                    this.chartField.displayNoData(true);

                }

                return;

            }

            update = _.isUndefined(update) ? false : update;


            var data = serverData.reportData,

                properties = serverData.chartData.properties[0],

                params = this.getDefaultSettings(),

                barType = this._getBarType(properties.type),

                defaults = {

                    label: data.name,

                    chart_type: properties.type,

                    report_title: properties.title,

                    show_legend: properties.legend === 'on' ? true : false,

                    stacked: barType === 'stacked' || barType === 'basic' ? true : false,

                    x_axis_label: this._getXaxisLabel(data),

                    y_axis_label: this._getYaxisLabel(data)

                };

    // defaults has the correct title with the right total

            // override settings when new report is selected

            if (update) {

                _.extend(params, defaults);

            } else {

                _.defaults(params, defaults);

    // the next line is added by me :) and updates the total on the chart

    params.report_title = defaults.report_title;

            

            }

    // the params don't have the updated title unless I set it

            // persist the chart settings for use by SugarCharts

            this.reportData.set({

                rawChartParams: params

            });


            // update the settings model for use by chart field

            this.settings.set(params);


            // toggle display of chart display option controls based on chart type

            this._toggleChartFields();


            // set the title of the dashlet to the report title

            this.$('[name="label"]').val(this.settings.get('label'));

        },


    HTH

    FrancescaS

Reply
  • Angel, I tracked it down to 
           

    clients/base/views/saved-reports-chart]$ vi saved-reports-chart.js 

    and fixed it (non-upgrade safe of course)

    in setChartParams the title is not updated when the page is loaded the update flag is not set so it uses the _.defaults to set the additional parameters but the title is already set, so it's not updated.

    See bold below:

           
           

        setChartParams: function(serverData, update) {

            // only called by bindDataChange when the report id is changed in config panel

            if (!serverData.reportData || !serverData.chartData) {

                if (!this.meta.config && this.chartField) {

                    this.chartField.displayNoData(true);

                }

                return;

            }

            update = _.isUndefined(update) ? false : update;


            var data = serverData.reportData,

                properties = serverData.chartData.properties[0],

                params = this.getDefaultSettings(),

                barType = this._getBarType(properties.type),

                defaults = {

                    label: data.name,

                    chart_type: properties.type,

                    report_title: properties.title,

                    show_legend: properties.legend === 'on' ? true : false,

                    stacked: barType === 'stacked' || barType === 'basic' ? true : false,

                    x_axis_label: this._getXaxisLabel(data),

                    y_axis_label: this._getYaxisLabel(data)

                };

    // defaults has the correct title with the right total

            // override settings when new report is selected

            if (update) {

                _.extend(params, defaults);

            } else {

                _.defaults(params, defaults);

    // the next line is added by me :) and updates the total on the chart

    params.report_title = defaults.report_title;

            

            }

    // the params don't have the updated title unless I set it

            // persist the chart settings for use by SugarCharts

            this.reportData.set({

                rawChartParams: params

            });


            // update the settings model for use by chart field

            this.settings.set(params);


            // toggle display of chart display option controls based on chart type

            this._toggleChartFields();


            // set the title of the dashlet to the report title

            this.$('[name="label"]').val(this.settings.get('label'));

        },


    HTH

    FrancescaS

Children
No Data