简体   繁体   English

C#+ Crystal Reports +仅用于一个Box的Select Expert?

[英]C# + Crystal Reports + Select Expert for only ONE Box?

following Problem. 接下来的问题。 I am generating my Reports with Crystal Reports from a Database, CR gets a DataSet as DataSource. 我正在从数据库中使用Crystal Reports生成报告,CR将DataSet作为DataSource。 I have a Table like this one in my DataSet: 我的数据集中有一个像这样的表:

... | Rank | Comment | ...
----+------+---------+-----
... | User | blabla  | ...
... | VIP  | blublu  | ...

so I have the same Rank and Comment field twice in my Report, can I somehow tell CR to show Users comment in one box and VIPs comment in the other one? 因此我在“报告”中有两次相同的“等级和评论”字段,我可以以某种方式告诉CR在一个框中显示“用户评论”,在另一个框中显示VIP评论吗? I have already tried filtering the results with Select Expert, it works, but for the whole document and I want different formulas for these two fields. 我已经尝试使用Select Expert过滤结果,它可以工作,但是对于整个文档,我希望这两个字段具有不同的公式。 What am I doing wrong? 我究竟做错了什么?

Greetings and thanks 问候和感谢

I know you are looking for it to be in columnar format, but this is much easier if you do not need it in this format. 我知道您正在寻找采用列格式的格式,但是如果您不需要此格式的格式,这会容易得多。 You would jut simply group by the user type (User, VIP), but this will print all of the Users Comments and then print all of the VIP's comments. 您只需按用户类型(用户,VIP)分组即可,但这将打印所有用户注释,然后打印所有VIP注释。 Even doing it this way you could possibly do some sort of running total or accumulator of the comments to display in the footer. 即使采用这种方式,您也可以对注释进行某种累计或累加,以显示在页脚中。

That said, if you want to do it in this format, another option that I can think of off the top of my head is to create 2 subreports, one for User and One for VIP and put them side by side. 也就是说,如果您想以这种格式进行操作,我可以想到的另一种选择是创建2个子报表,一个用于User,一个用于VIP,并排放置。 If you need these comments for each row of a report you can use shared variables to pass in your row selection data to your subreport. 如果报表的每一行都需要这些注释,则可以使用共享变量将行选择数据传递到子报表中。 The one big issue about doing this is that you'd essentially be running two reports for each row that your main report runs so I wouldn't exactly recommend doing this because of the possibility of slowness and over use of resources. 这样做的一个大问题是,您实际上将为主报告运行的每一行运行两个报告,因此,由于速度慢和过度使用资源的可能性,我不建议您这样做。

If there are going to be more options besides just User and VIP then I believe that you should be able to put together a crosstab report for this where the columns are the user type and the row is a comment identifier of some sort. 如果除了“用户”和“ VIP”之外还有更多选项,那么我相信您应该能够为此编写一个交叉表报告,其中列是用户类型,行是某种注释标识符。 In my head this is feasible, but in practice I may be mistaken. 在我看来这是可行的,但实际上我可能会误会。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM