如何在EPPlus中将数据透视表的报表布局设置为表格形式? [英] How to set Pivot table Report Layout to tabular in EPPlus?

查看:226
本文介绍了如何在EPPlus中将数据透视表的报表布局设置为表格形式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过查看EPPlus随附的示例,我设法创建了数据透视表,但是无法为其设置正确的报告布局。我希望它是表格,而不是大纲或其他任何形式。在我看来,EPPlus现在不支持此功能,但是也许我缺少了什么?

Looking at the samples that come with EPPlus I have managed to create the pivot table, but I am unable to set the correct report layout for it. I want it to be 'tabular', not 'outline' or whatever. To me it looks like EPPlus doesn't support this now, but perhaps I'm missing something?

推荐答案

比我想象的要容易得多。通过将一切设置为假,可以将表格渲染为表格。基本上就是这样:

This turned out to be way easier than I thought... By setting 'everything' to 'false' it the table rendered as Tabular. So basically:

pivotTable.Compact = false;
pivotTable.CompactData = false;
pivotTable.Indent = 0;
pivotTable.RowGrandTotals = false;
pivotTable.UseAutoFormatting = true;
pivotTable.ShowMemberPropertyTips = false;
pivotTable.DataOnRows = false;

field.Outline = false;
field.Compact = false;
field.ShowAll = false;
field.SubtotalTop = false;

这样,我就获得了具有表格布局的数据透视表。

That way I get the pivot table with tabular layout.

这篇关于如何在EPPlus中将数据透视表的报表布局设置为表格形式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆