简体   繁体   中英

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. 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? 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. 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. 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. 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. In my head this is feasible, but in practice I may be mistaken. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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