Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example with template and grouping #4

Open
dfliess opened this issue May 6, 2013 · 6 comments
Open

example with template and grouping #4

dfliess opened this issue May 6, 2013 · 6 comments

Comments

@dfliess
Copy link

dfliess commented May 6, 2013

Hi!

First of all thanks for making and publishing this project.
I'm trying it and found difficult to make a template with grouping. Can you add an example ? Also is it possible to add functions on the summary ? Example: subtotal or sum of one field of the group ?

Thank you very much in advance.

@vernes
Copy link
Owner

vernes commented May 6, 2013

For grouping, see example 10

'group'=>array(
    'caption'=>array(
        'cat1'=>'Category 1',
        'cat2'=>'Another category'
    ),
    'rows'=>array(
        'cat1'=>array(0),
        'cat2'=>array(1,2)
    ),
    'summary'=>array(
        'cat1'=>array('product'=>'','price'=>23.99,'tax'=>12),
        'cat2'=>array('product'=>'','price'=>5.45,'tax'=>5.75)
    )
),

In 'caption' array you specify which groups you want, in 'rows' you assign rows for each group and in 'summary' you give row for subtotals (you must calculate subtotals yourself)

I hope this helps...

@vernes vernes closed this as completed May 6, 2013
@dfliess
Copy link
Author

dfliess commented May 6, 2013

Thanks for your prompt reply...I tested that example and worked perfect when not using template. I think that my issue is in how to create the template xls.

@dfliess
Copy link
Author

dfliess commented May 7, 2013

Also what do you think about the subtotal or sum of one field of the group ?

@vernes
Copy link
Owner

vernes commented May 7, 2013

Unfortunately, you can't use groups with templates.

I'll reopen the issue to see if that feature could be added in the future.

Thanks

@vernes vernes reopened this May 7, 2013
@dfliess
Copy link
Author

dfliess commented May 7, 2013

I'm looking at the code and I see at render that you call generateReport() if it's using a template instead of createReport and inside that function @line 469 generateRepeatingRowsWithGrouping is called, buy the function name it seems that that's what I'm expecting. That function also uses $this->_group, but I do not understand how that funciton works or how to create the excel template so that the group is repeated, I'm missing something ?

@jmb-oliveira
Copy link
Contributor

@vernes #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants