'Render the form for the report
@param get_vars: the GET vars if the request (as dict)
@param widget_id: the HTML element base ID for the widgets'

def html(self, pivotdata, filter_widgets=None, get_vars=None, ajaxurl=None, filter_url=None, filter_form=None, filter_tab=None, widget_id=None):

    T = current.T
    appname = current.request.application
    report_options = self.report_options(get_vars=get_vars, widget_id=widget_id)
    hidden = {'pivotdata': json.dumps(pivotdata, separators=SEPARATORS)}
    empty = T('No    report    specified.')
    hide = T('Hide    Table')
    show = T('Show    Table')
    throbber = ('/%s/static/img/indicator.gif' % appname)
    if (filter_widgets is not None):
        filter_options = self._fieldset(T('Filter    Options'), filter_widgets, _id=('%s-filters' % widget_id), _class='filter-form')
    else:
        filter_options = ''
    resource = self.resource
    submit = resource.get_config('report_submit', True)
    if submit:
        _class = 'pt-submit'
        if (submit is True):
            label = T('Update    Report')
        elif isinstance(submit, (list, tuple)):
            label = submit[0]
            _class = ('%s    %s' % (submit[1], _class))
        else:
            label = submit
        submit = TAG[''](INPUT(_type='button', _value=label, _class=_class))
    else:
        submit = ''
    form = FORM(filter_options, report_options, submit, hidden=hidden, _class='pt-form', _id=('%s-pt-form' % widget_id))
    output = {'form': form, 'throbber': throbber, 'hide': hide, 'show': show, 'empty': empty, 'widget_id': widget_id}
    settings = current.deployment_settings
    opts = {'collapseOptions': settings.get_ui_hide_report_options(), 'renderTable': True, 'collapseTable': False, 'showTotals': self.show_totals, 'ajaxURL': ajaxurl, 'renderChart': True, 'collapseChart': True, 'defaultChart': None, 'exploreChart': True, 'filterURL': filter_url, 'filterTab': filter_tab, 'filterForm': filter_form, 'autoSubmit': settings.get_ui_report_auto_submit(), 'timeout': settings.get_ui_report_timeout(), 'thousandSeparator': settings.get_L10n_thousands_separator(), 'thousandGrouping': settings.get_L10n_thousands_grouping(), 'textAll': str(T('All'))}
    chart_opt = get_vars['chart']
    if (chart_opt is not None):
        if (str(chart_opt).lower() in ('0', 'off', 'false')):
            opts['renderChart'] = False
        elif (':' in chart_opt):
            opts['collapseChart'] = False
            (ctype, caxis) = chart_opt.split(':', 1)
            opts['defaultChart'] = {'type': ctype, 'axis': caxis}
    table_opt = get_vars['table']
    if (table_opt is not None):
        table_opt = str(table_opt).lower()
        if (table_opt in ('0', 'off', 'false')):
            opts['renderTable'] = False
        elif (table_opt == 'collapse'):
            opts['collapseTable'] = True
    s3 = current.response.s3
    scripts = s3.scripts
    if s3.debug:
        script = ('/%s/static/scripts/d3/d3.js' % appname)
        if (script not in scripts):
            scripts.append(script)
        script = ('/%s/static/scripts/d3/nv.d3.js' % appname)
        if (script not in scripts):
            scripts.append(script)
        script = ('/%s/static/scripts/S3/s3.ui.pivottable.js' % appname)
        if (script not in scripts):
            scripts.append(script)
    else:
        script = ('/%s/static/scripts/S3/s3.pivotTables.min.js' % appname)
        if (script not in scripts):
            scripts.append(script)
    script = ("$('#%(widget_id)s').pivottable(%(opts)s)" % dict(widget_id=widget_id, opts=json.dumps(opts, separators=SEPARATORS)))
    s3.jquery_ready.append(script)
    return output
