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

Free Support Forum - aspose.com

Sample code to transpose in C#

TRANCHE OUTPUT_DATE PRODUCTION
Dev Total DEC-2013 13.60451
Dev Total DEC-2014 26.83959
Dev Total DEC-2015 45.05292
NFA Total Dec-13 51.02899
NFA Total Dec-14 43.98017
NFA Total Dec-15 38.09948
BP2011 Dec-13 64.06692
BP2011 Dec-14 56.17001
BP2011 Dec-15 50.48164

I have the raw data above.I need to transpose to the format below. Please how can i do this in C#

Row Labels Dec-13 Dec-14 Dec-15
BP2011 64.06692228 56.17001 50.48164
Dev Total 13.60451229 26.83959 45.05292
NFA Total 51.02899327 43.98017 38.09948
GrandTotal 128.7004278 126.9898 133.634

Hi,


I think you may try to use PivotTable feature provided by MS Excel to perform your task to formulate your output report data, you may create pivot table report based on your source data in the worksheet. Aspose.Cells does support creating and manipulating pivot tables. Please see the document for your reference and write your codes accordingly (after referring to the document) to accomplish your task, it is not a big deal for you:
http://www.aspose.com/docs/display/cellsnet/How+to+Create+a+PivotTable

Thank you.

Hi,

Thanks, am not using a template. am using my code to generate the pivot, is there a way, i can generate the pivot and interchange the rows probably in another table to get the deseired table format.

Hi,


As I requested you to kindly see the document, especially the example code for your reference:
http://www.aspose.com/docs/display/cellsnet/How+to+Create+a+PivotTable

In the example, the data is inserted into the cells in a new worksheet/workbook (Excel file) and the code is not using any template file. The code first inserts data into the cells (in the worksheet) and then create the pivot table report based on the data.

Thank you.