0

I've two content types say Reports-1 and Reports-2. Using views I've displayed them as shown in the image. Reports-2 is attachment for Reports-1.

I used Views Calc to display sum at bottom of the table. (Total SUM) enter image description here

By using Views data export module I could able to export data to Excel format.

Right now the exported excel looks like follows. enter image description here

But my question is is there any possibility to show the data in separate tables with headers as Reports-1 and Reports-2? (like following image) to recognize the Reports. I need to display sum as well for Individual reports.

I'm also thinking to export views in different sheet of the same Excel. Is it possible?.

enter image description here

Can I do modifications on views-data-export tpl files. Is there any chance to render views output there? Any hints/suggestions!! ?

1

You can do it by using Phpexcel

check out the above link.may it will help you. i have customised my excel and csv files using phpexcel and it works great their.

  • +1 for your suggestion. The mentioned link is a library (one of the dependency for PHPExcelmodule). If possible try to elaborate your answer so that I can approve your answer. Just mention module name and it's description in your answer , Otherwise I'll answer my own question ;) – Krishna Mohan Jul 15 '14 at 14:03
0

I guess you can't do that without extending the views data export module. Maybe have a look at the Sheetnode module which can edit and write Multiple Worksheets.

Sheetnode integrates the JavaScript spreadsheet engine SocialCalc as a new node type in Drupal. SocialCalc was written by Dan Bricklin, co-author of the original VisiCalc spreadsheet app in 1979, and is used in the OLPC XO laptop and the SocialText Collaboration Platform.

It uses Apache POI for that so you will need to install Java and the PHP Java bridge.

Demo for multiple worksheets can be found here: Multiple worksheet demo

  • I think this module doesn't meet my requirement. Anyway thanks for your answer :) – Krishna Mohan Jul 7 '14 at 14:03
0

Finally I could able to resolve my issue using the PHPExcel module.

The PHPExcel module allows developers to export/import data to/from real Excel files.

The idea behind this module is to have a single module for handling the export or import of Excel files, instead of multiple modules handling specific cases.

The module provides no functionality as-is (the .module file is as good as empty). The phpexcel.inc file must be included to use the export or import functions in your own module.

I've written a custom module using PHPEXcel Hooks (hook_phpexcel_export()) and exported views data to Excel file into different sheets (3).

Hope this helps someone. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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