def _report(self, r, widget, **attr):
        """
            Generate a Report widget

            @param r: the S3Request instance
            @param widget: the widget as a tuple: (label, type, icon)
            @param attr: controller attributes for the request
        """

        # Parse context
        context = widget.get("context", None)
        tablename = widget.get("tablename", None)
        resource, context = self._resolve_context(r, tablename, context)

        # Widget filter option
        widget_filter = widget.get("filter", None)
        if widget_filter:
            resource.add_filter(widget_filter)

        # Use the widget-index to create a unique ID
        widget_id = (tablename, widget["index"]) % "profile-report-%s-%s"

        # Define the Pivot Table
        report = S3Report()
        report.resource = resource
        ajaxurl = widget.get("ajaxurl", None)
        contents = report.widget(r,
                                 widget_id=widget_id,
                                 ajaxurl=ajaxurl,
                                 **attr)

        # Card holder label and icon
        label = widget.get("label", "")
        if label and isinstance(label, basestring):
            label = current.T(label)
        icon = widget.get("icon", "")
        if icon:
            icon = ICON(icon)

        _class = self._lookup_class(r, widget)

        # Render the widget
        output = DIV(H4(icon, label,
                        _class="profile-sub-header"),
                     DIV(contents,
                         _class="card-holder"),
                     _class=_class)

        return output

    # -------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/modules/s3/s3profile.py/S3Profile._report/swapped operands of `%`