[TriZPUG] xlwt and Data / Subtotals?

Paul Godley paul at godley.org
Wed Nov 4 15:32:33 CET 2009


I believe you're right, Josh. Upon closer examination, it looks like
Excel just adds a row and inserts a SUBTOTAL function in the cell
below the data when the control field breaks. I thought there was some
magical sheet-wide function going on. I think I can mimic that
behavior with xlwt.

Thanks!

-P

On Tue, Nov 3, 2009 at 8:44 AM, Josh Johnson <josh_johnson at unc.edu> wrote:
> Have you tried just writing the formula into the cell, as you would in
> excel? I've not used xlwt, but recall having some success with that in the
> past.
>
> I'd also be grepping the _source code_ and the examples for "formula" if I
> were you :) IIRC, the excel function is SUM(), and you can pass it a cell
> range, eg =SUM(A1:A5)
>
> HTH,
> JJ
>
> On Nov 2, 2009, at 4:44 PM, Paul Godley wrote:
>
>> Greetings All,
>>
>> I use xlwt to create some Excel worksheets from data in Postgres. I've
>> not had a need to use formula before, but now I'm interested in
>> implementing the behavior you get in Excel when you use the Data /
>> Subtotals... menu. My Google efforts haven't turned up anything
>> useful. A grep of the xlwt "examples" folder for "subtotal" returns no
>> hits. Does anyone know if xlwt supports this kind of thing? I've seen
>> subtotals mentioned in ExcelMagic.py, but I don't understand it yet.
>>
>> If you know it can or cannot be done, that'll put me on the right path.
>>
>> Thanks!
>>
>> -P
>> _______________________________________________
>> TriZPUG mailing list
>> TriZPUG at python.org
>> http://mail.python.org/mailman/listinfo/trizpug
>> http://trizpug.org is the Triangle Zope and Python Users Group
>>
>
> _______________________________________________
> TriZPUG mailing list
> TriZPUG at python.org
> http://mail.python.org/mailman/listinfo/trizpug
> http://trizpug.org is the Triangle Zope and Python Users Group
>


More information about the TriZPUG mailing list