Siegmar Gieseler wrote:I am using a STAR SCHEMA but as the dimension name I use the content of the FACT TABLE ( to keep the correct alphabetic order ).
When I export to EXCEL I would like to insert 2 or 3 fields of the FACT TABLE besides the dimension name.
Rows Value
A 1
B 2
C 3
But I would like to export:
Rows Value
A AA AAA 1
B BB BBB 2
C CC CCC 3
I understand it's a very specific feature, but I really need it
Do I have to change de source code to make this work ?
You may use next way.
In your code, before you call TPivotGrid.ExportToExcel, set event handler to TPivotGrid.OnAfterRefresh. Then call TPivotGrid.RefreshData so handler procedure will called.
In even handler, move along Rows[] or Columns[] to find dimension you need and change corresponding PHeaderCell.Text to value you need to setup. After it, call to ExportToExcel will use changed header cells. Then you may clear event handler and call refreshData to restore original look.
PS You may need to call LockWindowUpdate(TPivotGrid.Handle) to prevent screen update .
Best regards,
Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment