Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Crystal reports Layout- Unable to group,sort Post Reply Post New Topic
Page  of 2 Next >>
Author Message
namitanamburi
Newbie
Newbie


Joined: 26 Mar 2009
Online Status: Offline
Posts: 39
Quote namitanamburi Replybullet Topic: Crystal reports Layout- Unable to group,sort
    Posted: 26 Mar 2009 at 7:44am

I want to create a report in Crystal Reports 10.

 

I have already created this is Oracle reports 10g using the Group left layout and I want to recreate same layout in Crystal.

 

Issue 1: Scenario is one employee John is both a Chef and Waiter , his User Id is Unique and his status can be different as per his role.In the sense he can have multiple roles, he can be a chef and a waiter and he both either active as chef and inactive as Waiter or versa or can be active as both chef or waiter or Inactive as both chef and waiter. No restriction on this.

 

But when I create this in Crystal , the User id  and name email address are always repeating. Is there any way you can tell me how to group this in Crystal like I did in Oracle reports 10g.In Oracle 10g I used wizard and chose Group left report style which gave me desired output as I grouped them with Role User Id then name, email address and then role.

 

I scanned through all built-ins in Crystal like the Group Expert but nothing worked out. The group expert gives me an output 3 shown below.

 

Question 1)

 

Can anyone tell me is there any way to group or do something which will get me my Required layout.

 

 

Question 2)

 

Can we write a sql query and generate report in Crystal like we do in Oracle Reports? Or is it like we have to design everything and then only we can see query but cannot write query before designing it.

 

 

 

Required :

 

 

 

UserId  Name   Email address   Role       Status

 

A         John     John@al.com   Chef       Active

                                             Waiter    Inactive

 

B          Sam     Sam@al.com    Chef       Inactive

 

C         Jim       Jim@al.com     Waiter    Inactive

                                             Bartender Active

 

D         Ted      Ted@al.com    Waiter     Inactive

                                             Supervisor Active

 

 

 

 

 

 

 

 

 

Obtained in Crystal Reports :

 

 

                                                

User Id Name   Email address   Role     Status

 

A         John     John@al.com   Chef     Active

 

A         John     John@al.com   Waiter  Inactive

 

B          Sam     Sam@al.com    Chef     Inactive

 

C         Jim       Jim@al.com     Waiter Inactive

 

C         Jim       Jim@al.com     Bartender Active

 

D         Ted      Ted@al.com    Waiter  Inactive

 

D         Ted      Ted@al.com    Supervisor Active

 

 

 

Obtained with Group Expert in Crystal and chose Role as grouping field :

 

 

                                                

User Id Name   Email address   Role     Status

 

Chef

                                                

A         John     John@al.com   Chef     Active

B          Sam     Sam@al.com    Chef     Inactive

 

Waiter 

                                    

A         John     John@al.com   Waiter  Inactive

C         Jim       Jim@al.com     Waiter Inactive

 



Edited by namitanamburi - 30 Mar 2009 at 10:33pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Mar 2009 at 8:55am
Group1=USer ID (Suppressed)
Details: User ID, Name, Email address, Role Status
 
In UserID, Name and Email Address go into Field Format and Common Tab and select the Suppress if Duplicated.
This will suppress the field if the previous rows record field is the same as the current rows record field.
If you run into problems where the name from one group is the same as the name from the next group and it is suppressing it just create a formula that is the ID and the Name together in the same field and display /suppress duplicate on that formula field since it should be unique.
IP IP Logged
namitanamburi
Newbie
Newbie


Joined: 26 Mar 2009
Online Status: Offline
Posts: 39
Quote namitanamburi Replybullet Posted: 26 Mar 2009 at 12:26pm

Thanks for reply,can you help me find the option SUPPRESS WHEN DUPLICATED



Edited by namitanamburi - 30 Mar 2009 at 10:34pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Mar 2009 at 12:50pm
I believe this option is in v10.
Right click on the field and select the Format Field option.
The Format Editor window will open.
Click on the Common Tab.
There is a Suppress if Duplicated option in the upper portion of the window.
That is what I was referring to.
IP IP Logged
namitanamburi
Newbie
Newbie


Joined: 26 Mar 2009
Online Status: Offline
Posts: 39
Quote namitanamburi Replybullet Posted: 30 Mar 2009 at 10:37pm




Hello,


Thanks for the reply and the prediction. Iam really sorry for posing such silly qns but being a novice in Crystal reports its reallY taking a while to crack out petty issues.

with your help I finally suppressed the duplicating values of User Id and Name and Email address.

Now I want a report like the one below.


UserId    Name     Email address   Role        Speaciality

A         John     John@al.com      Chef        Indian
                                                Chinese                 
                                    
                                    Waiter      Serving
                                                Taking Orders

B          Sam     Sam@al.com       Chef        Mexican
 
C         Jim      Jim@al.com       Waiter      Taking orders 
                                     
 
D         Ted      Ted@al.com       Chef        Mexican
                                                Thai
                                   
                                    Waiter      Serving


But Iam able to get something like this.

 
UserId    Name     Email address   Role      Speaciality

A         John     John@al.com      Chef        Indian
                                    Chef        Chinese                
                                    Chef        Thai
                                   
                                    Waiter      Serving
                                    Waiter      Taking Orders

B          Sam     Sam@al.com       Chef        Mexican
 
C         Jim      Jim@al.com       Waiter      Taking orders 
                                     
 
D         Ted      Ted@al.com       Chef        Mexican
                                    Chef        Thai
                                   
                                    Waiter      Serving



I cannot supress duplicate values for Role field AS i DID FOR uSERID,NAME,email address because then I shall get somethink like this.


UserId    Name     Email address   Role        Speaciality

A         John     John@al.com      Chef        Indian
                                                Chinese                
                                   
                                    Waiter      Serving
                                                Taking Orders

B          Sam     Sam@al.com                   Mexican
 
C         Jim      Jim@al.com                   Taking orders 
                                     
 
D         Ted      Ted@al.com                   Mexican
                                                Thai
                                   
                                                Serving


As you specualted I landed at this issue.

can you help me in writing a formula for this.I am not familiar wth formula syntax of Crystal,I guess this is different than SQL code. Also please let me know where do I need to write the formula.

Is it at Report - Selection formulas - Record?

         Report - Selection Formulas - Group?


Or should I write that formula at X-2 of selection expert?





Looking forward for your support.


Thanks in advance

Namita
 

 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 31 Mar 2009 at 6:42am

Instead of a suppress when duplicated use the suppress as a formula.

Right click on the field and select the Format Field option.
The Format Editor window will open.
Click on the Common Tab.
There is a Suppress option with an X-2 button on the right hand side.
Click on it and put a formual for suppression in there.
I believe you will want something like this for the role field:
previous (table.UserIDfield) =table.UserIDfield and previous (table.Rolefield)=table.Rolefield
and something like this for the Specialty field:
previous (table.UserIDfield) =table.UserIDfield and previous (table.Specialtyfield)=table.Specialtyfield
 
Replace the table with the actual table name and the field with the actual field names.
Note: Do not check the box for either suppress or suppress when duplicated. The formula you put in activates the suppression when the coniditions are met. You do not want it activated all the time.


Edited by DBlank - 31 Mar 2009 at 6:44am
IP IP Logged
namitanamburi
Newbie
Newbie


Joined: 26 Mar 2009
Online Status: Offline
Posts: 39
Quote namitanamburi Replybullet Posted: 31 Mar 2009 at 7:26am
Hey,

Thanks for the reply.

I did try using the formula in the x-2 beside supress , but when I try to check that formula, (Alt+C) there is an error.


It says

The ) is missing

I checked that I have closed and opened all parenthesis properly, did try couple of trial and error methods by keying in few more paranthesis. But did not paid off.


Thanks in advance
Namita




IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 31 Mar 2009 at 8:51am
Can you post the formula that you put in and got the error on?
Also make sure you use the brackets around the table objects (which I did not put in the original post ) like so:
 
previous({TableName.UserIDfield})={TableName.UserIDfield} and previous({TableName.Rolefield})={TableName.Rolefield}
IP IP Logged
namitanamburi
Newbie
Newbie


Joined: 26 Mar 2009
Online Status: Offline
Posts: 39
Quote namitanamburi Replybullet Posted: 31 Mar 2009 at 1:10pm
Please see below


Edited by namitanamburi - 31 Mar 2009 at 1:14pm
IP IP Logged
namitanamburi
Newbie
Newbie


Joined: 26 Mar 2009
Online Status: Offline
Posts: 39
Quote namitanamburi Replybullet Posted: 31 Mar 2009 at 1:11pm
< ="Content-" content="text/; charset=utf-8">< name="ProgId" content="Word.">< name="Generator" content="Microsoft Word 10">< name="Originator" content="Microsoft Word 10"><>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
UserId
Name
Email address
Status
Job Title
Speciality
 
 
 
 
 
 
 
 
A
John Lee
      John@al.com
Active
Chef
Thai
 
 
 
 
 
 
Indian
 
 
 
 
 
Waiter
Cleaning
 
 
 
 
 
 
 
 
B
Sam Watson
Sam@al.com
  Inactive
Waiter
Taking Orders
 
 
 
 
 
 
Cleaning
 
 
 
 
 
  Bartender
Cocktails
 
 
 
 
 
 
 
 
C
Tim Lopez
Tim@al.com
  Inactive
Chef
Indian
 
 
 
 
 
Waiter
Cleaning
 
 
 
 
 
 
Taking Orders
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
UserId
Name
Email address
Status
Job Title
Speciality
 
 
 
 
 
 
 
 
A
John Lee
      John@al.com
Active
Chef
Thai
 
 
 
 
Active
Chef
Indian
 
 
 
 
Active
Waiter
Cleaning
 
 
 
 
 
 
 
 
B
Sam Watson
Sam@al.com
  Inactive
Waiter
Taking Orders
 
 
 
 
  Inactive
Waiter
Cleaning
 
 
 
 
  Inactive
  Bartender
Cocktails
 
 
 
 
 
 
 
 
C
Tim Lopez
Tim@al.com
  Inactive
Chef
Indian
 
 
 
 
  Inactive
Waiter
Cleaning
 
 
 
 
  Inactive
Waiter
Taking Orders
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 




Edited by namitanamburi - 31 Mar 2009 at 1:13pm
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.