trying to detect Total and subTotal Cells

Discussion forum for PivotCube VCL users. Common questions. Bug and problem reports

Moderator: Alex Zencovich

trying to detect Total and subTotal Cells

Postby dophin » Tue Aug 21, 2007 8:40 pm

Hello, Alex

Is there any possibility to "detect" total (Row, Column) and subtotal cells.

I've put this in a getRowTotal event handler

showMessage( 'GetRowTotal' ) ;

and the message does not show up.

Am i missing something once more ?

Thank you and best regards,

Joseph Osende
dophin
Developer
 
Posts: 33
Joined: Fri Jun 15, 2007 12:35 am

Postby AlexZencovich » Tue Aug 21, 2007 9:13 pm

Yes. OnGetRowTotal fired for fixed totals only because they painting in different way than usual.
You should use OnGetCellValue event and check RowIndex parameter.
If it is same as PivotMap.TopRows.Index then you have row total.
If you have PivotMap.RowCells[RowIndex].ChildCount > 0 - then you get subtotal
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am

Postby dophin » Tue Aug 21, 2007 9:23 pm

Thank you, Alex.

Really fantastic service !!!

Joseph Osende
dophin
Developer
 
Posts: 33
Joined: Fri Jun 15, 2007 12:35 am

Postby dophin » Tue Aug 21, 2007 9:27 pm

Hello, Alex

Do you use the same kind of logic
regarding colum total cells ?
dophin
Developer
 
Posts: 33
Joined: Fri Jun 15, 2007 12:35 am

Postby dophin » Tue Aug 21, 2007 10:22 pm

hello, Alex

I've tried the following :

if ( measureIndex = 4 ) then
if (( cell <> Nil )) then
begin
if ( rowIndex = pivotMap1.TopRows.Index ) then
cellString := ' '
else
if ( columnIndex = pivotMap1.TopColumns.Index ) then
cellString := ' '
end

but my rowTotals and ColumnTotals are still displayed

Coud you please help me ?

TIA

Joseph osende
dophin
Developer
 
Posts: 33
Joined: Fri Jun 15, 2007 12:35 am

Postby AlexZencovich » Wed Aug 22, 2007 5:32 am

change
cellString := ' ' (empty string)
to
cellString := ' ' (space string)

Empty string treatened as if event does not provide own string value so it format original value
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am

Postby dophin » Wed Aug 22, 2007 7:22 am

Thank you very much

Joseph Osende
dophin
Developer
 
Posts: 33
Joined: Fri Jun 15, 2007 12:35 am


Return to PivotCube VCL

Who is online

Users browsing this forum: No registered users and 8 guests

cron