on 06-30-2014 1:48 PM
The following formula is causing the error. How can I fix this formula to correct the error?
whileprintingrecords;
stringvar f:= f + {HNO_NOTE_TEXT.NOTE_TEXT};
Hi
Try this :
whileprintingrecords;
stringvar f:= f + {HNO_NOTE_TEXT.NOTE_TEXT};
If len(f) >= 65534 then
a:=a+{HNO_NOTE_TEXT.NOTE_TEXT};
else
f:=f + {HNO_NOTE_TEXT.NOTE_TEXT};
a&f;
Thanks,
Sastry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would try something like this:
whileprintingrecords;
stringvar f;
stringvar a;
If len(a) > 0 or len(f + {HNO_NOTE_TEXT.NOTE_TEXT} ) >= 65534 then
a:=a+{HNO_NOTE_TEXT.NOTE_TEXT}
else
f:=f + {HNO_NOTE_TEXT.NOTE_TEXT};
f & a
Be sure to initialize both f and a to empty strings in a section that comes before the one where you're using this formula.
-Dell
yes, you'd need to create a bunch of formulae to get around this...one main formula that creates a bunch of string running totals and then some display formulas. the display formulas would then be put into a Text Object.
the formula below uses a buffer (as mentioned below) of 500 characters...adjust this to the longest length of the note field...i.e. if the note field can be up to 2000 characters, then set b to 2000.
create a new formula like...
//@main formula
whileprintingrecords;
stringvar t:= {HNO_NOTE_TEXT.NOTE_TEXT};
numbervar b:= 500;
stringvar f1; stringvar f2; stringvar f3;
stringvar f4; stringvar f5; stringvar f6;
b:= 65534 - b;
if len(f1) <= b then f1:=f1+t
else
if len(f2) <= b then f2:=f2+t
else
if len(f3) <= b then f3:=f3+t
else
if len(f4) <= b then f4:=f4+t
else
if len(f5) <= b then f5:=f5+t
else
if len(f6) <= b then f6:=f6+t;
create another formula and put this in a text object...
//@display1 formula
whileprintingrecords;
stringvar f1;
create another formula and put this in the text object beside the above formula...
//@display2 formula
whileprintingrecords;
stringvar f2;
repeat the steps for creating new formulae 'til you've got one for stringvar f6;
if you want to reset the string running total on a Group level then also create a reset formula for the group header.
whileprintingrecords;
stringvar f1:= ''; stringvar f2:= ''; stringvar f3:= '';
stringvar f4:= ''; stringvar f5:= ''; stringvar f6:= '';
Or, create an array as Ido suggests:
whileprintingrecords;
stringvar array arr;
numbervar i;
if i = 0 then i := 1;
if len(arr[i]) + len({HNO_NOTE_TEXT.NOTE_TEXT}) > 65534 then
(
i := i + 1;
redim preserve arr[i];
arr[i] := {HNO_NOTE_TEXT.NOTE_TEXT};
)
else
(
arr[i] := arr[i] + {HNO_NOTE_TEXT.NOTE_TEXT}
);
And then create multiple formulae that refer to each index of the array like this:
Formula1:
whileprintingrecords;
stringvar array arr[1];
Formula2:
whileprintingrecords;
stringvar array arr;
if ubound(arr) > 1 then
arr[2];
Formula3:
whileprintingrecords;
stringvar array arr;
if ubound(arr) > 2 then
arr[3];
and so on...
-Abhilash
How should I adjust the following formula? It is currently not working after I made the changes to fix the character error.
whileprintingrecords;
stringvar f;
global stringvar t:= f;
stringvar tok1:= 'PREOPERATIVE DIAGNOSES:';
stringvar tok2:= 'POSTOPERATIVE DIAGNOSES:';
numbervar ltok1:= length(tok1);
numbervar itok1:= instr(t, tok1);
numbervar itok2:= instr(t, tok2);
//trim(t[ltok1+itok1 to itok2-1])
if ltok1+itok1 > 0 and itok2 > 2
then trim(t[ltok1+itok1 to itok2-1])
Test for string length to avoid reaching that limit. Perhaps use an array. Depends on your context.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.