Print Page | Close Window

Print repeated

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=6155
Printed Date: 03 May 2024 at 2:41pm


Topic: Print repeated
Posted By: nalfein
Subject: Print repeated
Date Posted: 22 Apr 2009 at 6:53am
Hello all

I've a proble while printing a report
I'll try to explain as good as I can because the situation is complicated

So in the report I print

Order number (A) / Amount of delivery dates (i.e. if in the order X we've to deliver goods in April and May Cr will print 2) (B) /Client (C) /Delivery date (E)

Field B have this code:

DistinctCount({lines_document.date_delivery})

Field E is {{lines_document.date_delivery}}

My problem is as follow: if in the report i will put fields B or E (one of them is enough) CR will print every single line of the order

Basically if an order contains 5 lines (no matter if they're all delivered at the same date) the report willcontain 5 lines printed (one exactly as the another)
There's a code that says to CR go inside the order, count how many delivery date and print just one each type of them?

I believe that if exist there's a code to insert in fields B and E but what?

P.S.
There's no another field that i can use to print delivery date i must use that above

Thank you in advance for answers



Replies:
Posted By: DBlank
Date Posted: 22 Apr 2009 at 7:27am

You can conditionally suppress the rows or the fields and then the rows on empty depending on exactly what you need. I can't quite figure out your set up and what is duplicating or when you want it to appear or not but here is a process that you may be able to use or tweak.

In each field you can suppress if duplicated (means if the previous record had the same value in this field). Right click on the field and select Format Field, click on the Common tab and check the Suppress if Duplicated box.
Now in the Section Expert, assuming this is on your details row, select details and check the Suppress Blank section.
If all the fields are suppressed because of the previous option then the row will be suppressed also.
if this does not work can you explain the problem and data further or post data examples?


Posted By: DBlank
Date Posted: 22 Apr 2009 at 8:29am
In versions X and XI it is under Report Menu > Section Expert or the icon of a hand grabing a line inside a piece of paper.


Posted By: nalfein
Date Posted: 22 Apr 2009 at 11:47pm
Ok almost at the goal

The print now is

Ord. number-- Amount of Delivery date --Client-- Delivery
1234    --     2        --             John-- 20-May
                                               21-May
                                               20-May

As you can see there's 2 problems yet

1)
If i check "Suppress if duplicated" i cannot se the number, amount, and name client on the second row and i need to see those data

2)
The "Suppres if duplicated" can only check the previous cell but i need that if a record is printed one time it cannot be printed anyway also if is 4 cells away. As you can see in the field delivery I have two same date because of that

I hope that I've been clear enough

Thank you in advance


Posted By: lockwelle
Date Posted: 23 Apr 2009 at 6:17am
if you only 1 record to display per unique situation, you might try printing the group footer and suppress the detail section all together, this way regardless of the number of items in the order, only 1 row will print on the report.
 
Hope this fits the requirements.


Posted By: DBlank
Date Posted: 23 Apr 2009 at 7:27am

After seeing your data I would agree with lockwelle that you could handle this by grouping on the Ord NUmber then a second group on the date.

Place all the fields you want to see on the GF2 and suppress everything else.
Otherwise you can sort by ord number, and then on date and decide what your conditions are that you you want to see or suppress the record based on what is in the pervious record and then use that logic as a conditional suppress.


Posted By: nalfein
Date Posted: 23 Apr 2009 at 8:19am
Originally posted by DBlank


Place all the fields you want to see on the GF2 and suppress everything else.



Done but worst than before now i can only see one line. Just one and no more. Also if i've 2,3,4,5 delivery date in one order I can see only one row


Posted By: DBlank
Date Posted: 23 Apr 2009 at 9:07am

How did you suppress these?

You would need to suppress the items then "suppress blank sections" except for what is on GF2. Cannot use Hide drilldown OK or Suppress No drill down.


Posted By: nalfein
Date Posted: 23 Apr 2009 at 11:03pm
Originally posted by DBlank

How did you suppress these?


You would need to suppress the items then "suppress blank sections" except for what is on GF2. Cannot use Hide drilldown OK or Suppress No drill down.


I've just created a Group, put the fields in group footer and in each field i've checked Suppress if duplicated

Just this nothing else but i can see always just one row
I think that i'm near the solution but grrrrr   

Thank you for answers


Posted By: DBlank
Date Posted: 24 Apr 2009 at 8:29am

You want your sample data of:

1234    --     2        --             John-- 20-May
                                               21-May
                                               20-May
To look like
Ord#    Amount   Client    Delivery Date
1234         2          John     20-May
1234         2          John     21-May
Correct?
You should not use the suppress if duplicated.
Create group 1 on  Ord#: suppress the field then suppress the section as Suppress blank section.
Create a group2 on Delivery date (set per day). suppress the field then suppress the section as Suppress blank section.
Suppress the Details.
Place the ID#, Amount, client name and date fields on GFooter 2. Do NOT conditionally suppress any of these fields.
Suppress GF1 as Suppress blank section


Posted By: nalfein
Date Posted: 27 Apr 2009 at 7:27am
This is exactly what I've to do

I'll try and let you know


Posted By: nalfein
Date Posted: 27 Apr 2009 at 8:10am
Sorry when you say


Create group 1 on Ord#[...]


You mean that i've to go to insert > group and after place the field Ord# in the group header that i've just created?
This is what you mean?


Posted By: DBlank
Date Posted: 27 Apr 2009 at 8:17am

Close...When you go to insert group, select the ORd# as the field to group on.

Crystal will automatically insert a field called group #1 name (this is basiocally the ORD# field). You do not have to palce the ORD# on this header. Now right click on this Header field and go to common tab and suppress it. Now suppress the Header 1 in the Section Expert as "Supress blank section"
Continue to follow the rest of the other instructions


Posted By: nalfein
Date Posted: 28 Apr 2009 at 7:57am
Ok all works fine but only if I print one order at a time

When I print i.e. from order 1234 to order 1236 from my program linked to CR all is a mess due to the delivery date.
If one order have 2 delivery date and one not it will print for both orders two rows and the delivery date are also the same for all orders printed regarless the difference in each order

Order 1234 delivery date 2 may
Order 1235 delivery date 3 may / 4 may will result in a 4 row print with order 1234 delivery date 3 may / 4 may and order 1235 delivery date 3 may / 4 may

It seems that he's taking the last delivery date regardless of each delivery date of single order but not sure

I hope that I've explained exactly the situation if you need more info please feel free to ask

Thank you again   


Posted By: DBlank
Date Posted: 28 Apr 2009 at 8:37am
Did you create a second group on the deliverdate field and place the items on groupFooter2 and suppress the details (no data on the details line at all)?
What I am trying to do is first group on the Order ID#. This will keep all of these records together. UNder hat you group on the Date keeping all of the together for each. YOu only want to display the inforamtion once so you can use the group footer for the second grouping to do this.
Example data:
Order #       Delivery Date   Client  Amount
1234            1-2-09              John        3
1234            1-2-09              John        3
1234            1-3-09              Jane        3
1235            1-2-09              John        3
1235            1-3-09              Mary        3
1237            1-3-09              Mike        3
Grouped on Order date then Date looks like:
GH1 - 1234
    GH2 - 1-2-09
         Details     1234            1-2-09              John        3
         Details     1234            1-2-09              John        3
    GF2   1234            1-2-09              John        3
    GH2   - 1-3-09
         Details     1234            1-3-09              Jane        3
     GF2     1234            1-3-09              Jane        3
GF1
GH1-  1235 
    GH2 - 1-2-09
         Details     1235            1-2-09              John        3
     GF2     1235            1-2-09              John        3
    GH2 - 1-3-09
         Details     1235            1-3-09              Mary        3
     GF2     1235            1-3-09              Mary        3
GF1
GH1-  1237 
    GH2 - 1-2-09
         Details     1237            1-3-09              Mike        3
     GF2     1237            1-3-09              Mike        3
GF1
By placing the feilds on the group footer 2 you will get the first record from your details in that double grouping. The rest of it all needs to be suppressed (marked in RED) to get rid of duplicate presentation of information and make it all appear on one line. Is this how you have it set up and does this clear it up for you?


Posted By: nalfein
Date Posted: 29 Apr 2009 at 7:45am
I've done exactly what you've said

What you have said is exactly what I need but S H I T (sorry mods) the problem is the same

I.e. I have ord 1234 delivery 1-2-09 and ord 1235 delivery 1-3-09 and 1-4-09 the result is

Order #       Delivery Date   Client Amount
1234            1-2-09              John        3
1234            1-3-09              John        3
1234            1-4-09              John        3
1235            1-2-09              Mary        3
1235            1-3-09              Mary        3
1235            1-4-09              Mary        3

Instead of

Order #       Delivery Date   Client Amount
1234            1-2-09              John        3
1235            1-3-09              Mary        3
1235            1-4-09              Mary        3

It seems that he's taking the last delivery dates and auto assign to all orders printed regardless of their own delivery dates

You are so polite and sorry for boring but really I dunno what to do now
Thank you again


Posted By: DBlank
Date Posted: 29 Apr 2009 at 9:31am
This looks more like a data join problem.
Are you pulling from more than 1 table? If so, how are you joining the tables? Looks to be more on a date then a primary key...
If that is not the case, can you post a few sample lines of the raw data with all collumns. Maybe I can tease it out from there because I do not see why it is doing waht it is absed on your other sample data.
Thanks


Posted By: phimtau123
Date Posted: 29 Apr 2009 at 4:24pm
Hey this is a problem that I've been facing for a while too and cant seem to find a way to fix.  May I email you a screen shot of my report output and maybe you can guide on how to fix?


Posted By: nalfein
Date Posted: 29 Apr 2009 at 11:33pm
Originally posted by DBlank

This looks more like a data join problem.
Are you pulling from more than 1 table?


Yes I am pulling all data except delivery date from one table and delivery date from another


If so, how are you joining the tables? Looks to be more on a date then a primary key...


I dunno exactly what you mean I've created a new file and in the Database Expert I've choosen Create new connection > Access / Excel and I've selected my Access DB, then from that the 2 table that i need. Is that what you mean?


If that is not the case, can you post a few sample lines of the raw data with all collumns.


Again dunno what you need. Need you a row of two Access tables?

Thank you again


Posted By: DBlank
Date Posted: 30 Apr 2009 at 7:13am
When you put two tables into your report you should join the tables. Usually you would do this on a primary key. Crystal will also often auto-join the tables if it can find like column names or shared keys between the two tables.
Go into the Datbase Expert. If there is more than one table in you report you will see a LINKS tab. Click on it. You will get a visual representation of the 2 tables and there may or may not be a black line (or many lines) connecting the 2 tables.
In here make sure you only have a sinngle link between the 2 tables on a primary key. Most likely it will be Order#.



Print Page | Close Window