4

I have a requirement in which I need to display the stock report for an application as in the below image

enter image description here

I want to know how to group the Quantity, Batch no and Expiry date fields together in another column (Opening Stock) in Views. I am using Drupal 7 and Views 3.

Also I need a summary of the quantity in the footer of the view, for example sum of all quantity for a batch in the footer. Any help from the community is highly appreciated...

1 Answer 1

1

To group the quantity, Batch no and expiry date fields in another column, use the views secondary row module

Provides a way to split a views table row into two. In the table style settings, select a "Secondary row" option.

So if a table looks like this: Name | Description | Edit link | Delete link selecting "Name" as the secondary row option for "Edit link" and "Description" as the secondary row option for the "Delete link" will render two rows:

For summary of the quantity in the footer, use Views summarize

Enables an extra display style which displays summaries of a column on the last row.

3
  • Hi thanks for the reply, but I want the column headers to be split and not the rows, the views secondary module will not be suitable for my scenario I guess, is there any other way I can use it or can I achieve it using custom code? It is just a display alteration and nothing to do with views processing of data. Views summarize seems to solve my problem to show summary results..thanks for that
    – rohitsyte
    Commented Jul 17, 2013 at 12:23
  • How about creating your table normally and under advanced, on the theme information, select style output and create a custom tpl.php file, and then rewrite the table header in the .tpl.php file
    – 4life
    Commented Jul 17, 2013 at 14:16
  • Thanks, I was thinking about it, I think it should work.
    – rohitsyte
    Commented Jul 21, 2013 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.