views_crosstab

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
ppc.coder's picture

Help with programmatically adding fields to view

Hi,

I am trying to get views_crosstab to work and have made some progress but am stuck on how to properly add new fields to the view. I am trying to fix this (views_crosstab_table.inc line 187):


// Add a "Total" column.
// TODO: Add an option for this.
1. $alias = $crosstab_columns['alias'] . '_total';
2. $this->view->query->add_field(NULL, 'SUM(' . $crosstab_data['table'] . '.' . $crosstab_data['field'] . ')', $alias);
3. $this->view->query->fields[$alias]['aggregate'] = TRUE;

Read more
Subscribe with RSS Syndicate content