if {table.number}<>next({table.number})-1 then (
diff := next({table.number})-{table.number};
for i := 1 to diff-1 do(
redim preserve x;
x:={table.number}+i;
if i=diff-1 then
exit for
));
for i := 1 to ubound(x) do(
if {table.number}=next({table.number})-1 then
y := "" else
y := y + totext(x,0,"") + ", ";
);
if len>=2 then
left(y,len-2)
This will display the missing numbers between the current value and the next.
Why do you want to do this? You could probably do this, but you would not be creating new rows, you would just be growing the row to accommodate the missing numbers. Knowing the purpose would be helpful.
if {table.number}<>next({table.number})-1 then (
diff := next({table.number})-{table.number};
for i := 1 to diff-1 do(
redim preserve x;
x:={table.number}+i;
if i=diff-1 then
exit for
));
for i := 1 to ubound(x) do(
if {table.number}=next({table.number})-1 then
y := "" else
y := y + totext(x,0,"") + chr(13);
);
if len>=1 then
totext({table.number},0,"")+chr(13)+left(y,len-1)
Uhm.. Don't mind my last post. I tried your recent formula and no message appeared but it also shows the number before the missing number so it appears twice in the report.
I changed my parameter. The message still appears on a particular page and if I click on next page it goes back to page 1. I prefer your recent formula.
Remove the original field and replace it with the formula, since the field is already built in. Change the formula to this:
whileprintingrecords;
numbervar array x;
redim x[1]; //this resets the array
numbervar diff := 0;
numbervar i;
stringvar y := "";
if {table.number}<>next({table.number})-1 then (
diff := next({table.number})-{table.number};
for i := 1 to diff-1 do(
redim preserve x;
x:={table.number}+i;
if i=diff-1 then
exit for
));
for i := 1 to ubound(x) do(
if {table.number}=next({table.number})-1 then
y := totext(x,0,"") else //this makes the field display if there is no gap
y := y + totext(x,0,"") + chr(13);
);
if len>=1 then
totext({table.number},0,"")+chr(13)+left(y,len-1)
if not onlastrecord and //added this
{table.number}<>next({table.number})-1 then (
diff := next({table.number})-{table.number};
for i := 1 to diff-1 do(
redim preserve x;
x:={table.number}+i;
if i=diff-1 then
exit for
));
for i := 1 to ubound(x) do(
if onlastrecord or //added this earlier
{table.number}=next({table.number})-1 then
y := totext(x,0,"") else
y := y + totext(x,0,"") + chr(13);
);
if len>=1 then
totext({table.number},0,"")+chr(13)+left(y,len-1)
There's no more blank series. Below is my formula for missing series. I placed it in GFb then suppress section if blank. My report is grouped by APPJH.IDRMIT. My fields in section GFa are APPYM.DATERMIT, your most recent formula, APPYM.TEXTPAYOR, APPJH.TEXTREF, APPYM.AMTPAYM and APTCR.TEXTRMIT.
if {@check no 2}<>next({@check no 2})-1 then (
diff := next({@check no 2})-{@check no 2};
for i := 1 to diff-1 do(
redim preserve x;
x:={@check no 2}+i;
if i=diff-1 then
exit for
));
for i := 1 to ubound(x) do(
if {@check no 2}=next({@check no 2})-1 then
y := "" else
y := y + totext(x,0,"") + chr(13);
);
if len>=1 then
totext({@check no 2},0,"")+chr(13)+left(y,len-1)
Also, you are not using my most recent formula. Please update the formula and then report back on the remaining issue.
However, my formula was not designed to work in a group section. Please show the content of your formula {@check no 2} so I can tell how it relates to your fields.
Okay, I just tried my most recent formula (NOT the one in your most recent post) in GFa and it worked perfectly. Assuming your group is on the field referenced in my formula ({table.number}), just remove the group field from GFa. My formula will return that field plus the missing the numbers.
Do I still need your first post in July 3? I forgot to tell you that unbound was highlighted and there was an error saying "A number, currency amount, Boolean, date,time, or string is expected here".
{@check no 2} is tonumber({APPJH.IDRMIT})
I cannot put everything in details section. Data is repeated.
My report is still grouped by check no.. I placed your 2nd post in July 3 in GFa but it did not show the missing numbers.
if not onlastrecord and
{@check no 2}<>next({@check no 2})-1 then (
diff := next({@check no 2})-{@check no 2};
for i := 1 to diff-1 do(
redim preserve x;
x:={@check no 2}+i;
if i=diff-1 then
exit for
));
for i := 1 to ubound(x) do(
if onlastrecord or
{@check no 2}=next({@check no 2})-1 then
y := totext(x,0,"") else
y := y + totext(x,0,"") + chr(13);
);
if len>=1 then
totext({@check no 2},0,"")+chr(13)+left(y,len-1)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.