We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

I want to fill empty pivot cell programmatically at run time

Hi

I generated a pivot table with C# that looks like this

Resource Class

UNDEV

PRE-DG1

DEV

CUMPROD

POST-DG3

UNCLARIFIED

Grand Total

CUMPROD

649.7777398

649.7777398

DEV

71.35799567

71.35799567

POST-DG3

23.61363462

23.61363462

PRE-DG1

117.9754108

117.9754108

UNCLARIFIED

13.53552061

13.53552061

UNDEV

3.2938108

3.2938108

Grand Total

3.2938108

117.9754108

71.35799567

649.7777398

23.61363462

13.53552061

879.5541122

I want to use this data to plot a water fall chart. i cant use it directly because excel dont have a water fall chart, so i need to manipulate it by using a stacked bar chart, but before i can manipulate, my data will have to be in the format below . I tried filling this format by iterating through the rows and using the cell in the row that has value to fill the empty cell. i tried with my code, it gave me strange data different from pivot data. Please how can i acheive this programmatically at run time. Attached is my sample code. am using aspose version 5.2.2.0

Resource Class

UNDEV

PRE-DG1

DEV

CUMPROD

POST-DG3

UNCLARIFIED

Grand Total

CUMPROD

649.7777398

649.7777398

649.7777398

649.7777398

649.7777398

649.7777398

649.7777398

DEV

71.35799567

71.35799567

71.35799567

71.35799567

71.35799567

71.35799567

71.35799567

POST-DG3

23.61363462

23.61363462

23.61363462

23.61363462

23.61363462

23.61363462

23.61363462

PRE-DG1

117.9754108

117.9754108

117.9754108

117.9754108

117.9754108

117.9754108

117.9754108

UNCLARIFIED

13.53552061

13.53552061

13.53552061

13.53552061

13.53552061

13.53552061

13.53552061

UNDEV

3.2938108

3.2938108

3.2938108

3.2938108

3.2938108

3.2938108

Grand Total

3.2938108

117.9754108

71.35799567

649.7777398

23.61363462

13.53552061

879.5541122

Case2: I have this pivot table sample

Row Labels

DEC-2011

DEC-2012

DEC-2013

DEC-2014

DEC-2015

DEC-2016

BP2011

102.4751271

86.16062842

101.9267757

116.1328398

144.2602586

161.8687039

Dev Total

13.60451229

26.83958561

45.05291561

64.88848038

NFA Total

88.44510789

77.496774

62.81541565

51.02899327

How can i interchange the pivot rows to get smaple below or transpose

Row Labels

DEC-2011

DEC-2012

DEC-2013

DEC-2014

DEC-2015

DEC-2016

Dev Total

0

0

13.60451229

26.83958561

45.05291561

64.88848038

NFA Total

0

0

88.44510789

77.496774

62.81541565

51.02899327

BP2011

102.4751271

86.16062842

101.9267757

116.1328398

144.2602586

161.8687039