如何使用c#在水晶报表中动态添加/删除列 [英] how to add/remove columns dynamically in crystal reports using c#

查看:98
本文介绍了如何使用c#在水晶报表中动态添加/删除列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开展一个管理项目,我希望使用水晶报告打印费用详情。

问题是费用头(名称)将由客户在软件中动态添加。所以,现在当我准备报告时,我将不得不添加客户在报告中创建的所有费用头。我在这里看到了很多解决方案,但它们都告诉我们要添加所有列并隐藏那些不需要的列。但是在这之前我不知道会有多少列,我该如何添加列。

例如:



报告可能如下:



Class Adm_FEE TermI TermII TermIII Bus //客户端可能创建了更多或更少的列

I 2000 2000 3000 1000 200

II 20999 2322 3332 1233 1233

....

....

.....





请帮助我们.....

I am currently working on a management project where i want to print fee details using crystal reports.
The problem is that the fee heads(its name) will be added dynamically by the client in the software. So, now when i am preparing the report i will have to add all the fee heads that client have created as columns in the report. I have seen many solutions here, but they all tell us to add all the columns and hide those not required. But here before hand i dont know how many columns would be there, how can i add the columns.
Eg:

The report could br like:

Class Adm_FEE TermI TermII TermIII Bus //client may have created more or less columns
I 2000 2000 3000 1000 200
II 20999 2322 3332 1233 1233
....
....
.....


Kindly help me guys.....

推荐答案

我使用Crystal报表的CROSS TAB功能轻松完成了这个。



参考这些CP文章 -

使用其功能组,图表,交叉表和子报表逐步创建Crystal报表 [ ^ ]





第二种方法 - 在某些情况下你可以去wi根据您的要求,记事本具有预定义的列和几个用户定义的公式的IMPORT PICK LIST。

请参阅 -

http://www.c-sharpcorner.com/UploadFile/uditsingh/CR1111022006055359AM/CR11.aspx [ ^ ]



选择是你的。



最好的问候。
I have done this using CROSS TAB feature of Crystal report with ease.

Refer these CP article-
Step by Step Creation of Crystal Report using its Features Group, Graph, Cross-Tab and Sub Report[^]


2nd method - In some of the scenarios you can go with IMPORT PICK LIST with the notepad having the predifined column and couple of user defined formulas as per your requirement.
Refer this-
http://www.c-sharpcorner.com/UploadFile/uditsingh/CR1111022006055359AM/CR11.aspx[^]

Choice is yours.

Best Regards.


感谢您的第一个选择。交叉表工作完美。第二个选项在我的情况下是无效的,因为我没有预定义列列表,因为客户端在运行时添加列......





谢谢..
Thanks for the first option. The cross tab works perfectly. The second option is invalid in my case as i dont have predefined column list,since clients add columns during runtime......


Thanks..


这篇关于如何使用c#在水晶报表中动态添加/删除列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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