Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Data Field causing multiple prints Post Reply Post New Topic
Author Message
alfredsf
Newbie
Newbie


Joined: 07 Aug 2013
Online Status: Offline
Posts: 3
Quote alfredsf Replybullet Topic: Data Field causing multiple prints
    Posted: 07 Aug 2013 at 7:34am
Hi,

Thank you letting me join the forum. I am having an issue with a table that the two fields that I use to select the needed data, bring back a result for the "reference" field having various kinds of data available. In this example will say I get 2 rows of data were the "reference" field/column has different numbers.

When I use that field into the report, it prints multiple pages because that field alone has more than 1 row of data. Since there is no differentiating factor other than the "reference" field information, how can I have the report just select the first random field to display, then ignore the rest?

company_id    warehouse_id    invoice_number    reference

abc                  USA1                   I8045760             0000528439

abc                   USA1                   I8045760           634966131341215125.7344.3265786@BTKAPPP02



Edited by alfredsf - 07 Aug 2013 at 11:09am
IP IP Logged
alfredsf
Newbie
Newbie


Joined: 07 Aug 2013
Online Status: Offline
Posts: 3
Quote alfredsf Replybullet Posted: 07 Aug 2013 at 11:12am
Rephrased:

The report is setup to run from three parameter fields "Warehouse ID", "Company ID" and "Invoice Number". The problem is that as you see from the original post because there are two rows matching the same information from the parameters, the system then runs 2 pages, each reference number showing on its own page.

 

Problem is that this data has 2(in actual tables there can be 10s) reference numbers and I just need the system to select 1, then ignore the others listed. It sounds like a very silly question/issue, until I went to fix it and hit the wall.

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 08 Aug 2013 at 4:47am
The question that comes to mind is, what is in the details?

For the detail section of the report, do you need to see different data...like part numbers on an invoice, or would the reports for the multiple records be identical?

If they are identical, consider moving the 'report' to a group header or footer, as these only print out once per group, and suppress the detail section.

If you are using a stored proc to gather the data for the report, you could do the final select as a SELECT DISTINCT.

Hope one of these is useful for you.
IP IP Logged
alfredsf
Newbie
Newbie


Joined: 07 Aug 2013
Online Status: Offline
Posts: 3
Quote alfredsf Replybullet Posted: 08 Aug 2013 at 7:35am
The details section has product name, qty and other information which displays as a line for each product. I created a rpt for it in the details section.

Anyway to do a SELECT TOP 1 like in SQL?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 08 Aug 2013 at 10:47am
top 1 won't work if you have 2+ different records that you want to see.

you could also try suppress if duplicated...though I have only used that in the detail section and not the grouping.

Usually, SELECT DISTINCT is the 'simplest' way to go, I would think
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.031 seconds.