Load theme tpl after form submit From a custom module in Drupal 7 I am trying to load a template after I submit and process my form.

I can load the theme fine from a page callback:

function mymodule_theme() {
  $themes = array(
    'mymodule_report' =&gt; array(
      'template' =&gt; 'themes/mymodule_report',
      'arguments' =&gt; array(),
    ),
  );
  return $themes;
}

function mymodule_menu() {
  $items = array();       
  $items['reports/performance'] = array(
    'title' =&gt; 'My Module Performance Report',
    'page callback' =&gt; '_mymodule_report',
    'access arguments' =&gt; array('mymodule_client'),
  );
  return $items;
}

function _mymodule_report() {
  return theme('mymodule_report');
}


All of that works fine (e.g I can go to www.mysite.com/reports/performance and my tpl loads.).  The problem is when i submit a form, after I process the form I want to pass the form data to the template, and load the same template page.

I modified the hook_theme like this:

function mymodule_theme() {
  $themes = array(
    'mymodule_report' =&gt; array(
      'template' =&gt; 'themes/mymodule_report',
      'variables' =&gt; array('parameters' =&gt; NULL),
    )
  );
  return $themes;
}


And in my submit handler for my form after I gathered all my form values into an object ($submission), I added this at the end:

 return theme('mymodule_report', array('parameters' =&gt; $submission));


All that happens is my form reloads...what am I missing?
So I found a solution that works...of course if there's another or better way, I'd love to know.

I added this to my form:

  if (!empty($form_state['nnjob_mtbf']['mtbf_results'])) {
    $form['result'] = array(
      '#markup' =&gt; $form_state['nnjob_mtbf']['mtbf_results'],
    );
  }


And then to my form submit handler:

  $form_state['nnjob_mtbf']['mtbf_results'] = theme('nnreport_client_perf_report', array('parameters' =&gt; $submission));
  $form_state['rebuild']=TRUE;


And voila, template loads like a champ.