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!

Splitting text from memo field into report 1

Status
Not open for further replies.

madvalpreston

Technical User
Apr 7, 2011
142
GB
Hi

Not sure how to go about this one

We have a table called memo and in here is a text area to add data.

What we have is for example

1804
51630
L677

On the report I want it like this

Die No: 1804
Lot No: 51630
Heat no: L677

What I can work out is how to extract the information.

Line 1 (no matter how long will always be Die No) Line 2 always Lot No etc...... but the lenghts may differ.

Could someone advise how I program this please

Thanks
 
if the next set of data always starts on a new line you can use the split function with either a carriage return or line feed (depending on which was used)
you would need a formula for each value.

i do not have crystal in front of me, but something like this:
//{@DNo}
"Die No: " & Split(totext({table.memo),chr(13))[1]

//{@LNo}
"Lot No: " & Split(totext({table.memo),chr(13))[2]

//{@HNo}
Heat No: " & Split(totext({table.memo),chr(13))[3]

 
Create a formula like this:

stringvar array x := split({table.memo},chr(13));
if ubound(x) >= 3 then
"Die No: "+x[1]+chr(13)+
"Lot No: "+x[2]+chr(13)+
"Heat No: "+x[3]

-LB
 
Hi

Thanks for the replies. presently having problems linking tha tables but once I do I will try your suggestions..

I have noticed after querying the table it appears to store it in one length field.

Assuming this will be the case and the lenghts would always be the same, how do I split the field.

Thanks
 
Hi Lbass

I have entered your formual and it works , however, and sorry for not explaining to good

Yours comes in as

Die No: 1804
Lot No: 51630
Heat no: L677 which is how I explained. However the lable the information will populate is set out abit like

Part num : 12345 Job Num: 170545

Die No: 1804 lot No : 51630

Heat No: L677

is this possible 9perhaps using the already named text boxes in the report. because it is a lable it is important to try and get it as per the layout.

Thanks
 
You can replace selected returns chr(13) with tabs chr(9) or with spaces " ". It looks like you have more than three elements, but it sounds like you figured out how to adjust the formula.

fisheromacse,
I didn't see your post--we posted simulanously!

-LB
 
Hi

I will try in the morning at work. I dont quite understand your suggestion...

The Part Num and the JOB No come from fields it is just the Die, Lot and Heat. So going by your example if I ahve this


stringvar array x := split({memo.memotext},chr(13));
if ubound(x) >= 3 then
"Die No: "+x[1]+chr(13)+
"Lot No: "+x[2]+tabchr(9)+
"Heat No: "+x[3]

Would this give me

Die No: 1804 lot No : 51630

Heat No: L677

I assume to put a space between the rows I just out an extra return in the code like below (the die and lot need to be on the same line)

stringvar array x := split({memo.memotext},chr(13));
if ubound(x) >= 3 then
"Die No: "+x[1]+chr(13)+
"Lot No: "+x[2]+tabchr(9)+

"Heat No: "+x[3]

Thanks for your help...


 
You should try this when you have access to Crystal. You should just be using: chr(9), NOT tabchr(9), but I think spaces might be easier to work with. Try something like:

stringvar array x := split({memo.memotext},chr(13));
if ubound(x) >= 3 then
"Die No: "+x[1]+" "+
"Lot No: "+x[2]+chr(13)+chr(13)+
"Heat No: "+x[3]

You would need to format this formula to "can grow" also.

-LB
 
Hi LB

I have used spacing which as aligned my DIE No and Lot No ok.

How do I make the Lot No go down abit (currently it is like this)

Die No: 1804 lot No : 51630
Heat No: L677

But I need a carriage return (or 2) in so it looks like

Die No: 1804 lot No : 51630

Heat No: L677

And finally is there a way to make just the Texr appear in bold and not the numbers?

Thanks for your help
 
Hi LB and others

I managed to get the label aligned.

Would appreciate answer on the bold text if you possibly could.

Finally with the way we have programmed the text, do you know of any reason why it would not display.

If I run the report diretly to XML it shows, when i run from our in house system, (Epicor\Advatnge). it runs but the box with the details we have added does not show....

I out a text label nest to the formula on the report and this text show. Any idease please

Thanks
 
Hi again

I have added the entire field as it is into the report and this show when i run the report from our system.

So it appears to be the formula that just does not show the results when run from our system. Any ideas at all please

thanks
 
Are you inserting the formula in a text box? Why?

-LB
 
Hi

That may be a possiblity. Sorry i took the label report over form someone else. It does have a line around it.

However the other fields form the query show on the report it is just this formula that does not show when run from our system.

The formula details show if I point the report directly at the xml file.

Is it just formula's that would no show in a text box?

I will check this on Monday morning.
Thanks
 
I'm not saying that a formula would not show in a text box in another application--I don't actually know. But I was wondering whether you might need to right click on the box and format it to move->"backward" or "to back". You could test whether the box overlays something by coloring it so it is opaque and then use the move feature and see if that makes a difference.

-LB
 
Oh I see what you mean, I did check in most areas for that, but will double check on Monday.

I also have been thinking, if I cannot get it to view. Is there a way that I can have each section of the text into a variable in some way and then on the label they would be 3 seperate formula fields next to a relevant text field.

Another thought is there a forumual that just gives a text like Hello and then I can try that in the same place and see if that comes through from the system.

Just trying eliminate what it may be.

Many thanks
 
The formulas that I showed you can be placed directly on the report--they don't have to go in a text box.

-LB
 
Yes of course. I was just seeing f we put another formul in, even if it just displayed anything, and see if it showed from our system.

Every else does but this formula on the report. I will see if there is a text box or something causing the problem on Monday and post then what I find.

Thanks for your help and advice. have a good weekend
 
Hi LB

I have checked the report and it has not text boxes interfering with the formula.

I have created a new report and just added the formula and then attached it to our system. It still does not show the formula details.

Do you know of another way I can achieve this please.

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top