0
votes

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

1
Could you explain this with the help of a screenshot? What is the actual & what is expected?shahkalpesh
I mean something like this: img194.imageshack.us/i/comf.jpg the Comment Field is the same for User and VIP (same Table, same name) and I need to do something like: if Row.Rank == VIP then CommentVIP.Text = Row.Comment elseif Row.Rank == User then CommentUser.Text = Row.Comment these two Comment-Boxes Object Names are in this case CommentVIP and CommentUser hope you got what I mean ;)Luke

1 Answers

2
votes

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. :)