Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Label total count wrong Post Reply Post New Topic
Author Message
CircleD
Senior Member
Senior Member
Avatar

Joined: 11 Mar 2011
Location: United States
Online Status: Offline
Posts: 251
Quote CircleD Replybullet Topic: Label total count wrong
     Posted: 21 Mar 2011 at 2:58pm
I'm working on a custom shipping label and have got most of it done,however, I'm having trouble getting the correct box count to print.This formula works somewhat but it always comes up with 3 boxes when I need (in this case) only 2.:

Whileprintingrecords;
Stringvar sss;
sss := totext(Count({RWSHPLAB.CARTON_TOT_COUNT}));
sss;

I tried to get the correct count by adding this:

Count ({RWSHPLAB.CARTON_TOT_COUNT}) = ({JJ10_FORMS.QTY_MFG}  / {JJ10_FORMS.BIND_PACKING});

Tre problem is anywhere I insert this I either get a boolean needed error after the = or I get the doesn't look like part of the formula warning.I tried to sub and then define x/y but it gives me the ) is missing error.Any suggestions would be appreciated.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 22 Mar 2011 at 3:15am
are you trying to assign a value or are you trying to compare values?
 
it looks like you are comparing values, as you cannot assign a value to the Count().
IP IP Logged
CircleD
Senior Member
Senior Member
Avatar

Joined: 11 Mar 2011
Location: United States
Online Status: Offline
Posts: 251
Quote CircleD Replybullet Posted: 22 Mar 2011 at 12:57pm
I guess it would be comparing values.What I'm trying to do is get the total carton count to print correctly.Right now no matter what the quantity or how many is in the carton it prints 3.Everything else except which job to pull from is working fine.It seems to default to 3 cartons and 1 certain job but i haven't worked on getting the job right yet.That's next.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 24 Mar 2011 at 3:12am
if you are comparing values then the formula would look like:
 
if (comparison logic) then
  do something
else
  do something else
 
at least one would think.  What you formula is doing is returning true or false, which is ok (depending on where it is and what you want), but I don't think that this is the case...from the post it would seem that you want some out come if the values match as opposed to if they don't, but we don't know what that is.
IP IP Logged
CircleD
Senior Member
Senior Member
Avatar

Joined: 11 Mar 2011
Location: United States
Online Status: Offline
Posts: 251
Quote CircleD Replybullet Posted: 24 Mar 2011 at 3:10pm
What's happening and what I'm trying to correct is on my shipping label, for some reason I'm getting a total count of 3 cartons when ,in this case ,it should be 2. I was trying to divide the "Total to manufacture" by the "Carton Quantity" and force it to show and then print the correct number and correct number of labels.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 25 Mar 2011 at 3:59am
alas, it doesn't work that way.  CR prints the number of records that it sees.  If it sees 3 records, it will print 3 records.  You might be able to suppress the printing of a record, but you would need to know which record you are on, since you do want the first 2 records to print.  If CR is printing short (you need 3 but CR is only producing 2 records) there is very little that you can do.
 
Using a stored proc allows you better control over the number of rows needed.  You can also try joining the values to table of numbers...
 
Say you have a table that looks like:
1
2
3
4
5
6
7
 
you can create a command object that does something like:
select * from tableWithInfo Full join numberTable
where numberTable.value <= tableWithInfo.numberOfLabels needed
 
This will multiply the number of records that you need to the proper amount, then CR will print 1 label per record.
 
HTH
 
IP IP Logged
CircleD
Senior Member
Senior Member
Avatar

Joined: 11 Mar 2011
Location: United States
Online Status: Offline
Posts: 251
Quote CircleD Replybullet Posted: 29 Mar 2011 at 2:04pm
Thanks for the help.I found out today what the main problem is.Since we are in test mode with this database, parts haven't been activated as yet and this is one of the areas.It would have been nice to know 3 weeks ago and saved me a lot of headaches.
IP IP Logged
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