Too Many Arguments for this function creating 2d bar code formula

I am getting the error "too many arguments for this function" on the NumberVar Segments =IDAutomation...in the formula below.  It works properly if I use a string input in place of the table/field references.  Any ideas appreciated.

stringVar DataToEncode:= {SO_PackingListWrk.ItemCode} + " " + {SO_PackingListWrk.AliasItemNo} + " " + {SO_PackingListWrk.LineNumber};  //{Table1.Field1};
stringVar CompleteBarcodeString:="";
numberVar i:=0;
numberVar Segments:= IDAutomationDataMatrixEncoderDMGet(DataToEncode,0 ,0 ,0 );
For i:=0 to Segments Do
(
CompleteBarcodeString := CompleteBarcodeString + IDAutomationDataMatrixEncoderDMGet(i);
);
CompleteBarcodeString
dmac47Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
SInce I don't know the function try this.

Add this formula to the detail section and review the values.

 {SO_PackingListWrk.ItemCode} + " " + {SO_PackingListWrk.AliasItemNo} + " " + {SO_PackingListWrk.LineNumber};  

Are there any that are "different".

mlmcc
0
James0628Commented:
I'm not familiar with that function either, but it seemed odd to me that you were using the same function with two very different sets of arguments -- (DataToEncode,0 ,0 ,0 ) and (i).  And you're using the results from that function in very different ways -- As the numeric value for Segments in the first case, and as a string in the second.

 So I did a Web search and it looks like you got the name wrong for the first function.  Looking at this page

http://support.idautomation.com/Data-Matrix/How-to-create-Data-Matrix-Barcodes-in-Crystal-Reports-with-fonts/_614

 The first function (used to set Segments) should be
IDAutomationDataMatrixEncoderDMSet

 You used
IDAutomationDataMatrixEncoderDMGet  (Get, instead of Set)

 So, you presumably need to change the line to

numberVar Segments:= IDAutomationDataMatrixEncoderDMSet(DataToEncode,0 ,0 ,0 );

 James
0
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Change
stringVar DataToEncode:= {SO_PackingListWrk.ItemCode} + " " + {SO_PackingListWrk.AliasItemNo} + " " + {SO_PackingListWrk.LineNumber}; 

Open in new window

to
stringVar DataToEncode:= {SO_PackingListWrk.ItemCode} + " " + ToText({SO_PackingListWrk.AliasItemNo},0,"") + " " + ToText({SO_PackingListWrk.LineNumber},0,""); 

Open in new window

Explanation: when Crystal concatenates a number into a text string, it has to first convert it to a string. By default, it adds thousand separator (comma) and 2 decimals.  The Comma is triggering the error. Using ToText() gives you control over the number-to-string conversion. The suggested syntax above specifies zero (0) decimals and no thousand separator ("").
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
James0628Commented:
Ido,

 You could be right, although the fact that he's using + to concatenate the fields, instead of &, indicates that the fields are already strings.

 Either way, he appears to be using the wrong function in the first instance.

 James
0
James0628Commented:
FWIW, I don't think Ido's post was a solution.  As I mentioned before, the fact that the OP was using + to concatenate the fields, instead of &, indicates that the fields were already strings.  If so, Ido's point about how CR converts numbers to strings doesn't apply.

 I think the error was because the OP was using the wrong function name in that line (as described in my earlier post), although that is just a guess.

 James
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.