c# - Epplus - Repeat All Item Labels in Pivot Table -
i create pivot table epplus. made design things on pivot table cant find how repeat item labels in tabular layout *(in excel file pivottable tools - > report layout/repeat item labels)
here code.
public void write(pivottable pvttbl) { var tbl = getpivotdataastable(pvttbl.pivotdata); var rangepivottable = wsdata.cells["a1"].loadfromdatatable(tbl, true); var pivottable = ws.pivottables.add( ws.cells[1, 1], rangepivottable, "pvttable"); foreach (var rowdim in pvttbl.rows) { var row = pivottable.fields[rowdim]; pivottable.rowfields.add(row); row.subtotalfunctions = esubtotalfunctions.none; } foreach (var coldim in pvttbl.columns) pivottable.columnfields.add(pivottable.fields[coldim]); pivottable.compact = false; pivottable.compactdata = false; pivottable.rowgrandtotals = false; pivottable.useautoformatting = true; pivottable.showmemberpropertytips = false; pivottable.dataonrows = false; pivottable.columgrandtotals = false; pivottable.rowgrandtotals = false; pivottable.outline = false; pivottable.outlinedata = false; pivottable.showdrill = false; (from pf in pivottable.fields select pf).tolist().foreach(f => { f.compact = false; f.outline = false; f.showall = true; f.subtotaltop = false; }); }
Comments
Post a Comment