Hello,
We are trying to concatenate Reference Designations in crystal reports to print in one field on a label. One part can be used in multiple areas on a PC board designated by a reference designators (R1, R2, R5, etc)
We are trying to print a single label and have them all in one field. Our BAQ comes back with a result and we need to code that into crystal. Can you guys help with the code? Thanks Everybody!!
Check this resource out
I’m assuming your using the PartMtlRefDes table?
Without knowing more about your BAQ Report, I’m thinking you might be able to use a formula to build a string as your records are parsed in Crystal. (And add a reset formula to clear the string when necessary).
//e.g. a main formula to keep adding field(s) to a string
whileprintingrecords;
stringvar myRefDesig;
myRefDesig := myRefDesig & {BAQReportResult.xxx};
//and a reset formula - e.g. changing groups, parts, etc…
whileprintingrecords;
stringvar myRefDesig = “”;
I’ve found a lot of good examples on http://www.tek-tips.com too.
You could try searching the forum for Business Objects: Crystal Reports 1 Formulas
Yes, I think a whileprintingrecords formulas will work.
Before I try reinventing the wheel… why not look at this post & see if it makes sense
Let me know if you have trouble though…
Hopefully just plug in your fieldname(s) like this…
myRefDesig := myRefDesig & {BAQReportResult.JobMtlRefDes.RefDes};
Note how the Tek-Tip example (better) includes delimiters between each values and describes section placement in the report.
Unfortunately that didn’t work. The labels get printed the same way, each Ref Des on a single label.
I didn’t think that it will be that hard to figure out.
Do you have any grouping in Crystal (or a subreport)?
e.g.
Group by JobNum
Group by AsmSeq
Group by MtlSeq
- detail lines hidden — formula RefDes detail - add to string
- detail lines hidden — formula RefDes detail - add to string
etc…
Display/print at a Group footer level - to display the final string… and any other fields you need
If you just put the formula in detail lines… probably why you’re still seeing one label for each RefDes
Ref screen shot below - lines in grey would normally be hidden =- I display only so you could see what is going on.
Note formula examples from TekTips with some minor adjustments
//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar x := x + trim(totext({BAQReportResult.JobMtlRefDes.RefDes}) + “-”);
//{@display} to be placed in the group footer:
whileprintingrecords;
stringvar x;
if x > “” then
left(x,len(x)-1);
//{@reset} to be placed in the group header:
whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := “”;
Will this work the same if we are trying to create 4ich by 2inch label?
Yes, same for labels…
Labels can be a little tricky to get set up in Crystal though.
Page layout settings vary between versions of Crystal - where I think CR XI or earlier, is a pain.
Different label printers/drivers can be a little “interesting” sometimes too.