Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Report Help!! Post Reply Post New Topic
Author Message
nathchris
Newbie
Newbie
Avatar

Joined: 29 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote nathchris Replybullet Topic: Report Help!!
    Posted: 30 Jul 2007 at 8:35am
Hi,
 
My company currently have a report that shows Sales orders processed on a certain date, and my manager wants a new report which shows the account the order is on, which is fine, and the order number, the user who inputted it and the user who has printed the order.  i have input these fields i need, and have a date criteria selection so you can choose what date you want.  however my problem lies with the order numbers, say an order was input and it has 10 lines (10 different items on that particular order) this order is showing 10 times on this report, so what i want really is the report to only show 1 line for each order, as i dont need any order detail apart from the order date, order number and the user who input it. any help would be much appreciated.
Regards
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 30 Jul 2007 at 10:55am
I am not certain how your report layout is designed.But add a group level for the order and suppress the group details and footer for that group level. Each order will show once regardless of the number of items.
 
Another way is to limit the order number to Distinct, so they will only show once and not multiple times. You should be able to do this  in the data query as well as on the report.
 
I hope this helps
 
Regards,
 
John W.
 
IP IP Logged
nathchris
Newbie
Newbie
Avatar

Joined: 29 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote nathchris Replybullet Posted: 31 Jul 2007 at 1:48am
Thanks John for your reply, but im a bit of a beginner on Crystal, could you advise on how i would do any of these ideas? i tried 'supress when ducplicated' for the order number, and although this does do the job by only showing each order number once, it still recognizes there are multiple lines, and instead of showing the ducplicate order number, there is a blank, until the next line with a new order number if you know what i mean!
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 31 Jul 2007 at 11:16am

As far as I'm concerned we are all newbies - that is still learning this stuff; so let's see if I can be a bit more useful in my explanatio of  the choices:

----------------------
You can use a command object (DataBase Expert - connection - new Command). This is where you can put an SQL Select statement. You can use the  SQL Keyword 'Distinct' in it. There are thousands of samples on the internet, but it might look something like this.

Select Distinct(Order), date from OrderTable

You can also find a reference in the CR Help - Index - type in Distinct Clause
----------------------------------------------

From the CR Help you can use this command found under the database menu

Use the Select Distinct Records command to refine your report's SQL query and prevent it from returning duplicate records from the database.

When this command is enabled, SQL SELECT statements are treated as SELECT DISTINCT statements. Consequently, the query looks for identical records and ensures that they are returned only once. (To be considered identical, records must match completely—not just one or two fields.)

This command is only available for ODBC, OLE DB, and SQL native drivers; it is not available for Stored Procedures. Note also that your server may automatically sort returned values if no sort is specified in Crystal Reports.

-----------------------------------------------------

Often times I find it useful to use grouping as a way to control the data. A report design might look like this.

Report Header
Pager Header
Group HeaderA - ClientName
GroupHeaderB - OrderNumber Order Date Order Amount DateShipped *****Doing the grouping will insure the Order only shows once, the next Order will be a new group. Yo can also move this to the GroupFooter B suppress the header instead of the footer. This can be useful if you want to use the details in some way.
Details - Suppress if not needed but left in case I need, for example, to show OrderItems
GroupHeaderB - Suppress unless needed
GroupHeader A - Suppress unless needed

----------------------------------------

Finally while I have not tried this, it might be a perfect use of an SQL Expression putting something like 'Distinct Order'
-----------------------------------------
 
Hope this helps

Regards

John W.
www.CustomReportWriters.net

IP IP Logged
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.032 seconds.