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

def report_options(self, get_vars=None, widget_id='pivottable'):

    T = current.T
    SHOW_TOTALS = T('Show    totals')
    REPORT = T('Report    of')
    ROWS = T('Grouped    by')
    COLS = T('and')
    resource = self.resource
    get_config = resource.get_config
    options = get_config('report_options')
    settings = current.deployment_settings
    formstyle = settings.get_ui_report_formstyle()
    if (formstyle is None):
        formstyle = settings.get_ui_inline_formstyle()
    label = (lambda s, **attr: LABEL(('%s:' % s), **attr))
    formfields = []
    layer_id = ('%s-fact' % widget_id)
    layer_widget = self.layer_options(options=options, get_vars=get_vars, widget_id=layer_id)
    formfields.append(((layer_id + '-row'), label(REPORT, _for=layer_id), layer_widget, ''))
    axis_options = self.axis_options
    rows_id = ('%s-rows' % widget_id)
    cols_id = ('%s-cols' % widget_id)
    rows_options = axis_options('rows', options=options, get_vars=get_vars, widget_id=rows_id)
    cols_options = axis_options('cols', options=options, get_vars=get_vars, widget_id=cols_id)
    axis_widget = DIV(rows_options, label(COLS, _for=cols_id), cols_options, _class='pt-axis-options')
    formfields.append((('%s-axis-row' % widget_id), label(ROWS, _for=rows_id), axis_widget, ''))
    show_totals = True
    if (get_vars and ('totals' in get_vars) and (str(get_vars['totals']).lower() in ('0', 'false', 'off'))):
        show_totals = False
    self.show_totals = show_totals
    show_totals_id = ('%s-totals' % widget_id)
    totals_widget = INPUT(_type='checkbox', _id=show_totals_id, _name='totals', _class='pt-totals', value=show_totals)
    formfields.append((('%s-show-totals-row' % widget_id), label(SHOW_TOTALS, _for=show_totals_id), totals_widget, ''))
    try:
        widgets = formstyle(FIELDSET(), formfields)
    except:
        widgets = TAG['']([formstyle(*formfield) for formfield in formfields])
    fieldset = self._fieldset(T('Report    Options'), widgets, _id=('%s-options' % widget_id))
    return fieldset
