Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to suppress New Page when unwanted first record 1

Status
Not open for further replies.

WaukMyWay

Programmer
Apr 20, 2007
29
US
I am having a problem with preventing a new page from printing in Crystal Reports 10. This was not created from a template since it is specific to our use. We actually print two of the same labels on the same page (letter size). We call them labels for their purpose.

I only need the positive quantity labels to print – seems simple enough!

The idea is print a label when moving one part from one location to another. The Control ID# is from the work table built via the label print program. This Control ID# is main parameter which I must receive in order to get the values from the work and transaction history tables to print the label information.

The Control Rec# is from the Record Number within Crystal Reports.
The Trans Rec ID# is the record number of the transaction history record. It is found in the work table only.

When the user selects to print the label, the Control ID# is passed to Crystal Reports. This is the only link I have to the work table. The program itself creates 2 separate transaction history records. The first record is always the "FROM" location, which will always contain a negative quantity. The second record is the "TO" location and contains a positive quantity. The records are always in negative, then positive quantity order. Also, the Trans Rec ID# is in ascending sequence. The negative record is the ghost record - the one I do NOT want to print, nor have a blank page for.
NOTE: Each time the label is to be printed, there are two more records created in the transaction table.

Here is a list of what I have tried, by itself and/or in conjunction with the others:

- in the Record Selection, I have tried selecting just the positive quantity, which will give me a leading blank page
- suppressed the Report Header
- conditionally suppressed report header - always prints blank page at beginning (see Example #2)
- conditionally suppressed detail (this works fine as in Example #2)
- sorting records in descending order by quantity
- sorting records in descending order by Trans Rec ID#
- grouping by Trans Rec ID#
- grouping by quantity

Whenever I try to suppress the printing of the negative quantity label, it always prints as a blank page. Is there a way to keep it from doing this? Is there something I can do that I am missing?

I only need the positive quantity label to print without any extra blank labels!

The examples can be found in the attachment folder. They are Label 1 and Label 2.
Label 1 shows the printing of the negative quantity labels.
Label 2 shows what happens when I try to suppress the negative quantity labels from printing.

 
If you use conditional suppression on the section, you should also check "suppress blank section" in the section expert.

Alternatively (and the best approach), record selection to limit to positive values should work, but I'm guessing you have "new page before" set on the section, and you would need to add a conditional formula to that:

not onfirstrecord

-LB
 
Unfortunately, LB, I have tried all of your suggestions, but to no avail. There must be something I have overlooked.
Anyways, thank you for trying to help, I appreciate it!
 
Please explain what report sections you are using and how they are formatted in the section expert. Show the content of suppression formulas or the selection formula if you are using that approach.

You really should be able to make this work fairly simply.

-LB
 
Let me begin with letting you know that after I add the test for only selecting positive values in the Record Selection and run the report, I always have a window popping up from Crystal, "No data has been found for your selection criteria.". This comes up before the label(s) print. I am wondering if this is what could be part of clue as to what is causing the blank page to print at the beginning.

I am using the detail sections, A & B. They print only if there is a positive value (added only to the suppression for Details - not for Detail A or Detail B). I do not see any problem here. The test on suppressing these sections are:

If (IsNull({TransRec.Qty})
Or
{TransRec.Qty} < 1.0
Or
{Part.Product} <= " "
Or
Not OnFirstRecord
)
Then True
Else False;

I suppose this test is a little bit of an overkill factor, but I am open for other suggestions.

As for Report and Page Headers/Footers, I have the boxes checked for Suppress, Keep Together and Suppress Blank Section.

It's pretty straight forward except for the test above.

Even sorting in descending sequence does not change order of the print when printing both positive and negative value labels. This just might be something peculiar between our software package and Crystal Reports 10.

If you need anything, please let me know and I will see what I can do. Thanks, LB!
 
Are you really just intending for one record to print per report?

In your sample, you show two pages (before suppression/selection), with two negative values, followed by two positive ones. So before suppression, do you have two records that are printing like this?

//record1
det_a -1
det_b -1

//record2
det_a 1
det_b 1

If so your suppression formula could just be:

IsNull({TransRec.Qty}) Or
{TransRec.Qty} < 1.0 or
trim({Part.Product}) = ""

Leave out "not onfirstrecord" as that will suppress all but the first record.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top