Views Data Export Module not including the custom added rows in a view I have created a view for commerce orders where format is tabular and they are grouped by email of order owner. So basically each group of record shows how many orders are placed by a given email id.I need to have a extra row in each grouped results which is basically summary of order(showing cumulative order total) so I used views_summarize module and got it done. Now I need to have export views as csv or xls functionality so I put views_data_export module but it seems the row added by views_summarize is not included by csv or xls generated by views_data_export. 

I also tried including the row using hook_views_pre_render(), and I am seeing the row is getting added in the views page under preview but when I export the views in csv again the row does not appear.

Here is code 

function mymodulename_views_pre_render(&amp;$view) // don't forget to replace my_module with your modules name
{
  if($view-&gt;name == "paid_partner") {
    if($view-&gt;current_display = "paid_partner_csv" || $view-&gt;current_display = "paid_partner_xls") {
      foreach($view-&gt;result as $submission) {
        $order_total_summary += $submission-&gt;field_data_commerce_order_total_commerce_order_total_amount;
        $quantity_total_summary += $submission-&gt;commerce_line_item_field_data_commerce_line_items_quantity;
        $currency = $submission-&gt;commerce_order_total_amount_currency_code;
      }
    $price_display = commerce_currency_format($order_total_summary, $currency);
    // insert a 'total' row
    $row = new stdClass();
    $row-&gt;order_id = "Order Summary";
    $row-&gt;users_commerce_order_mail = "Order Total Summary";
    $row-&gt;commerce_line_item_field_data_commerce_line_items_quantity = $quantity_total_summary;
    $row-&gt;field_commerce_order_total[0]['rendered'] = array(
      '#markup' =&gt; $price_display,
      '#access' =&gt; TRUE,
    );
    $view-&gt;result[] = $row;
    }
  }
}


What can I do to include the summary row with each grouped record in exported csv or xls.
Views Data Export does not render your results in a traditional way, so render hooks are not executed. But you should be able to alter results using hook_views_post_execute:

This hook is called right after the execute process. The query has been executed, but the pre_render() phase has not yet happened for handlers.
Adding output to the view can be accomplished by placing text on $view-&gt;attachment_before and $view-&gt;attachment_after. Altering the content can be achieved by editing the items of $view-&gt;result.

Emphasis mine - that's what you should to to alter content not only for display purposes, but in generic, usage-independent way.