Solved

Crystal report - counter question

Posted on 2014-11-21
19
301 Views
Last Modified: 2014-12-16
I have a crystal report that shipping will input the same item number as a parameter, when the report runs it only show that I enter the item number once.  I like to have a counter that would show the number of time the same item number was entered in on the parameter screen?
0
Comment
Question by:Scott Johnston
  • 11
  • 5
  • 2
  • +1
19 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 40458540
I don't understand what you are saying.

Are you entering one number or is it a multiple value parameter and you are entering 1234 twice?

mlmcc
0
 

Accepted Solution

by:
Scott Johnston earned 0 total points
ID: 40458590
I sorry but it confusing, I scan a upc code into the Parameter field #1  "12345678" scan value,  Parameter field #2 "222222222"  Parameter field #3 "12345678".  When the report runs I only see the parameter for field #1 and Field #2, for some reason the field 3 will not print on the report?

I seems to see the values as the same and not unique to the lookup?

Does that make any sense?
0
 

Author Comment

by:Scott Johnston
ID: 40458648
My goal is to create a manifest for a pallet that has 28 - 6 gallon boxes on the pallet.  Each box on the pallet is labeled with a UPC code, we want each box to be scanned.  If the pallet has every box the same then when I have scanned a UPC code into a parameter field I was hoping to get 28 line in my report, but I only get 1 line with the UPC code for the Item, not 28 line on the manifest.  For some reason crystal combines all the lines in a parameter into one lookup in the report?
0
 

Author Comment

by:Scott Johnston
ID: 40458668
I all most got is to work correctly using 28 Detail selects, but because the item code is not unique it pull all records from the database,.  I've tried something to test my situation and I created a formula the formula was like this....
UPC Code = ["12345678", "12345678", "12345678", "12345678"]

UP code = {?Scan 1} or UPC Code = {?Scan 2} or UPC Code = {?Scan 3} or UPC Code = {?Scan 4}

even thought I have 4 different entries when the report runs it only display the record once, If the scan are all different the report works fine......I probably am trying to do something in a wrong order that is why I posted the question?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40458893
How many parameters do you have in the report?
Seems like you need 28 if you have 28 cartons.

Are you using a command for the report or did you connect to the tables?

I have a couple of ideas but they depend on how you are getting the data from the database.
I also need to check if you can count the parameter values.

mlmcc
0
 
LVL 34

Assisted Solution

by:James0628
James0628 earned 400 total points
ID: 40459307
even thought I have 4 different entries when the report runs it only display the record once, If the scan are all different the report works fine......I probably am trying to do something in a wrong order that is why I posted the question?
As I understand your situation, you're not really doing anything in the "wrong order".  CR displays each record once, because it only reads each record once.  Testing for the same value multiple times doesn't force CR to read or "process" a record more than once, or anything like that.

 I assume that the tests that you mentioned are in the record selection formula?  Using your example, if you have a test like (UPC code = {?Scan 1} or UPC Code = {?Scan 2}), and {?Scan 1} and {?Scan 2} have the same value, then when UPC Code matches that value, the test just evaluates to (True or True), ie. True.

For some reason crystal combines all the lines in a parameter into one lookup in the report?
That's basically correct, but, more specifically, CR doesn't really do a "lookup".  If you enter a series of conditions in the record selection formula, CR doesn't look for any records that match condition A, and any records that match condition B, and so on.  It reads each record once, and only keeps the ones that match all of the conditions.  Technically, if possible, CR will send the conditions in the record selection formula to the db and let it handle it, but the result is the same.


 Hopefully that gives you a better idea what's going on.  Now, what, exactly, are you trying to do?  Do you have one detail record that you want repeated 28 times, with a different parameter value on each line?  Or do you want to read the records that match the parameter values, but repeat the detail section once for each time a value is included in the parameters?  Or something else?

 James
0
 
LVL 22

Assisted Solution

by:Ido Millet
Ido Millet earned 100 total points
ID: 40460605
Clone the detail section several times.
Control the suppress property of Detail b so it shows only if the Product is detected in the parameter more than once.
Control the suppress property of Detail c so it shows only if the Product is detected in the parameter more than twice.
etc
0
 

Author Comment

by:Scott Johnston
ID: 40494550
Guys thank you for all the comments, i got dragged into another problem for the past few days,  MLMCC your right i will end up with 28 entry field, but not all will be used.  James i appreciate the understanding of the situation but it did not give me a solution.
IDO I going to try what you explained.  I kind of thought something like that might work as well.

I update everyone on the outcome?
0
 
LVL 34

Expert Comment

by:James0628
ID: 40494737
No, I didn't offer a solution, because I'm not sure what you're trying to do.  It sounded like you might be misunderstanding some basic things about how CR works (you wouldn't be the first), so I thought I'd try to explain.  And then, with you maybe understanding things a bit better, I asked for more information about exactly what you're trying to do.

 James
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:Scott Johnston
ID: 40494768
IDO, I have a question, what formula would I use on the detail records.  Something like this:
If Scan 1 = Scan 2 or Scan 1 = Scan 3 or Scan 1........and so?
0
 

Author Comment

by:Scott Johnston
ID: 40494786
James, my goal is to have products manifested and then printed.  Each Item Bar code is scanned into a parameter field to run the report, because of the situation we are discussing each parameter is not unique, so it only displays one record for each duplicate item on the manifest.  My goal is to either have every item print on the sheet even if duplicated or add a counter and then display the quantity of time a item was scanned into the parameter of the report.
Hope that clears up my issue....
0
 
LVL 34

Assisted Solution

by:James0628
James0628 earned 400 total points
ID: 40494799
Do you have a separate parameter for each value, or a single parameter that allows multiple values?  It sounds like you have separate parameters.

 If you have separate parameters, the simplest thing would be to create a separate copy of the detail section for each parameter, and use {field} <> {?Scan X} to suppress the detail sections ({?Scan 1} for the first detail section, {?Scan 2} for the second, and so on).  Then the detail section would be repeated once for each matching parameter.

 James
0
 
LVL 34

Expert Comment

by:James0628
ID: 40494808
I wrote my last post before your last post.

 I noticed that you mentioned a counter before.  You could do that too.  It wouldn't be difficult to have a formula look at all of the parameters, or the list of values for a multi-value parameter, and count the number of matching values.

 James
0
 

Author Comment

by:Scott Johnston
ID: 40494867
James, that is correct separate parameters for each scan..I'm working on trying the solution using with the details records.
I let you know if I run into any problems...
0
 

Author Comment

by:Scott Johnston
ID: 40494951
I knew I tried this already, i have another problem with this, when i scan a bar code I scan in the check digit and the UPC number, but the comparison field(ALready storedon aother database) has already removed the check digit and so the field that are being compared are not the same.
The bar code scan it the problem, any idea on how to scan a bar code and in crystal strip off the check digit characters?
Does this make sense?  If not I try to explain it in more detail...
0
 

Author Comment

by:Scott Johnston
ID: 40494973
I got it, I had the wrong UPC fields being compared in the report.  I better slow down...I make stupid mistakes then..
0
 

Author Comment

by:Scott Johnston
ID: 40494991
James thank you, works perfectly now!!!
0
 
LVL 34

Expert Comment

by:James0628
ID: 40495035
You're welcome.  Glad I could help.

 James
0
 

Author Closing Comment

by:Scott Johnston
ID: 40502246
Very helpful, and patient with my communication.

THANK YOU
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
A short article about problems I had with the new location API and permissions in Marshmallow
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now