使用ADO Recordset创建的Pivot - 自定义文件列表 [英] Pivot created using ADO Recordset - Customize filed list

查看:70
本文介绍了使用ADO Recordset创建的Pivot - 自定义文件列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用VSTO / C#以编程方式从数据集/ ADO记录集创建了一个Excel数据透视表。



所有字段都显示在"Pivot Table Filed List" - > "选择要添加到报告的字段"。



问题:是否可以在层次结构中显示这些字段? (通过VSTO或VBA)



(类似于浏览OLAP多维数据集时的字段显示)



例如:

 在"选择要添加到报告的字段"中的时刻字段如下所示。



公司

区域

产品

产品类别

销售人员

销售经理

发票金额



我想要它显示类似的内容。



价值*

    发票金额    

公司*

    公司

    地区

产品*

    产品

    产品类别

销售额*

    销售人员¥b $ b    销售经理

I have created an Excel pivot table programmatically from a Dataset / ADO recordset using VSTO/C#.

All the fields are displayed in "Pivot Table Filed List" -> "Choose fields to add to report".

Question: Is it possible to display these fields in Hierarchy? (Either via VSTO or VBA)

(Something similar to the field display while browsing OLAP cubes)

For example:
 At moment fields in "Choose fields to add to report" are shown as below.

Company
Region
Product
Product category
Sales person
Sales Manager
Invoice Amount

I would like it to display something like this.

Values*
    Invoice Amount    
Company*
    Company
    Region
Product*
    Product
    Product category
Sales*
    Sales person
    Sales Manager

{用户不应该选择*到枢轴表中的项目。}

{User should not be able to select the items with * into pivot table.}

我正在尝试避免构建自定义字段列表和/或选择。

I am trying avoid building custom field list and/or selection.

非常感谢任何帮助。

谢谢,

Nagaraj

Thanks,
Nagaraj

推荐答案

Hi Nagaraj G,

Hi Nagaraj G,

感谢您在MSDN论坛上发帖。

Thanks for posting in the MSDN Forum.

这是基于我的理解你想要的是在像这样的数据透视表中对项目进行分组

It's based on my understanding that what you want is grouping items in the Pivot Table like this

http://office.microsoft.com/en-us/excel-help/group-items-in-a-pivottable-report-HP010175903.aspx

因此,我建议您使用此线程来指导如何以编程方式添加数据透视表分组。请参阅

Consequently, I would recommend you this thread which directs how to programmatically add PivotTable groupings. Please refer to

http://support.microsoft.com/kb/326492

希望这会有所帮助。

祝你有愉快的一天。


这篇关于使用ADO Recordset创建的Pivot - 自定义文件列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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