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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using memo field in formula 1

Status
Not open for further replies.

yehong

Programmer
Sep 22, 2003
291
US
I have a memo field in my report that is 500 characters long and will print for each record. So, if five records, five memo fields of upto 500 characters, and total 2500.
I have created a formula that can concatenate it record by record. I have tried using SQL Expression functions LEFT and RIGHT to get first 250 and last 250 characters. Those expression return correct values.
The problem is when I want to display those broken parts as together. I still get 254 character limitation error. Is there any workaround for that? any idea tips highly appreciated.
thanks
 
So you want to concatenate them? Why?

The post is pretty scattered, you want the first and last 250 characters but you want broken parts together...

This means that you only want the first 250 and last 250?

If so store each to a separate variable/formula, and drop the formulas into a text object.

Oterhwise please post meaningful data, such as Crystal version, database type, example data and expected output.

-k
 
thanks for your response vampire. the size of the memo field is 500 characters. thats why i am breaking it apart to be able to use it in a formula.
here is an exp,assuming i have only two fields on my report:
ID Comments
-----------------------
1 500 characters
2 500 characters
3 500 characters

Now the requirement is to display Comments for IDs 1-3 in one field. That means concatenate Comments for each ID and display them at the bottom of the section, instead of diplaying 500 chars for each id.
Now I have a formula that will concatenate each 250 chars up to the nth ID. But when I concatenate next 250 characters for first ID, I run into 254 character limit error.
Hope this helps understanding my problem.
 
A formula in CR 8.5 is limited to 254 chars output.

Please reread my original post, you need to save each Comments field into a seperate formula/variable, then drop all of the formulas one after the other into a text object, as text objects do NOT have this limit.

You don't state how you know that only these 3 rows are to be used in the concat, presumably it's a grouping of some sort.

So in ther group header you'd have a formula:

whileprintingrecords;
// Assuming 5 max
stringvar C1 :="";
stringvar C2:= "";
stringvar C3:= "";
stringvar C4:= "";
stringvar C5:= "";
numbervar CommentCounter := 1

Details section

whileprintingrecords;
// Assuming 5 max
stringvar C1;
stringvar C2;
stringvar C3;
stringvar C4;
stringvar C5;
numbervar CommentCounter;

if CommentCounter :=1 then
C1 := {table.comments};
CommentCounter := 2;
else if
CommentCounter :=1 then
C2 := {table.comments}
else if
etc...

Create 5 formulas:

@C1
whileprintingrecords;
stringvar C1

@C2
whileprintingrecords;
stringvar C2
etc...

you get the idea

Now in the group footer place a text object (Insert->Text Object) and place all the C1 - C5 formulas in there.

I would handle this all on the database side, but Crystal can handle it.

-k


-k
 
there are two reports that use grouping, and one report that is not using grouping. so I wouldn't know how many IDs will be in each group. so , do i have to make a good guess and create maximum number of formulas? and how would your formulas take care of concatenation?
 
The formulas don't concatenate, the Text Object does that. They simply allow you to break up the 254 chars into identifiable individual formulas so that you can concatenate them.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top