将数据表导出为ex​​cel数据透视表可编辑 [英] Exporting Datatable to excel pivot table as editable

查看:171
本文介绍了将数据表导出为ex​​cel数据透视表可编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想将c#datatable导出到excel数据透视表。导出的数据透视表应该是可编辑的,这意味着用户可以编辑数据透视表单元格中的值。更改的值必须自动反映在宏总计。

我想用c#。任何人都可以帮忙吗?



谢谢,

Surbhi

Hi,
I want to export the c# datatable to excel pivot table.The exported pivot table should be editable means user can edit values in pivot cells.The changed value must automatically be reflected in grand totals.
I want this using c#.Can anyone help?

Thanks,
Surbhi

推荐答案

我想说你能够实现几乎与Excel相同的功能。比方说,您需要创建可编辑的gridview。这就是全部!

由于许多因素,使用第三方应用程序(如Excel)是个坏主意:

1)你不能(完全)控制它,

2)你需要将数据导出到Excel而不是将它们导入你的数据库,这意味着不必要的数据移动,

3)等



查看我以前的答案:替换法规中的字符串 [ ^ ]。关于非常有趣的文章计算引擎有一个很棒的东西。

如果你想知道如何实现Sum列,请使用SearchBox [ ^ ]。

要创建数据透视表,请使用SQL PIVOT [ ^ ]声明。

在SQL查询中使用Pivot的简单方法 [ ^ ]

在SQL Server 2005中使用动态列的数据透视表 [ ^ ]

SQL Server中的数据透视表。一个简单的样本。 [ ^ ]



试试吧!

祝你好运!
I'd like to say that you're able to achieve almost the same functionality what Excel does have. Let's say, you need to create editable gridview. That's all!
It's bad idea to use third party application (like Excel), because of many factors:
1) you can't (fully) control it,
2) you need to export data to Excel than to import them to your database, which means unnecessary data movement,
3) etc.

Have a look at my previous answer: Replace string in statment[^]. There is a lonk to very interesting article abour "calculation engine".
If you want to know how to achieve Sum column, please use a SearchBox[^].
To create pivot table, use SQL PIVOT[^] statement.
Simple Way To Use Pivot In SQL Query[^]
Pivots with Dynamic Columns in SQL Server 2005[^]
Pivot tables in SQL Server. A simple sample.[^]

Try!
Good luck!


这篇关于将数据表导出为ex​​cel数据透视表可编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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