Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Can I do a Order by? Post Reply Post New Topic
Author Message
sahubba
Newbie
Newbie
Avatar

Joined: 30 Jun 2011
Location: United States
Online Status: Offline
Posts: 4
Quote sahubba Replybullet Topic: Can I do a Order by?
     Posted: 30 Jun 2011 at 1:53am
Hello, Everybody
 
I need to display these four status [ERQ – ER – OPO – IP] in 2 different orders  ERQ – ER – OPO – IP or ERQ – ER – IP - OPO

This is how I would like it to display

Group (Customer Name)         
ERQ 
ER
IP
OPO

Group (Customer Name)    
ERQ 
ER
OPO
IP

And if it is not in one of these orders then i do not want nothing to display (even the group).

Currently this is what i am getting

Group (Customer Name)     
 ER
OPO

Group (Customer Name)     
ERQ
IP
ER

And this is not correct.
I hope this makes sense and someone can help me with this.
Thanks


Edited by sahubba - 30 Jun 2011 at 1:54am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 30 Jun 2011 at 3:31am
are all the statuses on 1 line, or multiple.
 
If multiple, how do you know the order?  CR can't determine it in time for you to suppress the various fields.
 
Since you don't want to see various groups, the method to this is to go to Section Expert and for the Section desired enter a formula in the x-2 button that will return True when you don't want to see a section.
 
 
IP IP Logged
sahubba
Newbie
Newbie
Avatar

Joined: 30 Jun 2011
Location: United States
Online Status: Offline
Posts: 4
Quote sahubba Replybullet Posted: 30 Jun 2011 at 3:37am

Hello,

In the table that this column is in there is not a line column.
 
There will be customers that will not have their status in that order, but I do not want to see them, I only want to see the cstomers that have their status in those orders.
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 30 Jun 2011 at 5:15am
the only option that I can think of, not using a stored procedure, is to run a subreport that would check the order and return if it is ok to display or not to the main report via shared variables.
IP IP Logged
sahubba
Newbie
Newbie
Avatar

Joined: 30 Jun 2011
Location: United States
Online Status: Offline
Posts: 4
Quote sahubba Replybullet Posted: 30 Jun 2011 at 5:21am
Hello,
 
I am not using a stored procedure (at least I dont think I am)
 
Could you give me an example how to do that? With the supreport.
 
Thank you
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 01 Jul 2011 at 3:18am
since a subreport is basically a report, write a report that will create a string (let's say) that is the order for each group.  Then you can set a shared variable to the string in the subreport.
when that is working like you want, in the main report, insert a subreport, and use the report you have already written. I would create another section the group header and move it on top of the existing section and place the subreport in this section...this way the subreport will execute first. Now, for the 'original' group header, you can place a suppression formula using the same shared variable as in the subreport and you can compare the outputs.
 
in simple terms the suppression formula would look like:
shared stringvar a;  //in the subreport it would also be named a
a<>"xyz"
or
a<>"yzx"
 
 
some notes about the subreport, you will want to suppress the display output, and in the main report in the Section Expert, you will want to set the open to suppress blank rows on, this way the subreport will run, but will not display...you can display everything until you get everything the report working.  You will also need to link the subreport to the main report so that it only displays the values for the group you are in.  You will select 'Change subreport links' and match the field values in the main report to the parameter values in the subreport.
 
I know that there is a lot of info, and most of it is vague, but it should cover the points you need to find more concrete examples / items to look up in CR help.
 
HTH
 
 
IP IP Logged
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